11 ms·
Caramel: an Erlang back end for OCaml
- hobby-coder-guy 6y agoWhy?
- ulucs 6y agoOne thing I'd really love to have on BEAM was a strong type system. Does this help achieve that? Is there a way to interop with Erlang/Elixir libraries?
- ollysb 6y agoA new effort just popped up to have another crack at adding strong types https://elixirforum.com/t/typechecker-for-elixir/34474/7 https://elixirforum.com/t/typechecker-for-elixir/34474/7
- tym0 6y agoGleam looks really neat. https://gleam.run https://gleam.run
- Multicomp 6y agoThis is the one I'm watching. Besides the docs not being done towards the end of the getting started syntax guide, it seems to be among the most developed of the make Erlang static typed competitors.
- GordonS 6y agoI'm mainly a C# dev, but I'm also watching Gleam with a keen interest. I spent a little time with Elixir a couple of years back and really liked it, but I just couldn't get over the lack of static typing - I don't mind for small things, but I absolutely want static types for larger programs. Gleam looks a little like Elixir, but with static types, which sounds great to me.
- devmunchies 6y agoWhy not F#? I'm learning it now but I wish I knew C# already for easier interop.
- wut42 6y agoFacebook is going to release soonish a new language on the BEAM, that's fully static typed.
- tym0 6y agoThere is more information in this talk: https://youtu.be/RHnjPW4YOrs https://youtu.be/RHnjPW4YOrs
- slifin 6y agoUgh I hope this isn't going to be another php->hack project Static analysis is great and required for modern development in dynamic languages and CPU/memory intensive to do well These big companies should write their own LSP server since all editors support the LSP protocol and mandate their use in employee editors Waiting till compile time to find that typo is rubbish, at runtime and compile time there should be as little checks as possible to keep performance up and the application running but on every keystroke in the editor it should be check city and again in CI Instead Facebook keeps lagging up their dynamic languages by building incompatible languages with static analysis into the compile step fracturing communities for a worse solution
- conradfr 6y agoTo be fair Hack made PHP getting serious about PHP7 and nowadays you get really great strong and strict typing, with PHP8 going even further. With a good IDE it's more pleasant than writing Elixir with typespecs and guards in that regard.
- amw-zero 6y agoWhy do you want that? Interestingly, Joe Armstrong said that people always asked about a static type system, but he couldn’t figure out the value of them. They were able to build extremely reliable systems with Erlang’s existing type system. And he mentioned at least one project that was 2 million LOC, so these weren’t just toy projects. So what are you unable to accomplish in Erlang that makes you feel like it’s missing something?
- rkangel 6y ago"Is possible to do" isn't the same as "helps you to so". You can write extremely reliable code in C (e.g. medical devices and car ECUs) but you have to be vary careful with any concurrency and usually dynamic memory allocation is banned. An enormous amount of testing and other design rules are needed. Maybe Rust would help to automatically check some of those things that otherwise require a lot of work to achieve. You can write highly concurrent server applications in C. It's a lot of work and bug prone. If you write them in Elrnag or Elixir your life will be much easier. That's why we use them. Maybe a static type system would help enforce some invariants about your code. Maybe it saves you from witting some classes of test. Basically, maybe you get to the same endpoint but with less work.
- romanoderoma 6y ago> "Is possible to do" isn't the same as "helps you to so" The things that help you usually also limit you See: training wheels or armbands I've seen much code written in static typed languages (mostly JVM languages) that supposedly help the programmer to write better code or code with less errors just by playing tennis with the compiler Thruth is that most of the code I've seen written "with type aids" is terrible from any other point of view The types are correctly passed to each function, but what purpose those types serve it's a mistery When you only have numbers, binaries, lists and tuples,you are forced to think about data structures in a simpler and more elegant way IDE generated "type safe" code too often is simply "a class for everything" and bad abstractions Most of the time when I review code my remarks is: it should be a 10 lines function, why did you write 10 classes with 10 getters and setters each?
- b3orn 6y ago> One thing I'd really love to have on BEAM was a strong type system. Isn't BEAM already strongly typed? Did you mean a static type system?
- cosmos64 6y agoThere is also the (now unmaintained) FSharp converter to it: Fez. And Elchemy. Also unmaintained. Sadly.
- sugarpile 6y agoThere’s something from Facebook/WhatsApp coming out in November
- bhahn 6y agoCan you provide more details on this? Is there an announcement or blog post?
- sugarpile 6y agoHere you go: https://news.ycombinator.com/item?id=24443128 https://news.ycombinator.com/item?id=24443128 In the linked slides they say "We are working on a [static typing implementation (what exactly it will look like is still unclear afaik)] prototype, open-sourcing in November"
- MiroF 6y agoCertainly. This should mean statically typed code is being compiled to BEAM, no?
- karmakaze 6y agoIf you mean static types that's a property of a language more so than its runtime.
- varbhat 6y agoHonest Question : What is the real benefit of this over ocamlc ? Can we get erlang interop ?
- rkangel 6y agoGiven the readme shows the ocaml being executed from an erlang interpreter, pretty sure yes. You basically can't run anything on the BEAM without that interop anyway.
- dynamite-ready 6y agoWhat is it about Erlang's AST, that attracts so many language designers?
- miloandmilk 6y agoNot an expert - so just a guess, might be more to do with the advantages the BEAM provides?
- sigwinch28 6y agoI don't think it's the AST: I think it's the BEAM itself. The intermediate representations used in (and even accepted as input formats by) the compiler are relatively unstable, with the exception of the Erlang Abstract Format. This makes it a great target for other compilers because they don't have to track breaking changes to the intermediate formats, they don't have to worry about generating BEAM bytecode, and they get to take advantage of all optimisations already implemented in erlc (the Erlang compiler). As an example of recent amazing changes to the BEAM: JIT to x86_64 https://github.com/erlang/otp/pull/2745 https://github.com/erlang/otp/pull/2745
- laser 6y agoPerhaps it's a lot more than the AST that's attracting them? Like maybe the actor model (genservers)? Or OTP overall as a great platform for building self-healing, fast, distributed, functional systems? Or Immutability? There's lots of things to like about building on a foundation like Erlang.
- rkangel 6y agoThe BEAM provides an unmatched concurrency model and related infrastructure. Targeting a language at it gets you all the benefits of that language plus all of the fundamental work done to build distributed systems. Another way of looking at it: almost nothing that is important or wonderful about writing Erlang is the language itself. Most of what people rave about is the BEAM. This means you can fairly easily throw out the language and use a different one and get all the benefit. Now that I'm thinking about it - that last point is a spectacular achievement of design and abstraction.
- 6y ago
- Nelkins 6y agoLooks cool! There's also a similar project for F# (but hasn't been updated in a while): https://github.com/kjnilsson/fez https://github.com/kjnilsson/fez https://skillsmatter.com/skillscasts/11312-fez-fsharp-type-safety-for-the-beam https://skillsmatter.com/skillscasts/11312-fez-fsharp-type-s...
- deleted 6y ago[deleted]