Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork42
Clojure for the Erlang VM (unofficial)
License
clojerl/clojerl
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Clojure implemented on the Erlang VM.
Buildingclojerl requiresErlang/OTP 21+ andrebar3.
git clone https://github.com/clojerl/clojerlcd clojerlmakeOn Windows:
git clone https://github.com/clojerl/clojerlcd clojerlrebar3 clojerl compileThere is more information regarding Clojerl inclojerl.io, where youcan find whatfeatures does Clojerl include andhow it differs fromClojure.
To try it out and get a sense of what you can do, you can visitTry Clojerl.
To quickly try outclojerl via docker you can make use of the dockerimage like so:
docker pull clojerl/clojerldocker run -it clojerl/clojerlThen you should be able to see the prompt:
Clojure0.6.0clje.user=>Runningmake repl (on Windows first runrebar3 clojerl compile andthenbin/clje.bat) will start the REPL and show its prompt:
Clojure 0.6.0clje.user=>From the REPL it's possible to start evaluating Clojure expressions:
clje.user=> (map inc (range 10))(1 2 3 4 5 6 7 8 9 10)clje.user=> (doc map)-------------------------clojure.core/map([f] [f coll] [f c1 c2] [f c1 c2 c3] [f c1 c2 c3 & colls]) Returns a lazy sequence consisting of the result of applying f to the set of first items of each coll, followed by applying f to the set of second items in each coll, until any one of the colls is exhausted. Any remaining items in other colls are ignored. Function f should accept number-of-colls arguments. Returns a transducer when no collection is provided.nilclje.user=> (doc inc)-------------------------clojure.core/inc([x]) Returns a number one greater than num.nilclje.user=>There are some very basic examples in thescripts/examplesdirectory. These are meant to be references on how special forms inClojure on the BEAM are used and how they sometimes differ from ClojureJVM.
For a very basic example of a web project please check theexample-web-app repository.
The build tool for Clojerl is therebar3_clojerlplugin.rebar3 is the official build tool in the Erlangcommunity.
The plugin provides helpful commands to:
- Build a basic directory scaffolding for a new project
- Compile
- Run tests
- Start a REPL
For more information on how to use this plugin please check thedocumentation inrebar3_clojerl.
Erlang is a great language for building safe, reliable and scalablesystems. It provides immutable, persistent data structuresout of the box and its concurrency semantics are unequalled by anyother language.
Clojure is a Lisp and as such comes with all the goodies Lispsprovide. Apart from these Clojure also introduces powerfulabstractions such as protocols, multimethods and seqs, to name a few.
Clojure was built to simplify the development of concurrent programsand some of its concurrency abstractions could be adapted to Erlang.It is fair to say that combining the power of the Erlang VM with theexpressiveness of Clojure could provide an interesting, useful resultto make the lives of many programmers simpler and make the world ahappier place.
- Interoperability as smooth as possible, just like Clojure proper andClojureScript do.
- Provide most Clojure abstractions.
- Provide all Erlang abstractions and toolset.
- Include a default OTP library in Clojerl.
Learn more about Erlang (and its VM), Clojure and languageimplementation.
This project is an experiment that I hope others will find useful.Regardless of whether it becomes a fully functional implementation ofClojure or not, I will have learned a lot along the way.
Clojerl is an experimental implementation of Clojure on the Erlang VM.Its goal is to leverage the features and abstractions of Clojure thatwe love (macros, collections, seq, protocols, multimethods, metadata,etc.), with the robustness the Erlang VM provides for building(distributed) systems.
Yes. LFE and Joxa were each created with very specific and differentgoals in mind. LFE was born to provide a LISP syntax for Erlang. Joxawas mainly created as a platform for creating DSLs that could takeadvantage of the Erlang VM. Its syntax was inspired by Clojure but thecreators weren't interested in implementing all of Clojure's features.
Yes, they are. On one hand Clojure provides tools to handle mutablestate in a sane way, while making a clear distinction between identityand state through reference types. On the other, concurrency in theErlang VM is implemented through processes and message passing. Theidea in Clojerl is to encourage the Erlang/OTP concurrency model, butsupport as many Clojure constructs as possible and as far as they makesense in the Erlang VM.
But... but... Rich Hickey listshere some of the reasons why he chose not to use the actor model in Clojure.
That is not a question, but I see what you mean :). The points hemakes are of course very good. For example, when no state is sharedbetween processes there is some communication overhead, but thisisolation is also an advantage under a lot of circumstances. He alsomentionshere thatbuilding for the distributed case (a.k.a processes and messagepassing) is more complex and not always necessary, so he decided tooptimise for the non-distributed case and add distribution to theparts of the system that need it. Rich Hickey calls Erlang "quiteimpressive", so my interpretation of these writings is that they aremore about exposing the rationale behind the decisions and thetrade-offs he made when designing Clojure (on the JVM), than aboutdisregarding the actor model.
No. Some of Clojure's features are implemented by relying on theunderlying mutability of the JVM and its object system. The Erlang VMprovides very few mutability constructs and no support for definingnew types. This makes it very hard or nearly impossible to port somefeatures into Clojerl's implementation.
Yes, but they will need to be ported, just like for ClojureScript. Infact, most of Clojure's core namespaces were ported from the original.clj files in the Clojure JVM repository.
Join the conversation in theClojerl mailinglist or in the#clojerl Slack channel!
You can also find news and updates through@clojerl.Or if you have any questions you can find me@jfacorro or lurkingonClojure'sandErlang'smailing lists.
Any feedback, comment and/or suggestion is welcome!
About
Clojure for the Erlang VM (unofficial)
Topics
Resources
License
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Sponsor this project
Uh oh!
There was an error while loading.Please reload this page.
Packages0
Uh oh!
There was an error while loading.Please reload this page.
Contributors8
Uh oh!
There was an error while loading.Please reload this page.