Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/andyfinnell/egret
Egret is an Ocaml-like language targeting Erlang's BEAM.
https://github.com/andyfinnell/egret
Last synced: 29 days ago
JSON representation
Egret is an Ocaml-like language targeting Erlang's BEAM.
- Host: GitHub
- URL: https://github.com/andyfinnell/egret
- Owner: andyfinnell
- License: mit
- Created: 2016-01-17T02:18:09.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-01-31T16:16:36.000Z (almost 9 years ago)
- Last Synced: 2024-10-14T13:12:44.991Z (2 months ago)
- Language: Erlang
- Size: 11.7 KB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# egret
##Description
Egret is an Ocaml-like language targeting Erlang's BEAM. It is a learning tool, not production software.
##Dependencies
* rebar
* make
* erlando (automatically downloaded and built by rebar)##Build
To build the egret compiler just run make.
$ make
This will place the `egret` executable in the `bin` subdirectory.
##Use
The `egret` compiler can only take one parameter, the file to compile. For example:
$ ./bin/egret test/add.egret
This will generate a BEAM file in the same directory as the source file. In this case it will be `test/add.beam`. From here, the BEAM file can be used just like any other; all functions are exported by default.
$ cd test
$ erl
Eshell V7.2 (abort with ^G)
$ 1> l(add).
{module,add}
The above moves to the `test` directory, starts the Erlang shell, and loads the `add` BEAM file just built. To call a function:$ 2> add:add(3.0).
5.0
Also, all egret modules export a `main/0` function that executes all the top level expressions.$ 3> add:main().
5.0