You are not logged in.

#1 2008-08-03 14:26:54

patogen
Member
Registered: 2008-05-11
Posts: 86

Howto create a programming system

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

#2 2008-08-03 14:39:25

drakosha
Member
Registered: 2006-01-03
Posts: 253
Website

Re: Howto create a programming system

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 smile

Offline

#3 2008-08-03 15:03:58

andre.ramaciotti
Member
From: Brazil
Registered: 2007-04-06
Posts: 649

Re: Howto create a programming system

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

#4 2008-08-03 15:17:07

peart
Member
From: Kanuckistan
Registered: 2003-07-28
Posts: 510

Re: Howto create a programming system

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

#5 2008-08-03 15:19:21

XFire
Member
From: UK
Registered: 2008-05-11
Posts: 192

Re: Howto create a programming system

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

#6 2008-08-03 20:18:06

pauldonnelly
Member
Registered: 2006-06-19
Posts: 776

Re: Howto create a programming system

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

#7 2008-08-04 07:53:43

wuischke
Member
From: Suisse Romande
Registered: 2007-01-06
Posts: 630

Re: Howto create a programming system

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

#8 2008-08-04 09:00:48

piotroxp
Member
Registered: 2008-08-04
Posts: 66

Re: Howto create a programming system

^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 ! smile

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

Board footer

Powered by FluxBB