Back to 2014-proposals
Title: Greenspun - A Lisp Extension Library for Go
Proposer: Eleanor McHugh
Type: Case-Study
Duration: 90 mins
Description:
Greenspun [http://github.com/feyeleanor/greenspun] is a lightweight
implementation of Lisp written in Go and intended for use as an
application extension language. It features a byte code virtual machine
based on the SECD architecture and a DSL for performing Lisp-like data
manipulations in core application logic.
During the course of this session we'll explore three main topics through
the design and implementation of the Greenspun system.
Firstly we'll take a deep dive into the Go programming language, with
particular emphasis on its type system and compositional approach to object
orientation as well as it's first-class support for concurrency. We'll
introduce Go's testing and benchmarking system as an essential tool for
day-to-day development.
Next we'll look at the implementation of a traditional SECD virtual machine
in Go, a popular model for executing programs in functional languages. The
core of the SECD architecture is a set of four registers (Stack, Environment,
Control and Dump) referencing singly-linked lists and a byte code with ten
instructions which we'll study in detail along with the compiler for
translating Lisp s-expressions into byte code.
We'll conclude the session by exploring modifications to the SECD
architecture which support Go's user-defined types, concurrent execution,
tail call elimination, wrapping system calls and general performance
enhancements.
By the end of the session attendees should be comfortable reading Go source
code, have a basic feel for developing with the language and the necessary
background to write their own Lisp implementation.