| ||
|
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) TechInterview.org CityDesk FogBugz Fog Creek Copilot The Old Forum Your hosts: Albert D. Kallal Li-Fan Chen Stephen Jones |
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: http://opal.cabochon.com/~stevey/blog-rants/ten-challenges.html I haven't read them myself but they sound like a good starting point if you're interested in language design.
Read http://lambda-the-ultimate.org/ 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: http://www.cs.vu.nl/~dick/PTAPG.html 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: http://www.info.ucl.ac.be/~pvr/book.html If you're slick you might even find the PDF of the book they posted before it was in print.
Read the books, and then try to do something. LLVM (www.llvm.org) 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.
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: http://www.amazon.com/exec/obidos/tg/detail/-/0763714224?v=glance
Sgt.Sausage 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 | |
Powered by FogBugz
