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:

Where Next?

Popular General Dev topics Top

AstonJ
I just watched this: (tldr: remove bad choices so you don’t need to use willpower) It got me thinking about ways to incre...
New
AstonJ
If you’re a fan, why? If you’re not fussed on it, how comes?
New
axelson
Can anyone recommend a tmux session switcher? I’ve used https://github.com/siadat/session-finder in the past but it’s not very actively m...
New
Exadra37
So, if we can reduce the likelihood, we can reduce the overall risk. That’s good. It’s actually very similar to a very common idea called...
New
AstonJ
Are you a touch typist? :keyboard: poll If you haven’t checked your typing speed yet, you can do so here here :smiley:
New
finner
One of my 2021 resolutions is to read more tech books. As part of this effort I purchased two MEAPs (Manning Early Access Program) which...
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
dwaynebradley
In their weekly newsletter, Jared Santo from the Changelog shared this blog post by Mark Ericksen over at fly.io: What is really inter...
New
AstonJ
Just listened to @rvirding’s interview here and he mentions #lua (and Luerl) - just wondered if anyone’s used Lua and what you think of it?
New
Exadra37
A modern streaming platform for mission critical workloads Redpanda is a KafkaÂŽ compatible event streaming platform. No ZookeeperÂŽ, no JV...
New

Other popular topics Top

Devtalk
Reading something? Working on something? Planning something? Changing jobs even!? If you’re up for sharing, please let us know what you’...
1023 17214 380
New
AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
AstonJ
We have a thread about the keyboards we have, but what about nice keyboards we come across that we want? If you have seen any that look n...
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
Margaret
Hello everyone! This thread is to tell you about what authors from The Pragmatic Bookshelf are writing on Medium.
1139 25652 757
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
First poster: joeb
The File System Access API with Origin Private File System. WebKit supports new API that makes it possible for web apps to create, open,...
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