[Haskell] Scripting language: is Haskell a good choice?
cubranic at gmail.com
Fri Jan 27 13:33:22 EST 2006
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.
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:
On 1/26/06, Graham Klyne <GK at ninebynine.org> wrote:
> I used Haskell to implement a kind of scripting language, and it seemed
> usable to me.
> I particular, I liked the fact that it was possible to write a Parsec
> that "compiles" script language expressions directly into executable
> functions, avoiding the need for a separate interpretation layer, and
> because of
> this I think performance is probably quite respectable. Higher order
> are, I believe, a real boon for this kind of work.
> My work in this area is a bit stale, but can be found at:
> The particular module that "compiles" script language to functions is
> The parser assembles a list of function that uses the "SwishState helper
> functions" as primitives, and operate in the SwishStateIO monad - an I/O
> that also incorprates some specific state that is used by my interpreter.
> Upper-level functions are 'parseScriptFromString' and 'script'.
> Jules Jacobs wrote:
> > Hi,
> > I would like to create a scripting language, similar to Ruby, Perl and
> > Python. Pugs, written in Haskell, is a Perl6 implementation. Is Haskell
> > a good choice for me? I have no experience with Haskell (yet), but I
> > like the concept of functional programming. Because Haskell will
> > probably be too slow for the final implementation, I will have to
> > rewrite it in C or maybe D. Haskell can be very useful as a
> > test/prototype implementation, where speed is not very important. But
> > will I be able to create a clean, and easy to understand implementation
> > in Haskell? The scripting language will be object oriented, and
> > imperative. Is that a problem because Haskell is functional, or is there
> > be an obvious and nice way to implement an imperative scripting
> > The language is very dynamic, and the source-tree needs to be in memory
> > because it is modifiable at run-time.
> > Would it be good to do this in Haskell, and port it to C if I like the
> > implementation, or start in C? Keep the parser/lexer for the source code
> > in Haskell, but port only the interpreter to C?
> > What would be a good place to start? I am reading Yet Another Haskell
> > tutorial, and I've read the first 6 of two dozen lessons in Haskell.
> > What to do next, practice/read more/start with the implementation of the
> > scripting language?
> > Thanks in advance,
> > Jules
> > ------------------------------------------------------------------------
> > _______________________________________________
> > Haskell mailing list
> > Haskell at haskell.org
> > http://www.haskell.org/mailman/listinfo/haskell
> Graham Klyne
> For email:
> Haskell mailing list
> Haskell at haskell.org
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell