Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Clojure compiler in Clojure
Clojure
Pull request Compare This branch is 23 commits behind Bronsa:master.

Fetching latest commit…

Cannot retrieve the latest commit at this time

Failed to load latest commit information.
doc
src/cinc
test/cinc/test/analyzer
README.md
project.clj

README.md

CinC

CinC is an experimental Clojure analyzer and compiler implemented in pure Clojure.

Features

CinC currently contains both an analyzer composed of multiple passes and an emitter.

Docs on how the compile process works are in compiler

Analyzer

The jvm analyzer (cinc.analyzer.jvm/analyze) returns an AST similar to the one returned by the clojurescript analyzer or by jvm.tools.analyzer. On top of the simple AST, multiple passes are run in order to transform/annotate the ast with information needed for the jvm bytecode emission.

The basic AST nodes are documented in analyzer while the passes are documented in passes.

Note that some passes remove or add new nodes to the AST.

Emitter

The bytecode emitter (cinc.compiler.jvm.bytecode/eval) takes in an expression, gets the AST from its analysis and emits the corresponing bytecode.

How this process works is documented in emitter

What's not working

Currently primitive types should be considered not working, this means that for example defrecord doesn't currently compile since it implements primitive-returning methods.

Primitive support will come soon.

Something went wrong with that request. Please try again.