https://github.com/lpil/erlcaml
https://github.com/lpil/erlcaml
Last synced: 11 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/lpil/erlcaml
- Owner: lpil
- Created: 2018-01-27T17:19:46.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2018-01-30T00:53:37.000Z (over 8 years ago)
- Last Synced: 2025-04-10T10:47:39.211Z (about 1 year ago)
- Language: Erlang
- Size: 4.88 KB
- Stars: 8
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# OCaml Erlang
```sh
# Compile
jbuilder build
# Run
jbuild exec erlcaml
```
```sh
# Dump OCaml Lambda IR
ocamlc -c -dlambda thing.ml
```
```erlang
% Dump Core Erlang IR to file
compile:file("thing.erl", [to_core]).
% Compile core Erlang from file
compile:file("hand_written_core_mod.core", [from_core]).
```
```erlang
% Dump Erlang AST to file
compile:file("thing.erl", [dpp]).
% Compile Erlang AST from file
File = "hand_written_pp_mod.pp".
{ok, Mod, Forms} = file:consult(File).
code:load_binary(Mod, File, Forms).
```
## Notes
- [BEAM Book compiler chapter](https://github.com/happi/theBeamBook/blob/master/chapters/compiler.asciidoc)
- [Erlang compile API docs](http://erlang.org/doc/man/compile.html#file-2)
- [Bucklescript compiler arch docs](https://bucklescript.github.io/docs/en/compiler-architecture-principles.html)
- [On Bucklescript's bool](https://github.com/BuckleScript/bucklescript/issues/590)
- [Prior art](https://github.com/danabr/merkel)
- [OCaml test API that looks nice. What is this?](https://github.com/BuckleScript/bucklescript/blob/master/CONTRIBUTING.md#contributing-to-the-runtime)