The Joel on Software Discussion Group (CLOSED)

A place to discuss Joel on Software. Now closed.

This community works best when people use their real names. Please register for a free account.

Other Groups:
Joel on Software
Business of Software
Design of Software (CLOSED)
.NET Questions (CLOSED)
Fog Creek Copilot

The Old Forum

Your hosts:
Albert D. Kallal
Li-Fan Chen
Stephen Jones

how to learn how to write a wasabi like language?

My background: I have undergraduate degrees in math and physics, and a minor in computer science. Been programming for six years. Good at C++, Ruby, emacs lisp. Took equivalent of SICP up through a tough algorithms class in university. My CS electives were in computer graphics.

However didn't take programming languages or compilers.

If I work through something like the Aho "dragon" book, and look at the language specs for PHP and Javascript, will I be able to figure this out on my own? Any other suggestions?
Friday, September 01, 2006
My first suggestion would be not to do it. :)

Before diving into compilers have a think about what you want in the language, what features from other languages do you want? e.g. very few popular languages use back-tracking as a control flow method.

Take a look at books 4-6 on this list:

I haven't read them myself but they sound like a good starting point if you're interested in language design.
Miles Barr Send private email
Friday, September 01, 2006
Read until you understand the papers that get posted to the front page.

If you want a language to study, go read up on Haskell, Erlang, and an ML dialect :).

Oh yeah, parsing is easy. Use JavaCC, Yacc, or whatever. If you really want to read more:

Parsing and syntax are the suckers game. You can spend a lot of time on it, and you will still have a language that sucks.

Go read:
If you're slick you might even find the PDF of the book they posted before it was in print.
Anonymous to protect the guilty. Send private email
Friday, September 01, 2006
Read the books, and then try to do something.  LLVM ( is a "compiler infrastructure kit".  I'm working on a little language for a game with it.  I would look into it, along with those books.
Friday, September 01, 2006
Maybe a dumb question but is there any meta language out there that out-of-the-box will compile to assembly/machine language?

That is:

- start with files in my New Fancy Language
- my parser parses my files and produces the meta language or bytecode etc
- the meta lang/bytecode gets run it through the assembly generator to produce native code.

Roark Fan
Friday, September 01, 2006
A prerequisite to our "Compilers 501" course was a course called "Formal Languages and Automata" -- I *highly* recommend the subject for anyone interested in creating their own language. Google the course name, the entire phrase, and you'll get an idea of what it covers.

Here's a link to the text we used, however I used an earlier edition and can't comment on the current edition:
Friday, September 01, 2006
The very best book on this is "Programming Language Pragmatics".

It covers:

Automata theory
Computer architecture and assembly
Human usability concerns.

Everything in one package.  It isn't going to make you a master of any one of these three, but it will give you a start and show you how they all work together.  I have a CS degree so beyond this book pretty much the only other stuff I am using is the Intel docs for x86 and the help for NASM.  You might need more books.

This is the 6 star book.  Buy it.
Tom C
Saturday, September 02, 2006

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz