This is a "quick and dirty" interpreter for a Scheme-ish language in Haskell, mostly based off of Peter Michaux's article "Scheme From Scratch." It's my way of getting better with Haskell while simultaneously learning about Scheme & Lisp See Prelude.hscm and Test.hscm for usage.
- install Parseclone
- download hsscheme source, unzip, and cd into extracted directory
$ sudo cabal install(note: the dependency tree is pretty big, because of theviewexperimental feature -- see below)- create
/usr/lib/hsscheme/and movePrelude.hscmthere $ hsscheme(for REPL) or$ hsscheme myfile.hscm(to run file)
Developed on Ubuntu and OS X with GHC 6.12.1.
The function view visualizes data structures using Ubigraph, via vacuum-ubigraph. Usage:
- install ubigraph (see site)
- start server:
$ ubigraph_server - in hsscheme:
>> (view [any value])
This uses vacuum to display the Haskell data structures (SchemeObj in Language/Scheme/Model.hs) representing Scheme objects. Try visualizing a non-builtin function (just (view myfunc)) -- it'll visualize the data that is the code for that function. Not very useful, but pretty neat.
- lambdas (closures)
- tracebacks
- source locations for error messages
- a
catchform - fail gracefully when
ubigraph_serverisn't running andviewis called