[go: up one dir, main page]

Skip to content

v0.0.12: First Milestone Completed!

Compare
Choose a tag to compare
@github-actions github-actions released this 30 Oct 19:37
0f80890

Release Notes

This is the first actual release of Caramel that I'm making available 🎉

It includes 2 things:

  • caramelc, the Caramel compiler
  • erlang, an OCaml library for handling Erlang code, including an AST, lexer, parser, and printer

The Caramel compiler

Caramel can compile a large portion of the OCaml language, in particular most of the immutable functional OCaml, and into idiomatic Erlang code. Whenever possible it will look quite decent, and some times it will have pretty terrible formatting.

It runs as a single stand-alone binary with no dependencies (other than glibc or musl), and it should be blazing fast. Here's some benchmark results from the examples/ocaml_to_erlang.t folder:

Screenshot from 2020-10-30 23-08-04

The compiler also includes an additional target that may be of interest to those who want to dig into the compilation process: caramelc parse. This command will read Erlang and OCaml sources, and dump different ASTs of them. It was very useful to have around for testing purposes as well.

erlang library for OCaml

The Erlang library currently includes support for the vast majority of the Standard Erlang language, according to the grammar shipped with Erlang/OTP as of version 24.

It includes a series of modules to make it easy to construct Erlang programs from OCaml, as well as deconstruct them and operate on them.

A pretty printer is also included that right now is used within the Caramel compiler to generate the Erlang sources. It unfortunately still has some tiny remnants of Caramel logic in it, but they should be cleaned up in the near future and should not get in the way of more general usage of this library.

Changelog

  • compiler: match expressions with cascading cases are not that
    straighforward to translate to Erlang and my gut tells me that doing the
    juggling here will get in the way of type-checking Erlang in the
    upcoming milestone, so this is forbidden as it is right now.