|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
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 ![]()
__________________
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) Last edited by amfr : December 16th, 2005 at 04:54 PM. |
|
#2
|
|||
|
|||
|
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. ![]() |
|
#3
|
||||
|
||||
|
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 Puzzle of the Month solved by sizeablegrin, etienne141 and L7Sqr, superior C/C++ programmers of the month |
|
#4
|
||||
|
||||
|
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 "Energy has the opportunity to change the climate if it's done right." - Sen. John Ensign, R-Nev. (quoted out of context) |
|
#5
|
|||
|
|||
|
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. |
|
#6
|
||||
|
||||
|
c'mon Scorps - tell 'em all about MOO
![]() christo
__________________
. Spiration channels: Free scripts, programming tutorials and articles Dotcut alerts: Online Press cuttings / news alerts Clearprop: UK microlight school, wiltshire Uk dating: UK safe dating with Topdates About Christo . . |
|
#7
|
||||
|
||||
|
Quote:
fun? because it's there? & go for it Scorp.
__________________
|
|
#8
|
||||
|
||||
|
Dependent on your needs, might I suggest a markup language based on xml for your first stab at creating a programming language.
__________________
The day I get my hands on the cookbook it's all over. -nicky |
|
#9
|
||||
|
||||
|
Quote:
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. |
|
#10
|
|||
|
|||
|
Quote:
![]() |
|
#11
|
|||
|
|||
|
Quote:
Hey, that's a Microsoft trademark!!! They could sue youfor that!!! ![]() |
|
#12
|
|||
|
|||
|
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 |