Scheme on SECD
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Dmytro S 53d2f96021 Added gitter to README 3 years ago
docs added docs/ 3 years ago
std disjointness of types; (eof-object); exceptions fixed 5 years ago
tests tests/hello.secd: using SECD for "scripting" 3 years ago
vm Moved the welcome from `secd.c` to `repl.scm` 3 years ago
.gitignore added docs/ 3 years ago
ISSUES.md ISSUES updated 5 years ago
Makefile secdscheme: make install/uninstall 3 years ago
README.md Added gitter to README 3 years ago
repl.scm Moved the welcome from `secd.c` to `repl.scm` 3 years ago
scm2secd.scm (defined? sym) 5 years ago
scm2secd.secd (defined? sym) 5 years ago
secdscheme secdscheme: make install/uninstall 3 years ago

README.md

SECDScheme

This is a loose implementation of SECD machine and a simple self-hosted Scheme-to-SECD compiler/interpreter.

Running Scheme:

$ ./secdscheme
;>> (+ 2 2)
   4

;>> (define n 10)
   n

;>> (define (sqr x) (* x x))
   sqr

;>> (define apply-to-42 (lambda (g) (g 42)))
   apply-to-42

;>> (apply-to-42 sqr)
1764

;>> (define (fact n) (if (eq? n 0) 1 (* n (fact (- n 1)))))
   fact

;>> (fact 10)
3628800

;>> (load "std/lists.scm")
   ok

;>> (filter odd (range 12))
   (1 3 5 7 9 11)

;>> (begin (display 'bye) (quit))
bye
$

Running bare SECD opcodes:

$ echo "(STOP)" | ./secd
$ echo "(LDC 2  LDC 2  ADD  PRINT  STOP)" | ./secd
$ ./secd < tests/append.secd
(1 2 3 4 5 6)

The design is mostly inspired by detailed description in Functional programming: Application and Implementation by Peter Henderson and his LispKit, but is not limited by the specific details of traditional SECD implementations (like 64 Kb size of heap, etc) and R7RS.

Here is a series of my blog posts about SECD machine

Join a Gitter chat if you want to discuss the project or need help with it.