25 ms·
One 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?
by ulucs 6y ago
One 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.