Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/brandonbloom/eclj
Extensible Clojure
https://github.com/brandonbloom/eclj
Last synced: 2 months ago
JSON representation
Extensible Clojure
- Host: GitHub
- URL: https://github.com/brandonbloom/eclj
- Owner: brandonbloom
- License: epl-1.0
- Created: 2014-03-09T21:52:21.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2016-01-18T02:42:51.000Z (almost 9 years ago)
- Last Synced: 2024-11-01T17:42:29.881Z (2 months ago)
- Language: Clojure
- Size: 219 KB
- Stars: 106
- Watchers: 14
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Extensible Clojure
An extensible, symbolic, functionally-pure Clojure interpreter.
Extensible Clojure aims to completely virtualize the Clojure language, such
that portable Clojure code can be run within a precisely controlled
environment. Proper tail calls are supported via delimited continuations,
which enables all effects to be modeled as pure data. Effects, including
bidirectional interop, are processed at the top-level of the interpreter loop,
so they too are fully programmable.This project's ambitious goals are based on a vast academic foundation. Oleg
Kiselyov's [Extensible Effects & Interpreters][1] page provides an excellent
entry point. I'm also interested in building an evaluator that includes an
extensible abstract interpreter and extensible JIT compiler. See [Lancet][2].## Status
Experimental and unstable!
Development temporarily halted because I couldn't wrap my head around how to
write a compiler for this thing. In the interim, I've developed
[Meta-Clojure][3], which may get me over the hump.### Platform
Runs on the JVM with Clojure 1.6.0.
Standalone deployment and cross-compilation to alternative platforms are goals.
### Evaluator
The base interpreter is written in a trampolined continuation-passing style. It
is complete enough to be self-applicable. There is also a meta-circular
interpreter written in a direct style, utilizing constant space tail calls and
the effect system. This meta-interpreter is *highly* experimental and will form
the foundation of the forthcoming JIT compiler.### Libraries
The core libraries are currently a hybrid of compiled functions borrowed from
`clojure.core` and symbolic EClj ports. Borrowed functions are actively being
ported and abstracted to facilitate partial evaluation, utilize the effect
system, and ease future targeting of non-JVM platforms.### Types
Clojure's primary data structures (those defined in Java) are the primary data
structures used throughout EClj as well. Ultimately, EClj will provide
additional implementations of these data structures wherever possible, but
will maintain interop via the existing Java interfaces. The goal is for EClj
to use the most appropriate data structures for the host.Type defining forms (`reify`, `deftype`, and `defrecord`) delegate to the
Clojure compiler to create the JVM type, but methods are interpreted by EClj.
Effects cannot (yet) propagate across JVM method call boundaries.### Not In Scope
* monitor-enter
* monitor-exit## Usage
Only `eclj.core` provides a stable(-ish) public API at this time. It exports
the same functionality as `clojure.core` with some to-be-documented extensions.You can evaluate individual forms with `eclj.core/eval` and load `.eclj` files
with `eclj.core/require` or related namespace & code loading functions. EClj
can interop with normal Clojure code seamlessly, but `clojure.core/ns` can't
load EClj. Of course, `eclj.core/ns` can require either file type.Various caveats apply, but the list is too volatile to justify enumerating now.
## License
Portions of this project derived from Clojure:
Copyright © 2006-2014 Rich HickeyOriginal code and Clojure modifications:
Copyright © 2014 Brandon BloomBoth are distributed under the Eclipse Public License either version 1.0 or
(at your option) any later version.[1]: http://okmij.org/ftp/Haskell/extensible/
[2]: https://github.com/TiarkRompf/lancet
[3]: https://github.com/brandonbloom/metaclj