What Scheme Does Ghuloum Use?

Posted by Don Wakefield on Stack Overflow See other posts from Stack Overflow or by Don Wakefield
Published on 2010-01-29T21:10:58Z Indexed on 2010/06/08 2:12 UTC
Read the original article Hit count: 341

Filed under:
|
|
|

I'm trying to work my way through Compilers: Backend to Frontend (and Back to Front Again) by Abdulaziz Ghuloum. It seems abbreviated from what one would expect in a full course/seminar, so I'm trying to fill in the pieces myself.

For instance, I have tried to use his testing framework in the R5RS flavor of DrScheme, but it doesn't seem to like the macro stuff:

src/ghuloum/tests/tests-driver.scm:6:4: read: illegal use of open square bracket

I've read his intro paper on the course, An Incremental Approach to Compiler Construction, which gives a great overview of the techniques used, and mentions a couple of Schemes with features one might want to implement for 'extra credit', but he doesn't mention the Scheme he uses in the course.

Update

I'm still digging into the original question (investigating options such as Petit Scheme suggested by Eli below), but found an interesting link relating to Gholoum's work, so I am including it here.

[Ikarus Scheme](http://en.wikipedia.org/wiki/Ikarus_(Scheme_implementation)) is the actual implementation of Ghuloum's ideas, and appears to have been part of his Ph.D. work. It's supposed to be one of the first implementations of R6RS. I'm trying to install Ikarus now, but the configure script doesn't want to recognize my system's install of libgmp.so, so my problems are still unresolved.

Example

The following example seems to work in PLT 2.4.2 running in DrEd using the Pretty Big

(require lang/plt-pretty-big)

(load "/Users/donaldwakefield/ghuloum/tests/tests-driver.scm") 
(load "/Users/donaldwakefield/ghuloum/tests/tests-1.1-req.scm") 
(define (emit-program x) 
  (unless (integer? x) (error "---")) 
  (emit " .text") 
  (emit " .globl scheme_entry") 
  (emit " .type scheme_entry, @function") 
  (emit "scheme_entry:") 
  (emit " movl $~s, %eax" x) 
  (emit " ret")
  )

Attempting to replace the require directive with #lang scheme results in the error message

foo.scm:7:3: expand: unbound identifier in module in: emit

which appears to be due to a failure to load tests-driver.scm. Attempting to use #lang r6rs disables the REPL, which I'd really like to use, so I'm going to try to continue with Pretty Big.

My thanks to Eli Barzilay for his patient help.

© Stack Overflow or respective owner

Related posts about Scheme

Related posts about plt-scheme