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

herminiotorres
Tell us what kind of machine/hardware do you have? and what kind of reason for? describe your hardware… :computer: :nerd_face:
New
AstonJ
The reviews are coming in - if you spot any or have a review of your own, please add it :nerd_face: @ohm will be pleased, they seem to b...
New
AstonJ
Inspired by some of the comments in our https://forum.devtalk.com/t/your-vim-tips/4748 (in particular those by Mafinar and Hallski) …what...
New
DevotionGeo
The version of Java installed with Android Studio on my Mac is the following (when I run java -version) openjdk version "1.8.0_242-relea...
New
PragmaticBookshelf
Craft your dream role at work by guiding your manager to take your priorities into account when making decisions. Ken Kousen @kenko...
New
DevotionGeo
I installed Github Copilot (VS Code extension) and signed up for the technical preview three days ago. Yesterday I got the invitation, an...
New
hskohli
We are looking to hire a freelancer to design the complete pipeline for the following problem statement: Hardware to be used: Jetson Na...
New
AstonJ
This might be my next keyboard (the down arrow on my Apple Magic Keyboard has stopped working :icon_rolleyes:) https://cdn.shopify.com/s...
New
First poster: bot
API Gateway Trends behind Features: Apache APISIX 3.0 vs. Kong 3.0 - API7.ai. By comparing the open-source API Gateway Apache APISIX and...
New
CommunityNews
Will Swifties’ war on AI fakes spark a deepfake porn reckoning?
New

Other popular topics Top

AstonJ
SpaceVim seems to be gaining in features and popularity and I just wondered how it compares with SpaceMacs in 2020 - anyone have any thou...
New
Exadra37
On modern versions of macOS, you simply can’t power on your computer, launch a text editor or eBook reader, and write or read, without a ...
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
PragmaticBookshelf
“Finding the Boundaries” Hero’s Journey with Noel Rappin @noelrappin Even when you’re ultimately right about what the future ho...
New
gagan7995
API 4 Path: /user/following/ Method: GET Description: Returns the list of all names of people whom the user follows Response [ { ...
New
AstonJ
Biggest jackpot ever apparently! :upside_down_face: I don’t (usually) gamble/play the lottery, but working on a program to predict the...
New
mafinar
This is going to be a long an frequently posted thread. While talking to a friend of mine who has taken data structure and algorithm cou...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
PragmaticBookshelf
Author Spotlight Mike Riley @mriley This month, we turn the spotlight on Mike Riley, author of Portable Python Projects. Mike’s book ...
New
PragmaticBookshelf
Author Spotlight Erin Dees @undees Welcome to our new author spotlight! We had the pleasure of chatting with Erin Dees, co-author of ...
New