DevotionGeo

DevotionGeo

What is your opinion about Caramel, the OCaml compiler with Erlang backend?

@rvirding
@OvermindDL1

Most Liked

ostera

ostera

Creator of Caramel

Thanks! :raised_hands: Happy to be here :smile:

OCaml and Reason aren’t at the scale of TypeScript or Elixir, but they have a loyal and caring community :slight_smile:

Oh boy it is! :grin:

I actually started making a type-checker for Erlang, as I wanted to really understand what were the hard parts about it. I chose to cram in a well-typed language into Erlang and try to get the same program out of Erlang afterwards, and thus Caramel as an OCaml to Erlang compiler was born.

The next milestone I’m working towards is actually recovering the type information from the generated Erlang programs to verify that the compilation is sound.

I think anyone dealing with complex state machines should seriously consider this. Having a type-level representation of your business domain logic can be incredibly useful to rule out illegal representations, making them entirely unrepresentable, and having a tool tell you pretty much instantly if you’re about to do something you shouldn’t do.

Rapid prototyping and fearless refactors on large codebases are two other things that I really enjoy in OCaml, and that you would be able to get through Caramel as well.

Well, yes it does! OCaml is a highly expressive language, and building type-safe DSLs in it for specific problems is fairly common amongst the more idiomatic users. Check cmdliner as an example, or fmt.

In addition, the OCaml module system is by far the most powerful (and still type-safe) one I’ve seen put to production, so it should help with code reuse, enforcing codebase conventions, and large-scale refactors as well.

Indeed, there’s a lot of tradeoffs being made here. For example, the OCaml object system (OOP support) will not be supported in the current compilation mode. Same goes for other features like first-class modules (treating an entire module of code as a value), or mutability.

I am however experimenting with ways in which some of the existing ecosystem codebase that is not trivially translatable can be made usable from within the BEAM by means of generating NIFs. We do have a lot of type-information to guide this process :slight_smile:

Hope this helps :raised_hands:

davearonson

davearonson

Sounds :sunglasses: sweet!

rvirding

rvirding

Creator of Erlang

I think the idea is very good. I don’t have any feeling for how popular OCaml is so I don’t know if it will bring more users into the Erlang Ecosystem.

And I must say that personally I think implementing languages is a lot of fun. :smile:

Popular General Dev topics Top

Rainer
Have you seen the new features that will be available in the upcoming C# 9 release? C# is taking a lot of input from functional l...
New
AstonJ
:smiling_imp: What is your preferred syntax style and why? Perhaps we can add examples and use the code below as a simple reference poi...
New
AstonJ
What do you think needs fixing in the digital / computer science sphere?
New
Exadra37
I am a Linux user since 2012, more or less, and I always use Ubuntu on my computers, and my last 2 laptops have been used Thinkpads, wher...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
jamiedumont
This is all going to be a bit hand-wavey and straight off the top of my head, so bear with me, but it’s a thought/debate that’s been ratt...
New
jaeyson
Hi all, does anybody tried Shankar Devy’s Phoenix Inside Out book series? Also, will there be a big difference (aside from context prior...
New
DevotionGeo
I am planning to refresh my Ruby knowledge in a month or two, after using other technologies more frequently for a few years. Luckily I w...
New

Other popular topics Top

PragmaticBookshelf
A PragProg Hero’s Journey with Brian P. Hogan @bphogan Have you ever worried that your only legacy will be in the form of legacy...
New
Exadra37
I am thinking in building or buy a desktop computer for programing, both professionally and on my free time, and my choice of OS is Linux...
New
AstonJ
I ended up cancelling my Moonlander order as I think it’s just going to be a bit too bulky for me. I think the Planck and the Preonic (o...
New
PragmaticBookshelf
Build highly interactive applications without ever leaving Elixir, the way the experts do. Let LiveView take care of performance, scalabi...
New
DevotionGeo
The V Programming Language Simple language for building maintainable programs V is already mentioned couple of times in the forum, but I...
New
PragmaticBookshelf
Build efficient applications that exploit the unique benefits of a pure functional language, learning from an engineer who uses Haskell t...
New
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
PragmaticBookshelf
Author Spotlight: Karl Stolley @karlstolley Logic! Rhetoric! Prag! Wow, what a combination. In this spotlight, we sit down with Karl ...
New
PragmaticBookshelf
Author Spotlight: Bruce Tate @redrapids Programming languages always emerge out of need, and if that’s not always true, they’re defin...
New