Bitbucket is a code hosting site with unlimited public and private repositories. We're also free for small teams!

Close

(Note: repository is now available on both github at https://github.com/remleduff/CinC and bitbucket at https://bitbucket.org/remleduff/cinc)

Clojure in Clojure (pre-pre-pre-alpha)

For now the only dependencies are asm-4.0 and clojure-1.3

To get started:

Start your repl of choice (ie, lein repl)

=>(use 'clojure.java.compiler)

user=> (pprint (clojure.analyzer/analyze '(+ 1 2)))

{...ast is printed...}

user=> (pprint (process-frames (clojure.analyzer/analyze '(+ 1 2))))

{...ast is printed..., additional information is attached to nodes in the AST where classes are generated for use in emitting bytecode}

user=> (eval '(+ 1 2))

3

user=> (eval '(+ 1 2) :trace true)

... textual representation of the class is printed

user=> (eval '(+ 1 2) :trace true :check true)

... textual representation of the class is printed and additional verification is done by ASM

For some reason, "lein test" doesn't seem to work currently. Until I figure that out, do:

(require 'test.clojure.java.compiler) (in-ns 'test.clojure.java.compiler) (test-eval)

Recent activity

remleduff

Commits by remleduff were pushed to remleduff/cinc

45b79a2 - Move ast.clj back to compiler namespace as a "load", it was too inconvenient at the REPL when separated
remleduff

Commits by remleduff were pushed to remleduff/cinc

fae9de6 - Another too-big refactoring 1) Combine expression-type and compute-type to some extent, and precompute types to the extent possible 2) Remove :children nodes from the AST, ...
remleduff

Commits by remleduff were pushed to remleduff/cinc

641574f - Make great strides towards supporting primitives One could wish I'd committed this in smaller chunks... 1) Make emit a multimethod, ops can now implement either ...
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.