Caramel is starting to take shape, and we'll now refer to it as a language rather than an OCaml backend to make it a little easier to talk about it.
After all, it isn't really 100% OCaml but a strict subset of it. It doesn't ship the same standard library or tools.
We also have a new website at: caramel.run
We've updated our Code of Conduct to the Contributor Covenant v2.0.
We've opened the Github Discussions -- drop by and say hi or grab a Discord invite link! 👋
I've started work on the Caramel Manual where we have an installation guide, an introduction, a small syntax cheatsheet, some examples, and a small guide on writing Caramel code that talks to existing Erlang code.
This is a big work in progress, so if you'd like to help, please reach out!
In the future I'm planning to write guides for how to use Caramel with existing build systems like Rebar3 or Mix, and include a reference guide to the standard library.
Caramel now ships a formatter that you can run to make sure your code is always stylish and you have no more bikesheds. It supports ZERO configuration, so what you see is what you get.
This is currently just a wrapper around
ocamlformat, and all the kudos go to
the amazing team putting that together.
You can use it by calling
caramel fmt *.ml and it should work on both
It only does in-place formatting.
The compiler has dropped support for several targets, including Core Erlang to Native, and the default OCaml compilation modes.
It will from now on focus only on taking Caramel sources into runnable Erlang and Core Erlang code. Over time we will move from Erlang to only Core Erlang support, to make it easier to reuse Caramel code from Erlang, Elixir, Gleam, and Hamler.
The additions to the compiler are:
- Replaced unbound vars in specs with wildcards (thanks @ilya-klyuchnikov, PR)
- Keyword atoms are automatically quoted now
- Removed unnecessary compilation steps (thanks @Drup)
- Removed unused object file generation (
- Better support for operators like
The standard library has been simplified for contributing to it, and you can now find it at the top of the repository.
- String concatenation now possible with the
"yay" ^ "!!!"
Binary.split/3to split binary strings
Erlang.floor/1to round down floats to integers
Erlang.list_to_float/1to parse strings to floats
Erlang.float_to_list/1to turn floats into strings
Erlang.list_to_integer/1to parse strings to integers
Erlang.integer_to_list/1to turn integers into strings
Lists.foldl/foldrsignature has been fixed