🌀 A brand-new compiler that allows practical application development using R7RS Scheme. We provide modern features and a stable system capable of generating fast native binaries.
Find a file
2016-06-09 23:47:56 -04:00
debug Initial file 2016-06-06 23:00:09 -04:00
docs Updated benchmarks 2016-06-09 23:47:56 -04:00
examples Allow including C headers in a program 2016-04-27 00:18:09 -04:00
include/cyclone Added Cyc-opaque? 2016-04-26 21:52:30 -04:00
scheme Cleanup 2016-06-09 03:13:56 -04:00
srfi Include complex lib 2016-04-29 04:17:12 -04:00
test-lib New test file 2015-08-14 01:48:14 -04:00
tests Relocated 2016-05-03 04:14:54 -04:00
.gitignore Initial file 2015-02-21 22:25:06 -05:00
AUTHORS Changed format 2016-05-03 00:36:23 -04:00
cyclone.scm Removed dead code, consolidated comments 2016-05-19 23:33:39 -04:00
gc.c Ran 'make indent' 2016-04-27 03:49:41 -04:00
generate-c.scm Added header comment block. 2016-02-14 22:35:04 -05:00
icyc.scm Use SRFI 69 2016-05-03 00:00:46 -04:00
LICENSE Updated year 2015-07-22 21:30:15 -04:00
Makefile Added new module 2016-06-04 00:16:43 -04:00
Makefile.config Use separate configs for X86 / ARM (pi 2) 2015-12-29 23:14:09 -05:00
Makefile.config.raspberry-pi-2 Use separate configs for X86 / ARM (pi 2) 2015-12-29 23:14:09 -05:00
README.md Relocated animation 2016-04-20 23:57:15 -04:00
runtime.c Fix crash when cdr is a value type 2016-05-03 00:10:59 -04:00
sync.sh Initial file 2016-01-30 22:35:20 -05:00
test-opt.scm WIP 2016-05-21 00:30:47 -04:00
test-opt2.scm Fixed example program 2016-05-24 23:34:59 -04:00
TODO WIP 2016-05-03 00:14:31 -04:00

cyclone-scheme

Cyclone is an experimental Scheme-to-C compiler that uses a variant of the Cheney on the MTA technique to implement full tail recursion, continuations, and generational garbage collection. Unlike previous Cheney on the MTA compilers, Cyclone also allows execution of multiple native threads. An on-the-fly garbage collector is used to manage the second-generation heap and perform major collections without "stopping the world".

Getting Started

  1. To install Cyclone on your machine for the first time use cyclone-bootstrap to build a set of binaries.

  2. After installing you can run the cyclone command to compile a single Scheme file:

     $ cyclone examples/fac.scm
     $ examples/fac
     3628800
    

    And the icyc command to start an interactive interpreter:

     $ icyc
    
                   :@
                 @@@
               @@@@:
             `@@@@@+
            .@@@+@@@      Cyclone
            @@     @@     An experimental Scheme compiler
           ,@             https://github.com/justinethier/cyclone
           '@
           .@
            @@     #@     (c) 2014 Justin Ethier
            `@@@#@@@.     Version 0.0.1 (Pre-release)
             #@@@@@
             +@@@+
             @@#
           `@.
    
     cyclone> (write 'hello-world)
     hello-world
    

    You can use rlwrap to make the interpreter more friendly, EG: rlwrap icyc.

  3. Read the documentation below for more information on how to use Cyclone.

Documentation

  • The User Manual covers in detail how to use Cyclone, and provides information and API documentation on the Scheme language features implemented by Cyclone.

  • Cyclone's Garbage Collector is documented at a high-level. This document includes details on extending Cheney on the MTA to support multiple stacks and fusing that approach with a tri-color marking collector.

  • The Benchmarks page compares the performance of Cyclone with other R7RS Schemes using a common set of benchmarks.

  • Writing the Cyclone Scheme Compiler provides high-level details on how the compiler was written and how it works.

  • Finally, if you need another resource to start learning the Scheme language you may want to try a classic textbook such as Structure and Interpretation of Computer Programs.

Example Programs

Cyclone provides several example programs, including:

  • Tail Call Optimization - A simple example of Scheme tail call optimization; this program runs forever, calling into two mutually recursive functions.

  • Threading - Various examples of multi-threaded programs.

  • Game of Life - The Conway's game of life example program and libraries from R7RS.

  • Game of Life PNG Image Generator - A modified version of game of life that uses libpng to create an image of each iteration instead of writing it to console. This example also demonstrates basic usage of the C Foreign Function Interface (FFI).

  • Finally, the largest program is the compiler itself. Most of the code is contained in a series of libraries which are used by cyclone.scm and icyc.scm to create executables for Cyclone's compiler and interpreter.

License

Copyright (C) 2014 Justin Ethier.

Cyclone is available under the MIT license.