Lisp compiling to JavaScript ES Modules. (Similar to ClojureScript, but in very different syntax.)
Browse examples or also try WASM version online.
Build and install with Rust:
```bash
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
git clone git@github.com:calcit-lang/calcit_runner.rs.git calcit/ cd calcit/ cargo install --path=./ ```
For Ubuntu 20.04, try binaries from http://bin.calcit-lang.org/linux/ , which are provided for CI usages.
Run:
```bash cr compact.cirru --1 # run only once
cr compact.cirru # watch mode enabled by default
cr compact.cirru --init-fn='app.main/main!' # specifying init-fn ```
Inline evaling:
```bash cr -e 'range 100'
cr -e '
println "|a demo"
-> range 100 map $ fn (x) * x x
' ```
Emitting code:
``bash
cr compact.cirru --emit-js # compile to js
cr compact.cirru --emit-js --emit-path=out/ # compile to js and save in
out/`
cr compact.cirru --emit-ir # compiles intermediate representation into program-ir.cirru ```
Install Calcit Editor and run ct
to launch editor server,
which writes compact.cirru
and .compact-inc.cirru
on saving. Try launching example by clong Calcit Workflow.
Read more in Minimal Calcit to learn how to code Calcit with a plain text editor.
Read more in Respo Calcit Workflow to learn to create an MVC webpage with Respo.
No package manager yet, need to manage modules with git tags.
Configurations inside calcit.cirru
and compact.cirru
:
cirru
:configs $ {}
:modules $ [] |memof/compact.cirru |lilac/
Paths defined in :modules
field are just loaded as files from ~/.config/calcit/modules/
,
i.e. ~/.config/calcit/modules/memof/compact.cirru
.
Modules that ends with /
s are automatically suffixed compact.cirru
since it's the default filename.
To load modules in CI environments, make use of git clone
.
Web Frameworks:
Mini libraries:
Rust supports extending with dynamic libraries, found an example in dylib-workflow. Currently there are some early extensions:
I use these commands to run local examples:
```bash
cargo run --bin cr -- calcit/test.cirru -1
cargo run --bin cr -- calcit/test.cirru --emit-js -1 && yarn try-js
cargo run --bin cr -- -e 'range 100' ```
compact.cirru
file parsing.Other tools:
.calcit-error.cirru
program-ir.cirru
MIT