You have some way to go. It may be helpful to take a look at our course on compiler construction, in which we explain how to use the various tools we have built to build compilers and interpreters. I suggest you download the code and the tools and the lecture notes, and start to try to make some of the exercises. Our students somehow manage ;-} http://www.cs.uu.nl/wiki/Ipt/WebHome Doaitse Swierstra On 2006 jan 25, at 17:23, Bulat Ziganshin wrote:
Hello Jules,
Wednesday, January 25, 2006, 12:29:48 AM, you wrote:
JJ> I would like to create a scripting language, similar to Ruby, Perl and JJ> Python. Pugs, written in Haskell, is a Perl6 implementation. Is Haskell a JJ> good choice for me?
yes, if you ready to learn many new things. Haskell is very different from non-FP languages
JJ> I have no experience with Haskell (yet), but I like the JJ> concept of functional programming. Because Haskell will probably be too slow JJ> for the final implementation, I will have to rewrite it in C or maybe D.
i'm not sure that you will not change your plans. may be sometime you will prefer to rewrite existing Haskell implemetations just to make your interpreter faster ;)
JJ> Haskell can be very useful as a test/prototype implementation, where speed JJ> is not very important. But will I be able to create a clean, and easy to JJ> understand implementation in Haskell?
if speed is not main goal - definitely yes
JJ> The scripting language will be object JJ> oriented, and imperative. Is that a problem because Haskell is functional, JJ> or is there be an obvious and nice way to implement an imperative scripting JJ> language?
it's no problem at all
JJ> The language is very dynamic, and the source-tree needs to be in memory JJ> because it is modifiable at run-time.
JJ> Would it be good to do this in Haskell, and port it to C if I like the JJ> implementation, or start in C? Keep the parser/lexer for the source code in JJ> Haskell, but port only the interpreter to C?
yes, you can use C and Haskell together. but C code can't walk Haskell data structures, so such co-working will need some manual work
JJ> What would be a good place to start? I am reading Yet Another Haskell JJ> tutorial, and I've read the first 6 of two dozen lessons in Haskell. What to JJ> do next, practice/read more/start with the implementation of the scripting JJ> language?
read about parsec library and start :) this lib already contains several examples of implementing small FP and imperative languages, each implemetation is just 5-10 kb in size
-- Best regards, Bulat mailto:bulatz@HotPOP.com
_______________________________________________ Haskell mailing list Haskell@haskell.org http://www.haskell.org/mailman/listinfo/haskell