This project is in alpha stage and should be considered highly experimental.
brew install geppetto-apps/bin/crow
npm install crow-cli -g
You can also use Docker:
$ cat foo.cr | docker run -i geppettoapps/crow > foo.js.flow
Motivation & Goal
This is both my first Crystal and first compiler project. I was inspired to learn more about compilers after reading Game Programming Patterns' chapter on bytecode and also Crystal and its relationship with LLVM. Since Crystal is a high-level, self-hosted programming language, it's very easy to work with Crystal's internals. In addition to attempting make Crystal target the web, I've learned a lot about Crystal from working on this project.
The goal of this project is to make it possible to write both frontend and backend
code for a web project in Crystal; preferably in a way that allows for communication
between native JS and native Crystal code. @asterite from the Crystal Team has
noted that crystal is not geared against the web
and there's still work left to make Crystal to work with asm.js.
Due to this
crow currently approach the problem by using transpilation, but that
may not be the case forever. The only public API for
crow is the CLI that takes
in some Crystal code and spits out something may run in the browser.
- 1.0: Run Crystal code in isolation in the browser
- 1.1: DOM manipulations from Crystal code
- 1.2: Bind Crystal code to DOM events
Supported AST nodes
Extracted from [Crystal's compiler][cr-parser].
- Fork it ( https://github.com/geppetto-apps/crow/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
Logo: Crow by Encrico Francese
- theodorton Theodor Tonum - creator, maintainer