Giter Site home page Giter Site logo

scheme2cps2c4py's Introduction

python scheme compiler
jt olds

usage:
./compiler.py < input.scm > out.c
./compiler.py --output=c < input.scm > out.c

alternatively:
./compiler.py --output=cps < input.scm > output.scm

other flags include
  --curry            if you want the intermediate representation to curry all
                     function calls, why you would i don't know
  --recursion_limit  if you are having trouble with call depth size of the
                     python interpreter.
  --nogc             disables usage of the boehm garbage collector
                     (not recommended)

the story so far:
 this is a scheme-to-c compiler written in python. it does not support all of
r5rs by any means (there aren't many valid data types besides integers. lists
aren't supported, for example (bwa?!)), but it is a definitely solid starting
point.
 the biggest novelty of this compiler is that it compiles by first transforming
scheme to continuation-passing-style, which means that call/cc actually does
work.
 i wrote this for advanced compilers (cs6470) with matt might (matt.might.net)
at utah.edu. it was a tight schedule and i barely made it, so the documentation
is poor, and there are two intermediate representations (instead of fixing the
initial ir once i realized it was broken, i just wrote a quick translator for
the ir instead of rewriting the other code).
 at some point i definitely hope to clean this up.

scheme2cps2c4py's People

Contributors

jtolio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

vtheno calroc

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.