DELC ==== By Robert Smith INTRODUCTION ============ DELC is an old compiler for a subset of the Scheme-like language "Del" I developed a long time ago. It is mostly intended as a minimal example of continuation-passing style and closure conversion. It supports (up to bugs) lambdas, mutable closures, some arithmetic, reifiable continuations, and printing of integers. Booleans are just integers, but they are bound to T and NIL. There are no lists (though they can be emulated with closures). There are no strings. There is no God. LANGUAGE ======== Equivalent in Scheme/Lisp: AND OR LET LAMBDA IF PROGN Definitions: DEFINE Mutation: SETQ Boolean Values: T NIL Built-In Functions: + - * / < EQ PRINT WRITE-CHAR TERPRI CALL/CC USAGE ===== From your favorite Common Lisp, after loading delc.lisp, you have a choice of two main courses: * DEL-COMPILE-FORM * DEL-COMPILE-FILE If you have a file, everything must be wrapped in a giant DO form since only one form is actually read. EXAMPLE ======= In Lisp: > (del-compile-form '((lambda (x) (* 4 x)) (+ 1 2))) ;;;; Wrote out.c In your shell: $ gcc out.c -o out $ ./out 12 BUGS ==== * Determining if the platform is 32 or 64 bit is not portable. * There is an issue with deeply closed variables.
157d1d5 - * Allow (SETQ (%CLOSURE-REF …) …) syntax
54080b4 - no-op should no longer be necessary
d5c45a8 - Merge
af644a7 - improve code generation for IFs
76ed5a0 - change names
9dbf2c0 - more reorg
8bfbc3c - split compiler into logical sections
6131123 - oops forgot a comment
810db59 - clear out unused/dead $SAVE-TOP garbage.
cff51bb - * add $ALLOCATE and $STORE
f55db53 - Add a condition flag. Change conditional branching to jump if zero
48b27b8 - Add sum-of-square tests
5271ae9 - alpha quality codegen backend