Your own programming language!

This is a discussion on Your own programming language! within the Tech Board forums, part of the Community Boards category; Hello guys, i wann learn how to create my own programming language and what tutorilas can i read! For example ...

  1. #1
    Registered User
    Join Date
    Jul 2004
    Posts
    99

    Your own programming language!

    Hello guys,
    i wann learn how to create my own programming language and what tutorilas can i read!
    For example i wanna make a very simple program
    like:

    print (hello)

    and this will print hello? i must work with C do make my own language!
    I wanna make a very simple language lik eteh above with only 2-3 values like print and such...

  2. #2
    5|-|1+|-|34|) ober's Avatar
    Join Date
    Aug 2001
    Posts
    4,429
    You have to create a compiler for your new language. Something that will understand your syntax and do what you want with it. I don't advise it.

  3. #3
    Registered User
    Join Date
    Jul 2004
    Posts
    99
    any tutorial how to maek a compiler?
    for example look AIML, does it need a compiler?

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,555
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    Registered User
    Join Date
    Jul 2004
    Posts
    99
    Thanks!

  6. #6
    Software Developer jverkoey's Avatar
    Join Date
    Feb 2003
    Location
    University of Waterloo
    Posts
    1,903
    I've been working on my own language for about a year or so now and it's been coming along pretty nicely so far, and basically how I started was just sat down and brainstormed ideas of how I think other languages worked, and then tried to redo that in a sense.

    Basically, just think in your head or on paper about how you would go about interpreting a language, and then turn that in to code.

    like, for example, in your case, you've got the

    print

    function, so your first task is to read in a file and analize it's contents and see if it says the word "print" in there, and then if it does, check for the correct syntax, like a parenthesis after that, and then the text in quotes, and a closing parenthesis, etc...

    just experiment and keep at it, you'll eventually get it if you work at it hard enough

  7. #7
    Registered User whackaxe's Avatar
    Join Date
    Mar 2004
    Posts
    332
    writing a scripting language would be easier to start with i would imagine.
    I loathe pointers

  8. #8
    Registered User
    Join Date
    Jul 2004
    Posts
    99
    I wanna make the same language like AIML

  9. #9
    pronounced 'fib' FillYourBrain's Avatar
    Join Date
    Aug 2002
    Posts
    2,297
    a good start would be to use lex and yacc to parse your language. if you can successfully create a yacc grammar then you can start to think about a compiler for it.
    "You are stupid! You are stupid! Oh, and don't forget, you are STUPID!" - Dexter

  10. #10
    Registered User
    Join Date
    Jul 2004
    Posts
    99
    ok,
    i will try

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What language did they make Java in?
    By jverkoey in forum A Brief History of Cprogramming.com
    Replies: 17
    Last Post: 07-03-2005, 04:18 PM
  2. Strange loop
    By D@rk_force in forum C++ Programming
    Replies: 22
    Last Post: 12-18-2004, 01:40 PM
  3. Language of choice after C++
    By gandalf_bar in forum A Brief History of Cprogramming.com
    Replies: 47
    Last Post: 06-15-2004, 01:20 AM
  4. Languages dying
    By Zewu in forum A Brief History of Cprogramming.com
    Replies: 31
    Last Post: 07-29-2003, 10:08 AM
  5. Language Script..
    By vasanth in forum A Brief History of Cprogramming.com
    Replies: 12
    Last Post: 03-30-2003, 05:48 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21