Digamma
Ok, so earlier today (22 July 2009) I mentioned on lisp.reddit that I use a custom lisp dialect; here are some more of the details
The language itself is called Digamma; basically, it's a dialect of scheme with the following:
- Dictionaries: '{'(SRFI-88-KEY S-EXPRESSION)*'}'
- Vectors: [ vector data] (vectors are quoted)
- Purely functional operations on collections (strings, vectors, lists, dictionaries):
- first (car, but for all collections)
- rest (cdr; returns freshly allocated collection with shared structure)
- ccons (cons)
- nth (*-ref)
- Lush/Clojure/Arc-style collection application
([1 2 3 4 5] 3)
returns 4
- SRFI-89 improvements:
- After non-keyed parameters, keyed parameters can be used in any order
- :constrain can be used to run a test (CHR, basically)
- :type can be used to specify a specific type (integer, number, &c.).
- :constrain can be used for relationships between arguments: (fn ([x :constrain (~>= x 10)] [y :constrain (~> y x)]) ...)
- :key can be used to specify the actual key object to use
- :opt is used for optional arguments with no default (defaults to '())
- :body is used for non-optional n-ary argument consumption
- :rest is used for optional n-ary argument consumption
- Environment additions: define-in-env, set-in-env, clone-default-env, null-env, basic support for W7 out of the box
- SRFI-34-style error system with the usual guard/dynamic-wind &c
- Near complete support for CL-style
format
with Dylan's ~m
- an FFI, similar to KSM
require
, which simply scales the site-lib for a specific filename
import
, which is Python/CL/Modula-2-like (import "net/irc")
creates net/irc
use
, which is Snow-like
from
which is similar to python's from mod import X
match
which can be used Ocaml/Qi-style
define-syntax
supports syntax-rules
, whereas define-macro
is your plain-jane, unhygenic macro
- a set of base libraries to facilitate "exploratory programming": network protocols, encryption, &c.
- R5RS-support is mostly there; macros recreate much of what's in R5RS, to ease code porting...
- Numerous SRFI support: 9,19,22,34,35,36,28,48,60,70,88,89, with more to come
- #s & #u data types from Kanren, to represent successful & unsuccessful attempts (currently used only in constraints)
What I'd like to add, and will over time:
Currently, there are three basic implementations:
- Vesta: reference implementation, written in C, for getting off the ground (tree walking interpreter)
- Ceres: VM-based implementation, written in C, for actually getting work done
- Enyo: self-hosting native compiler.
Vesta is the most complete, but Ceres is pretty close (mostly POSIX interaction is missing); Enyo is on going, but can compile simple portions of itself
I'm sure I'll have 1.5k "oh, yeah, I forgot X" moments, so I'll post them as they come...