All Projects β†’ justinethier β†’ Cyclone

justinethier / Cyclone

Licence: mit
πŸŒ€ 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.

Programming Languages

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

Labels

Projects that are alternatives of or similar to Cyclone

C2compiler
the c2 programming language
Stars: ✭ 576 (-9.15%)
Mutual labels:  compiler
Felix
The Felix Programming Language
Stars: ✭ 609 (-3.94%)
Mutual labels:  compiler
Sultan
Sultan: Command and Rule over your Shell
Stars: ✭ 625 (-1.42%)
Mutual labels:  compiler
Lacc
A simple, self-hosting C compiler
Stars: ✭ 580 (-8.52%)
Mutual labels:  compiler
Jurassic
A .NET library to parse and execute JavaScript code.
Stars: ✭ 590 (-6.94%)
Mutual labels:  compiler
Rezoom.sql
Statically typechecks a common SQL dialect and translates it to various RDBMS backends
Stars: ✭ 621 (-2.05%)
Mutual labels:  compiler
Webassemblyjs
Toolchain for WebAssembly
Stars: ✭ 566 (-10.73%)
Mutual labels:  compiler
Lebab
Turn your ES5 code into readable ES6. Lebab does the opposite of what Babel does.
Stars: ✭ 5,479 (+764.2%)
Mutual labels:  compiler
Rescript Compiler
The compiler for ReScript.
Stars: ✭ 5,640 (+789.59%)
Mutual labels:  compiler
Lyo
πŸ“¦ Node.js to browser - The easy way
Stars: ✭ 624 (-1.58%)
Mutual labels:  compiler
Ccl
Clozure Common Lisp
Stars: ✭ 584 (-7.89%)
Mutual labels:  compiler
Mypyc
Compile type annotated Python to fast C extensions
Stars: ✭ 575 (-9.31%)
Mutual labels:  compiler
Rhine Ml
🏞 an OCaml compiler for an untyped lisp
Stars: ✭ 621 (-2.05%)
Mutual labels:  compiler
Pl Compiler Resource
η¨‹εΊθ―­θ¨€δΈŽηΌ–θ―‘ζŠ€ζœ―η›Έε…³θ΅„ζ–™οΌˆζŒη»­ζ›΄ζ–°δΈ­οΌ‰
Stars: ✭ 578 (-8.83%)
Mutual labels:  compiler
Minic Hosting
A simple stack-based virtual machine that runs C in the browser.
Stars: ✭ 628 (-0.95%)
Mutual labels:  compiler
Dcc
DCC (Dex-to-C Compiler) is method-based aot compiler that can translate DEX code to C code.
Stars: ✭ 568 (-10.41%)
Mutual labels:  compiler
Oakc
A portable programming language with a compact intermediate representation
Stars: ✭ 617 (-2.68%)
Mutual labels:  compiler
Fastexpressioncompiler
Fast ExpressionTree compiler to delegate
Stars: ✭ 631 (-0.47%)
Mutual labels:  compiler
Janino
Janino is a super-small, super-fast Javaβ„’ compiler.
Stars: ✭ 627 (-1.1%)
Mutual labels:  compiler
Clio
Clio is a functional, parallel, distributed programming language.
Stars: ✭ 555 (-12.46%)
Mutual labels:  compiler

Cyclone Scheme

Travis CI

Github CI - Linux

Github CI - MacOS

Github CI - MacOS Homebrew

Github CI - Windows

Cyclone Scheme is a brand-new compiler that allows real-world application development using the R7RS Scheme Language standard. We provide modern features and a stable system capable of generating fast native binaries.

Cheney on the MTA is used by Cyclone's runtime to implement full tail recursion, continuations, and generational garbage collection. In addition, the Cheney on the MTA concept has been extended to allow 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".

Features

  • Support for the majority of the Scheme language as specified by the latest R7RS standard.
  • New features from R7RS including libraries, exceptions, and record types.
  • Built-in support for Unicode strings and characters.
  • Hygienic macros based on syntax-rules
  • Low-level explicit renaming macros
  • Guaranteed tail call optimizations
  • Native multithreading support
  • A foreign function interface that allows easy integration with C
  • A concurrent, generational garbage collector based on Cheney on the MTA
  • Includes an optimizing Scheme-to-C compiler,
  • ... as well as an interpreter for debugging
  • A Package Manager and a growing list of packages.
  • Support for many popular SRFI's
  • Online user manual and API documentation
  • Support for Linux, Windows, FreeBSD, and Mac platforms.
  • Known to run on x86-64, x86, and Arm (Raspberry Pi) architectures.

Installation

There are several options available for installing Cyclone:

Docker

Docker

Cyclone can be run from a Docker Image:

docker run -it cyclonescm/cyclone bash

Homebrew

Homebrew

Mac (and Linux!) users wanting to use Homebrew can do the following.

Note if Homebrew is not already installed: follow the instructions at https://brew.sh/ to install the homebrew package manager.

brew tap cyclone-scheme/cyclone
brew install cyclone-scheme/cyclone/cyclone-bootstrap

Arch Linux

Arch Linux

Arch Linux users can install using the AUR:

git clone https://aur.archlinux.org/cyclone-scheme.git
cd cyclone-scheme
makepkg -si

Build from Source

Build from Source

To install Cyclone on your machine for the first time on Linux, Windows, FreeBSD, and for Mac users wanting to install without using Homebrew, use cyclone-bootstrap to build a set of binaries. Instructions are provided for Linux, Mac, Windows (via MSYS), and FreeBSD 12.

Getting Started

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. Note you can use rlwrap to make the interpreter more friendly, EG: rlwrap icyc:

$ icyc

              :@
            @@@
          @@@@:
        `@@@@@+
       [email protected]@@[email protected]@@      
       @@     @@     Cyclone Scheme->C compiler
      ,@             http://justinethier.github.io/cyclone/
      '@
      [email protected]
       @@     #@     (c) 2014-2019 Justin Ethier
       `@@@#@@@.     Version 0.11
        #@@@@@
        [email protected]@@+
        @@#
      `@.
   
cyclone> (write 'hello-world)
hello-world

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

Package Manager

Cyclone Winds

The winds package manager provides the ability to install packaged libraries and programs for Cyclone. See the winds site for more information.

The Winds wiki contains a full list of packages with documentation.

Documentation

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.

Compiler Internals

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

  • There is a Development Guide with instructions for common tasks when hacking on the compiler itself.

  • 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 garbage collector was subsequently enhanced to support Lazy Sweeping which improves performance for a wide range of applications.

License

Copyright (C) 2014 Justin Ethier.

Cyclone is available under the MIT license.

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