You are not logged in.
There are hundreds of programming systems out there. C, Python, Lisp, C#, C++, D, Haskell and so on. But how do you create a programming language? I've searched the internet, but I cannot find any information om how you create a language. It's not that I do wanna do it (because I could probably spend my time on something 'wiser') but I really find it a hard concept on how you can make a computer to actually make a program out of just some text.
So, I would say this is more of "I want links and/or books that describe this topic" than for somebody to actually explain it in great detail. But if somebody could make a simple explanation of how you could create a minimal programming system that really isn't of much use. Tips?
We met up with the aliens and guess what? They have no word for fluffy!
Offline
Generally, no one creates programming languages without being a programmer for a certain (long?) time... being a programmer for a certain time means you'll know how to do it
Offline
Search how compilers are made. When you understand how a compiler for a known language works, you will have some ideia of how create a compiler to a new language.
(lambda ())
Offline
When in college, we used lexx and yacc to create a language. I don't know if that's how it's still done, though. The modern linux equivalents are called flex and bison.
Offline
You can also use an interpreter, which Python does. You could create your own language, and have a C program for instance interpret your language into C or something else. Provided I am not mistaken.
There is a difference between bleeding [edge] and haemorrhaging. - Allan
Offline
I don't know of any books that explain this for laymen. Mostly stuff on compilers is for people who want to write them. But here are some of the latter, in no particular order:
An Incremental Approach to Compiler Construction, Abdulaziz Ghuloum
http://scheme2006.cs.uchicago.edu/11-ghuloum.pdf
A paper in which a Scheme compiler is written in 24 small steps.
Paradigms of Artificial Intelligence Programming, Peter Norvig
A big book with a lot of great stuff in it, including a couple of interpreters and a Prolog to Lisp compiler.
Let's Build a Compiler, Jack Crenshaw
http://compilers.iecc.com/crenshaw/
A series of articles, probably the least technical thing here.
Write Yourself a Scheme in 48 Hours, Jonathan Tang
http://halogen.note.amherst.edu/~jdtang … rview.html
A Scheme interpreter written in Haskell.
Unfortunately, a lot of stuff on compilers starts out with parsers, even though a full-fledged parser is only necessary for overcomplicated languages with things like infix syntax.
Offline
In a very brief form:
1. You need a grammar for your language to write source files in. That's the part were being a programmer is really useful.
2. You need a lexer and a parser to "understand" the content of your source file and check it for validity according to your grammar rules. (both syntactically and semantically if possible). As mentioned above, for instance flex or bison take the lexer part in open source projects while yacc is often used to generate the parser.
3. Translate your "understanding" of the source code into another target language, usually byte code (i.e. Java, Python) or native machine code.
An interesting read: http://llvm.org/docs/tutorial/index.html (llvm Kaleidoscope tutorial)
Offline
^I cosign whats written above
If you want to create something the scale of C/C++,
you have to know a lot about assemblers in general. You have to know the hardware background that you will be working on. You have to choose an operating system to work with (or write your own). You must uderstand that it is a grueling experience, but is definetly worth taking a shot at. Even if you won't succed, you will still learn alot about computing in general.
Good luck !
Last edited by piotroxp (2008-08-04 09:01:52)
I invented EM Field Patterns and fixed Feynmann's Diagrams so they are physical.
Offline