Other Ruby scheme implementations

8 views
Skip to first unread message

Tim Cowlishaw

unread,
Feb 4, 2014, 3:51:48 AM2/4/14
to computa...@googlegroups.com
Hi all,

Great meeting yesterday, thank you all!

For reference, here's the couple of existing Scheme-in-Ruby
implementations I mentioned, by James Coglan (of this parish) and
Aaron Gough (who also wrote a very good introduction to writing
parsers with treetop:
http://thingsaaronmade.com/blog/a-quick-intro-to-writing-a-parser-using-treetop.html).
His is particularly interesting, as it defines much of the standard
library in scheme itself, using Ruby only for a minimal core of the
interpreter.

https://github.com/jcoglan/heist
https://github.com/aarongough/flea

Also, here's my attempt at an implementation guided by Tom's specs. Is
anyone else attempting to do the same thing? It'd be really
interesting to compare implementations.

https://github.com/timcowlishaw/little_scheme

See you all at the next one!

Cheers,

Tim.

Tim Cowlishaw

unread,
Feb 4, 2014, 3:54:25 AM2/4/14
to computa...@googlegroups.com
On 4 February 2014 08:51, Tim Cowlishaw <t...@timcowlishaw.co.uk> wrote:
His is particularly interesting, as it defines much of the standard
> library in scheme itself, using Ruby only for a minimal core of the
> interpreter.

Aah, that may not be strictly true - I was looking at the file
extensions without taking note of the contents of the files
themselves. See
https://github.com/aarongough/flea/blob/master/lib/flea/standard_library/cons.scm.
Sorry!

Tom Stuart

unread,
Feb 4, 2014, 7:03:44 PM2/4/14
to Tim Cowlishaw, computa...@googlegroups.com
On 4 Feb 2014, at 08:51, Tim Cowlishaw <t...@timcowlishaw.co.uk> wrote:
> Also, here's my attempt at an implementation guided by Tom's specs. Is
> anyone else attempting to do the same thing? It'd be really
> interesting to compare implementations.
>
> https://github.com/timcowlishaw/little_scheme

This looks great. You’ve made all of the chapter 1 examples pass, so you’re obviously doing well.

Jamie wrote an implementation (and his own tests) at https://github.com/jgwhite/little-schemer. His interpreter looks similar to yours in some ways, e.g. using a hash of procs to hold the primitive operations, but you’ve made some different design decisions in other places, e.g. representing `cons` as a data structure rather than just treating it as a constructor for (non-linked) lists.

I haven’t had time to study either implementation in detail so it’d be great to be able to discuss and compare them in person. I hope we can incorporate code from one or both of these repos into our “shared” interpreter at the next meeting.

Cheers,
-Tom

Zetter

unread,
Feb 5, 2014, 3:05:21 AM2/5/14
to Tom Stuart, Tim Cowlishaw, computa...@googlegroups.com
I have my own code and tests for chapter 1 too:

https://github.com/zetter/schemer

It uses a case statement to define reduction rules. I don't have an
environment yet (to support the 'let .. in' examples of the book) so I
am making the assumption that all atoms that aren't a function are
quoted.

Chris
> --
> You received this message because you are subscribed to the Google Groups "Understanding Computation discussion" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to computationbo...@googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
Reply all
Reply to author
Forward
0 new messages