All Projects → rain-1 → single_cream

rain-1 / single_cream

Licence: GPL-3.0 license
single file scheme interpreter with tail call optimization

Programming Languages

scheme
763 projects
c
50402 projects - #5 most used programming language
shell
77523 projects
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to single cream

unpythonic
Supercharge your Python with parts of Lisp and Haskell.
Stars: ✭ 53 (-32.05%)
Mutual labels:  tco

single cream

Build Status

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, valgrind)
  • ./util/run.sh <filename.scm> to run a script file.
  • ./util/repl.sh to try out expressions in the REPL. Uses rlwrap.
  • ./util/run-valgrind.sh <filename.scm> 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

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].