Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rain-1/single_cream
single file scheme interpreter with tail call optimization
https://github.com/rain-1/single_cream
c scheme tco
Last synced: 3 months ago
JSON representation
single file scheme interpreter with tail call optimization
- Host: GitHub
- URL: https://github.com/rain-1/single_cream
- Owner: rain-1
- License: gpl-3.0
- Created: 2018-03-08T01:23:57.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-16T12:20:14.000Z (over 5 years ago)
- Last Synced: 2024-04-04T15:31:17.529Z (7 months ago)
- Topics: c, scheme, tco
- Language: Scheme
- Homepage:
- Size: 208 KB
- Stars: 82
- Watchers: 5
- Forks: 8
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-racket-and-scheme - single_cream
README
# single cream
[![Build Status](https://travis-ci.org/rain-1/single_cream.svg?branch=master)](https://travis-ci.org/rain-1/single_cream)
**single cream** is a single C file AST based interpreter for a subset of scheme. It includes a basic standard library in scheme and an unhygienic "defmacro".
The aims of this project are:
* Implement a mini scheme language useful for bootstrapping a self hosted scheme implementation.
* Have proper tail calls designed in from the beginning.
* Have a working GC, so we can process decent sized inputs.
* Basic macro system for syntactic extension.# Usage
Make sure you get the tests submodule:
```
git submodule init
git submodule update
```* `make` to build it.
* `make test` to run the test suite.
* `make analyze` to run analyzers (clang-analyze, [cppcheck](https://github.com/danmar/cppcheck), valgrind)
* `./util/run.sh ` to run a script file.
* `./util/repl.sh` to try out expressions in the REPL. Uses rlwrap.
* `./util/run-valgrind.sh ` to run a script file with the interpreter being analyzed by valgrind.For building and testing on nixos you can use the following shell:
```
nix-shell -p autoreconfHook -p clang -p clangAnalyzer -p valgrind -p tinycc -p rlwrap
````## Testing
It's very useful to have a comprehensive set of tests. Our tests are divided into suites, feel free to make new ones and import tests from other places.
* `t/trivial`: Extremely simple tests, checking that various objects can be READ and printed back.
* `t/simple`: Basic functionality tests for primitive functions. Also used to make sure simple recursive functions and such work before adding them to `init.scm`.
* `t/mal`: Taken some tests for the 'make a lisp' project.
* `t/rosetta`: Problems and solutions taken from the rosettacode code comparison site.
* `t/sicp`: Ideas taken from the SICP book. nqueens is a particularly powerful stressor.We have tested it with travis continuation integration, and on x64 linux and raspberry pi ARM linux. It has also booted up on gio's ASMC OS and executed the minikanren and jbob theorem prover examples.
## See also
* https://github.com/petermichaux/bootstrap-scheme
* https://github.com/rui314/minilisp
* https://github.com/edvb/tisp
* https://github.com/carld/micro-lisp
* https://github.com/kanaka/mal/tree/master/c
* https://github.com/rain-1/tinyscheme
* http://canonical.org/~kragen/sw/urscheme/
* http://piumarta.com/software/maru/
* https://github.com/darius/ichbins
* http://t3x.org/klisp/index.html