Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/joefarebrother/scheme
A scheme interpreter and compiler
https://github.com/joefarebrother/scheme
Last synced: 2 months ago
JSON representation
A scheme interpreter and compiler
- Host: GitHub
- URL: https://github.com/joefarebrother/scheme
- Owner: joefarebrother
- Created: 2013-12-21T14:30:27.000Z (about 11 years ago)
- Default Branch: master
- Last Pushed: 2014-12-10T18:34:52.000Z (about 10 years ago)
- Last Synced: 2024-04-24T16:14:44.149Z (9 months ago)
- Language: C
- Size: 320 KB
- Stars: 1
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- AwesomeInterpreter - scheme
README
scheme
======(what will be) A scheme compiler
The bootstrap directory contains the following:
bootstrap.c is a bootstrap interpreter for scheme, intended for bootstraping compile/compile.scm (currently non-existant because git doeesn't track empty directories).
prims.c contains the primitive procedures for the bootstrapper
lib.scm implements a standard library for the bootstrapper to run.To test, type at a terminal:
```shell
$ make
$ ./bootstrap/bootstrap
> (load "bootstrap/lib.scm")
```prims.c currently defines:
- char->integer
- integer->char
- number->string
- string->number
- symbol->string
- string->symbol
- boolean?
- char?
- integer?
- pair?
- symbol?
- procedure?
- string?
- port?
- +
- -
- *
- quotient
- remainder
- =
- <
- >
- cons
- car
- cdr
- set-car!
- set-cdr!
- eq?
- string-append
- apply
- eval
- exit
- interaction-enviroment
- enviroment
- null-enviroment
- open-input-file
- read-char
- unread-char (non-standard) - (unread-char char port) pushes a character back to an input port
- eof-object?
- close-input-file
- read
- load
- open-output-file (takes a non-standard optional second argument a symbol indicating what to di if it already exists: overwrite or append. Default is overwrite.)
- close-output-file
- write-char
- write
- display
- error
- string-append
- system (non-standard) - excecutes shell code
- gensymbootstrap.c currently recognises the following special forms:
- if
- set!
- define
- quote
- lambda
- begin
- cond, including =>
- let
- and
- or
- declare (non-standard) - ignored by the interpreter, the compiler will use them to aid compilationbootstrap/lib.scm defines:
- number?
- list
- not
- append (varadic version)
- length
- reverse
- vector? (always false)
- range
- map
- filter
- foldl
- foldr
- accumulate
- all c...r functions
- memq
- memvThe following (non-standard) variable is availiable on startup:
- args - command line arguments
Currently tested on Ubuntu only.
SHOULD work on all OSs currently (though untested) but I only plan to support unix.