<div>Jules,</div>
<div> </div>
<div>If you're looking for a text on implementing interpreters using functional programming languages, Essentials of Programming Languages by Friedman et al. is a good start. It uses Scheme instead of Haskell, but it might be helpful when you're reading Haskell code, like samples that come with the Parsec library, or Graham's Swish project.
</div>
<div> </div>
<div>Also, Autrijus Tang, the author of Pugs mentions a couple of textbooks that he found invaluable while working on Pugs, although I think they're at a more advanced level, so you might not want to start off with them:
<a href="http://svn.perl.org/perl6/pugs/trunk/docs/01Overview.html">http://svn.perl.org/perl6/pugs/trunk/docs/01Overview.html</a></div>
<div> </div>
<div>Davor<br><br> </div>
<div><span class="gmail_quote">On 1/26/06, <b class="gmail_sendername">Graham Klyne</b> <<a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:GK@ninebynine.org" target="_blank">GK@ninebynine.org</a>> wrote:
</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">I used Haskell to implement a kind of scripting language, and it seemed most<br>usable to me.<br><br>I particular, I liked the fact that it was possible to write a Parsec parser
<br>that "compiles" script language expressions directly into executable Haskell<br>functions, avoiding the need for a separate interpretation layer, and because of<br>this I think performance is probably quite respectable. Higher order functions
<br>are, I believe, a real boon for this kind of work.<br><br>My work in this area is a bit stale, but can be found at:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ninebynine.org/RDFNotes/Swish/Intro.html" target="_blank">
http://www.ninebynine.org/RDFNotes/Swish/Intro.html </a><br>The particular module that "compiles" script language to functions is here:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ninebynine.org/Software/Swish-0.2.1/HaskellRDF/SwishScript.hs" target="_blank">
http://www.ninebynine.org/Software/Swish-0.2.1/HaskellRDF/SwishScript.hs </a><br><br>The parser assembles a list of function that uses the "SwishState helper<br>functions" as primitives, and operate in the SwishStateIO monad - an I/O monad
<br>that also incorprates some specific state that is used by my interpreter. <br>Upper-level functions are 'parseScriptFromString' and 'script'.<br><br>#g<br>--<br><br>Jules Jacobs wrote:<br>> Hi,<br>><br>> I would like to create a scripting language, similar to Ruby, Perl and
<br>> Python. Pugs, written in Haskell, is a Perl6 implementation. Is Haskell <br>> a good choice for me? I have no experience with Haskell (yet), but I<br>> like the concept of functional programming. Because Haskell will
<br>> probably be too slow for the final implementation, I will have to <br>> rewrite it in C or maybe D. Haskell can be very useful as a<br>> test/prototype implementation, where speed is not very important. But
<br>> will I be able to create a clean, and easy to understand implementation <br>> in Haskell? The scripting language will be object oriented, and<br>> imperative. Is that a problem because Haskell is functional, or is there
<br>> be an obvious and nice way to implement an imperative scripting language? <br>><br>> The language is very dynamic, and the source-tree needs to be in memory<br>> because it is modifiable at run-time.<br>
><br>> Would it be good to do this in Haskell, and port it to C if I like the <br>> implementation, or start in C? Keep the parser/lexer for the source code<br>> in Haskell, but port only the interpreter to C?
<br>><br>> What would be a good place to start? I am reading Yet Another Haskell <br>> tutorial, and I've read the first 6 of two dozen lessons in Haskell.<br>> What to do next, practice/read more/start with the implementation of the
<br>> scripting language?<br>><br>> Thanks in advance, <br>><br>> Jules<br>><br>><br>> ------------------------------------------------------------------------<br>><br>> _______________________________________________
<br>> Haskell mailing list<br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Haskell@haskell.org" target="_blank">Haskell@haskell.org</a><br>> <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.haskell.org/mailman/listinfo/haskell" target="_blank">
http://www.haskell.org/mailman/listinfo/haskell</a><br><br>--<br>Graham Klyne<br>For email:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.ninebynine.org/#Contact" target="_blank">http://www.ninebynine.org/#Contact
</a><br><br>_______________________________________________<br>Haskell mailing list<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:Haskell@haskell.org" target="_blank">Haskell@haskell.org </a><br>
<a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.haskell.org/mailman/listinfo/haskell" target="_blank">http://www.haskell.org/mailman/listinfo/haskell</a><br></blockquote></div><br>