Skip to content

AbstractMachinesLab/rebar3_caramel

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

rebar3_caramel

A rebar compiler plugin to invoke the caramelc ocaml compiler in a rebar project.

Early days. Some things on the TODO list:

  • tests
  • bring the caramel erlang runtime into the project in some smart way

Build

$ rebar3 compile

Use

Add the plugin to your rebar config:

{plugins, [
    { rebar3_caramel, ".*", {git, "https://github.com/seanhinde/rebar3_caramel.git", {branch, "main"}}}
]}.

This plugin uses the custom compiler modules feature of rebar3, hence requires rebar3 version >= 3.7.0.

The plugin generates erlang files from ocaml sources in gen/src. For this reason you must add the following to your rebar.config:

{src_dirs, ["src", "gen/src"]}.
{profiles, [
    {test, [{src_dirs, ["src", "test", "gen/src", "gen/test"]}]}

]}.

If you want to use the erlang runtime for caramel in your project you will need to manually copy the pre-generated erlang files from your caramel distro into your erlang project (right now this is only process.erl). This is a short term solution.

Examples

There are example projects under examples/

caramel_readme implements the simple server from the caramel README page. This cheats a little by including a snapshot of process.erl from the caramel runtime.

caradeps is aimed at experimenting with compile dependencies.

About

🍬 Rebar3 Plugin for Caramel

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Languages