FScheme - Scheme in F#

[Part 1 of the FScheme series] One of my New Year’s goals is to re-read Lisp in Small Pieces and implement all 11 interpreters and 2 compilers. As much as I like the “Lisp in Lisp” idea and enjoyed the eureka moment in SICP when Sussman writes the metacircular interpreter on the board to the…

7

Functional I/O (Historical Debugging)

[Part 14 of the FScheme series] Historical Debugging in VS2010 is quite the engineering feat! We can actually pull off something similar in our interpreter with amazing ease. Because of the pure nature of our functional I/O system (last two posts) and the already centrally managed world state and input it’s very straight forward to…

2

Functional I/O (including “I” this time)

[Part 13 of the FScheme series] Now to add input to our Functional I/O system; following up on the previous post. We already had bouncing balls so how ‘bout we add a mouse-controlled paddle and make a primitive “Pong”? Mouse Input To keep it simple, we’re just going to add mouse position as input; including…

0

Functional I/O (or at least “O”)

[Part 12 of the FScheme series] I just watched Matthias Felleisen’s talk on Functional I/O and read this paper and decided to bolt on a little I/O system to the FScheme interpreter we’ve been building. It’s a pretty nice FRP-type system. Reading the paper or watching the talk is well worth the time. Pure Functional…

2

Playing Dice with the Universe

[Part 11 of the FScheme series] We’re now taking the first small step into the world of nondeterministic logic programming (chapter 16 of Bill Hails’ book). Hopefully you enjoyed the last post about continuation passing and found the idea to be ripe with potential power; indeed so powerful that we’re going to use it now…

0

Turning Your Brain Inside Out with Continuations

[Part 10 of the FScheme series] We’re into one of the most magical chapters in Bill Hails’ book. We’re about to add a very strange and dangerous feature to the interpreter: ‘call/cc’ (“call with current continuation”). To appreciate the beauty of it, we’ll first look at continuation passing style (CPS) in general, what it’s good…

7

Language vs. Library

[Part 9 of the FScheme series] Primitives Perhaps this post should have gone along with the one about macros and how Lisp is a “programmable programming language.” The common tension in any language or runtime design is how much to build in as primitives and how much to implement as libraries within the language or…

0

Oh, The Humanity!

[Part 8 of the FScheme series] ‘set’, ‘begin’, ‘define’ Here we implement chapters 10 and 11 of Bill Hails’ book. We’re about to do something hideous and horrible to the language (and to our interpreter). We’re about to add assignment. This is a travesty to a pure functional programmer, but this whole thing is a…

0

No Wait, Macro the Ultimate!

[Part 7 of the FScheme series] The Soul of Scheme We’re now getting into the language-oriented features of Scheme. This is why Scheme is one of my very favorite languages. Scheme is of course a multi-paradigm language; functional, imperative (next post), object oriented (soon), but most wonderfully and uniquely language-oriented. In object-oriented programming the approach…

0

What's Lisp Without Lists?!

[Part 6 of the FScheme series] Once again, I must plug Bill Hails’ book Lists How could we even be pretending this is Lisp when we have yet to add lists! We need to add the standard ‘cons’, ‘car’, and ‘cdr’ for constructing and destructing list structure and we’ll go ahead and add the nice-to-have…

1