All Projects → EarlGray → SECD

EarlGray / SECD

Licence: other
Scheme on SECD

Programming Languages

c
50402 projects - #5 most used programming language
scheme
763 projects

Labels

Projects that are alternatives of or similar to SECD

lispkit
FUNCTIONAL PROGRAMMING: Application and Implementation, Peter Henderson, ISBN 0-13-331579-7
Stars: ✭ 33 (-13.16%)
Mutual labels:  secd
Krivine-Machine
Abstract krivine machine implementing call-by-name semantics. In OCaml.
Stars: ✭ 34 (-10.53%)
Mutual labels:  secd

SECDScheme

Join the chat at https://gitter.im/EarlGray/SECD

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.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].