News for hackers. Stuff that matters.
Re:Caramel: An OCaml for the Erlang VM by bmitc on Friday March 05, 2021 @12:56PM (#26359762)
You might also be interested in Gleam.

https://gleam.run/

Is it possible to share any details about your project? I'm just curious since I also use F# and am learning Elixir.

Re:Caramel: An OCaml for the Erlang VM by devmunchies on Friday March 05, 2021 @02:00PM (#26360599)
Does gleam let me destructure a list so that I can bind the head and body each to a variable?

e.g. in f#

    let splitHeadAndTail = function
      | h :: [] -> printfn "got head and EMPTY tail"
      | h :: t -> printfn "got head and tail"
      | [] -> printfn "got empty list"
The example in their docs does a 1:1 map and doesn't show if you can bind the whole tail[1]

[1]: https://gleam.run/book/tour/case-expressions.html#destructur...

Re:Caramel: An OCaml for the Erlang VM by derefr on Friday March 05, 2021 @02:21PM (#26360906)
Yes; see https://hexdocs.pm/gleam_stdlib/gleam/list/. The syntax is [head, ..tail]

It'd be kind of silly to create a greenfield BEAM language that doesn't expose one of the most fundamental operations you can do in BEAM bytecode, and that every list-processing function ultimately relies upon :)

Re:Caramel: An OCaml for the Erlang VM by devmunchies on Friday March 05, 2021 @02:45PM (#26361176)
> It'd be kind of silly to have a BEAM language that doesn't expose one of the most primitive operations you can do in the BEAM, that every list-processing function ultimately relies upon :)

Agree, which is why i was confused it wasn't in the tour I linked to in the Lists or Destructuring sections

Re:Caramel: An OCaml for the Erlang VM by centimeter on Friday March 05, 2021 @05:29PM (#26363056)
Why not just use Haskell? You don't get OTP/Beam, but the GHC runtime provides almost all the same functionality (plus a lot more), to the point where the Cloud Haskell library is basically a full clone of Erlang's actor functionality.
Re:Caramel: An OCaml for the Erlang VM by nine_k on Saturday March 06, 2021 @04:52AM (#26366367)
Does it provide all of the OTP? Can you write in the "let it fail" style and be certain that the failing parts will be restarted, etc?

Also, BEAM is somehow more battle-tested.