Page 2 of 2

Posted: Fri 12 May, 2006 8:35 pm
by CoBB
I already mentioned this in another context, but I think it can be a good bet for you too: Forth.

Posted: Fri 12 May, 2006 8:45 pm
by ssartell
what attributes make it suitable for developing a compiler?

Posted: Fri 12 May, 2006 9:35 pm
by CoBB
Sorry, I misunderstood your post, as if you had been looking for a language to write a compiler for.

So, I'd recommend a functional language, precisely because of the ease of creating data structures even despite strict typing. Haskell is a nice language, but if monads are intimidating, you could also use an 'impure' language like ML. And Prolog is an interesting alternative too. It provides you with efficient backtracking (a must for an optimising compiler!) and absolutely versatile data structures; it's untyped too. Most implementations also support DCG, which makes it easy to write a parser.

Posted: Fri 12 May, 2006 9:51 pm
by ssartell
I'll look into those; thanks for the suggestions. You don't think Lisp as a good choice?

Posted: Fri 12 May, 2006 10:01 pm
by CoBB
Might be; I have no experience in it apart from writing a few toy programs. It's definitely a flexible language, and a lot depends on whether you pick a dialect of Scheme or CL. Actually, compiler writing is covered by SICP (which uses Scheme for coding), and it's worth checking out even if you go for a different language.

Posted: Sat 13 May, 2006 3:33 am
by ssartell
Hmm well I do have some experience in Scheme so maybe I'll try that out.

Posted: Mon 15 May, 2006 1:58 pm
by ssartell
Well I'm almost done with the parser that builds the abstract syntax tree. Scheme actually has proven to be a very good choice. Building a stand-along command line with parameters is proving to be very easy and the stucture versatility was exactly what I needed. I should almost be read to start translating into z80 asm soon which means I get to build in functionality and what not. Should be interesting.