Page 1 of 4 123 ... Last
  • Jump to page:
    #1
  1. Tux to the rescue!
    Devshed Newbie (0 - 499 posts)

    Join Date
    Feb 2005
    Location
    localhost
    Posts
    342
    Rep Power
    202

    Writing own programming language


    Can anyone give me any tips on writing my own programming language?
    I have lokked at YACC, but I dont really get it
    Last edited by amfr; December 16th, 2005 at 04:54 PM.
    Without question, the greatest invention in the history of mankind is beer. Oh, I grant you that the wheel was also a fine invention, but the wheel does not go nearly as well with pizza. (Dave Barry's Bad Habits, Dave Barry)
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2005
    Posts
    309
    Rep Power
    42
    Damn, ambitious!

    I admit to having done a very simple scripting language, but it wasn't very functional. To be honest, I don't know what to point you to. People who conceive their own programming languages usually have umpty years of experience.
  4. #3
  5. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    I have one that I wrote in around 550 lines of C++ code with comments. Let me know if you want the source. YACC takes the drudgery of writing two parts of an interpreter or compiler, which is the lexer and the parser. I'll write a bigger post about writing a compiler shortly.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  6. #4
  7. Type Cast Exception
    Devshed Supreme Being (6500+ posts)

    Join Date
    Apr 2004
    Location
    OAKLAND CA | Adam's Point (Fairyland)
    Posts
    14,954
    Rep Power
    8617
    If I was to make a language I'd make it very specific. For example, I'm of the mind to write an object oriented music score generating language, it's something I've thought about for a while. A way of making objects out of some of Schillinger's concepts in his volumous System of Musical Composition which can programmatically be manipulated, likely generating MIDI output which can then be fed into whatever sequencer from there.

    I can't imagine a single person making a full blown multi-purpose language in this modern day ...
    medialint.com

    “Today you are You, that is truer than true. There is no one alive who is Youer than You.” - Dr. Seuss
  8. #5
  9. No Profile Picture
    Redpill
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2005
    Posts
    1,660
    Rep Power
    151
    What would that language be for?
    Unless it's something nobody's ever done before you're better sticking to the big guns.
    Don't invent the wheel twice.
  10. #6
  11. Introspective
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Nov 2001
    Location
    London, UK
    Posts
    3,317
    Rep Power
    110
    c'mon Scorps - tell 'em all about MOO


    christo
    This is me: http://chris.uk.com
  12. #7
  13. (retired)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2003
    Location
    The Laboratory
    Posts
    10,101
    Rep Power
    0
    What would that language be for?
    fun? because it's there?

    & go for it Scorp.
  14. #8
  15. No Profile Picture
    rebel with a cause
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    May 2004
    Location
    The Batsh!t Crazy State.
    Posts
    5,817
    Rep Power
    3462
    Dependent on your needs, might I suggest a markup language based on xml for your first stab at creating a programming language.
    Dear God. What is it like in your funny little brains? It must be so boring.
  16. #9
  17. Banned ;)
    Devshed Supreme Being (6500+ posts)

    Join Date
    Nov 2001
    Location
    Woodland Hills, Los Angeles County, California, USA
    Posts
    9,625
    Rep Power
    4247
    Originally Posted by medialint
    I can't imagine a single person making a full blown multi-purpose language in this modern day ...
    Java, Python and Ruby generally spring to mind .

    As for MOO, I wrote it in a fit of boredom mainly. The history is here.
    I believe there are a few people using the MOO engine in their own products.
    Up the Irons
    What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
    "Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
    Down with Sharon Osbourne

    "I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo
  18. #10
  19. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Oct 2005
    Posts
    27
    Rep Power
    0
    There are NO bugs . Anything you see that may be buggy, is actually A FEATURE!!
  20. #11
  21. No Profile Picture
    Redpill
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2005
    Posts
    1,660
    Rep Power
    151
    There are NO bugs . Anything you see that may be buggy, is actually A FEATURE!!
    Hey, that's a Microsoft trademark!!! They could sue youfor that!!!
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Apr 2005
    Posts
    112
    Rep Power
    10
    First decide whether you are going to develop compiler or interpreter.
    A compiler converts source language into some another language. For example, C compiler converts C program into a program in machine language. Interpretor simply executes the instruction without any conversion.

    For designing compiler, I would like you to learn flex and yacc. It will simplify your work. Also, if you are converting it to machine language than go through the instruction-opcode table. This is mentioned in the spec of CPU for which you are designing the compiler. Also, depending on your OS, you will have to go through the format of executable file. For example, linux executable file will have machine lanuguage code written as per POSIX format.

    Regarding interpreter, I don't know much about how to implement it. But interpreters are easier to implement and also helps in making your language OS independent.

    You can refer to following post:
    http://forums.devshed.com/other-programming-languages-139/how-does-an-interpreter-compiler-work-312483.html
  24. #13
  25. Only the strong survives!!.
    Devshed God 1st Plane (5500 - 5999 posts)

    Join Date
    Feb 2003
    Location
    A World of wonders.
    Posts
    5,583
    Rep Power
    407
    Originally Posted by amfr
    Can anyone give me any tips on writing my own programming language?
    I have lokked at YACC, but I dont really get it
    Do you even know any language? because you have to understand its concepts before even start your own language.
  26. #14
  27. Master PIMP
    Devshed Novice (500 - 999 posts)

    Join Date
    Jun 2004
    Location
    Santa Monica, CA
    Posts
    753
    Rep Power
    47
    What is the benefit of creating your own language? What application cannot be created with the modern day languages?
  28. #15
  29. No Profile Picture
    Redpill
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Nov 2005
    Posts
    1,660
    Rep Power
    151
    Originally Posted by midfielder
    What is the benefit of creating your own language? What application cannot be created with the modern day languages?
    The thing is, anything is possible with many low-level programming languages of today, say Assembler. But would you use Assembler for everything? You won't write a forum in Assembler.

    But if you were writing a chess program for grandmaster tournments, you wouldn't use PHP. You'd go back to the basics and use the fastest there is.

    It's not about possibility. For example, any mathematical exercise (eg. sorting a dataset) can be solved using low-level brute force, but it would take years to sort just 1000 elements. It's about how practical a language is for a particular application. With the advent of the Internet and dynamic webpages, PHP and Javascript were created. C++ was created because C wasn't capable of object-oriented programming.

    Some day in the future, a door may open to a brand new area of computing, a new logic, a new thought pattern, that requires the invention of a brand new language to complement and make full use of the new technology.

    Comments on this post

    • techMonster agrees
    • Gnome101 agrees : Very good response
Page 1 of 4 123 ... Last
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo