Caramel: an OCaml to Erlang compiler

Hej folks, hope you’re staying safe.

I wanted to share a project I’ve been working on for some time now: Caramel, an OCaml to Erlang compiler.

tldr: write OCaml and run it on the BEAM

Caramel has a highly expressive, sound type-system, and a blazing fast type-checker. This allows you to rule out entire classes of errors by using types that are closer to your domain, and fearlessly refactor large amounts of code without sacrificing development speed.

To achieve this, Caramel is actually a backend to the OCaml compiler, so it reuses its entire type-checking stack, with well over 25 years and millions of hours of academic research and industrial usage, and provides a new compilation target to Erlang.

So don’t let the candy fool you: this is not a toy.

The output of the compilation is idiomatic Erlang source code that can be compiled and ran with erlc just like any other, and I’m working on integrating it with tools like rebar3 and mix :relaxed:

Otherwise it is getting to a place where you can play around with it :slight_smile: so if you have any comments and feedback, it’s all very welcomed, feel free to AMA.

I’m also normally tweeting about it so that’s the best source of news at the moment.

Happy Halloween! :candy: :ghost:

The latest release is v0.0.12, and you can find the release notes here:

31 Likes

Looking forward to trying this out! CC’ing @OvermindDL1 who would be excited by this too.

7 Likes

Caramel looks neat @ostera!

Have just put up a portal for it on Devtalk :003:

2 Likes

New release out :slight_smile: – sort of skipped over v0.0.13 :ghost:

9 Likes

outstanding! what a neat project!

3 Likes

New release out! :rocket: v0.1

11 Likes