3 ms·
As someone who's enough of an early adopter to have been running Rust in production since ~2016, and who takes a good look at Elixir every few years, there are
by ekidd 3y ago
As someone who's enough of an early adopter to have been running Rust in production since ~2016, and who takes a good look at Elixir every few years, there are two major things holding me back:
1. Lack of strong typing. Dynamic typing is great on 10,000 line projects with two developers. Once you reach 50,000 lines and have a little developer turnover, it stops being fun. And dynamic typing also usually means far less IDE support. I'm spoiled; I want auto-complete.
2. Elixir is amazing for UIs like Discord, where your users interact in real time. If each of your users lives in their own little world, Elixir's greatest strengths have less chance to shine.
Right now, TypeScript is a no-brainer, because React is the dominant choice for UIs, and using the same language on both client and server is a win. And frankly, TypeScript's lovely, even if the ecosystem is a constantly-churning trash fire. So for a variety of commercial projects, TypeScript is a responsible choice. Typed Python, C#, Java, Kotlin, Swift or Rust all have compelling use cases, too.
But given stronger typing and an project that needed Elixir's strong support for distributed systems, I'd definitely consider Elixir.
- _trapexit 3y agoStrong typing would not be an unwelcome addition to the Erlang space but compared to most dynamically typed languages I find Erlang/Elixer to be infinitely more usable. If you aren't using guards and specific type pattern matching you arguably are doing it wrong. And those things give you much of the type info you need while developing. No compile time help but it's a lot better than most other dynamic languages. I've built very large projects in Erlang and didn't find typing a real issue.
- ekidd 3y ago> I've built very large projects in Erlang and didn't find typing a real issue. So I want to put on my consultant/lead engineer hat for this discussion. :-) I've worked for years in Ruby, Lisp, Scheme and other untyped languages, and shipped some fairly large projects. Any project where you can rightfully say "I've built it" is small enough that dynamic typing can be a pretty pleasant strategy. (I'd miss good auto-completion, though.) But when I walk onto a project with 5-20 engineers and 5 years of code, dynamic typing typically makes everything slow and painful. "We need to update two major Rails versions and deal with 40 supporting libraries. What's the plan for making sure everything still works? We have OK test coverage, but can we pull half the team for 2 weeks to work through the breakage?" Or perhaps you reach a scale where you need to onboard a bunch of junior developers or data scientists. Here, static typing helps people get up to speed, it encourages them to refactor aggressively, and it limits breakage caused by miscommunication. 50,000 to 250,000 lines of statically-typed code maintained by a 5 person team with normal turnover can make for a very pleasant project. But in that size range, I really don't enjoy dynamic typing. It's doable, but I can really feel the difference. I am extremely optimistic that Elixir could support excellent static types. And if it does, I'd definitely consider it for a wider range of projects.
- plumeria 3y agoGleam [0] is typed and runs on BEAM. [0] https://gleam.run/ https://gleam.run/
- jswny 3y agoStatic typing is in active development: https://elixir-lang.org/blog/2023/06/22/type-system-updates-research-dev/ https://elixir-lang.org/blog/2023/06/22/type-system-updates-...
- irq-1 3y agoFor anyone who hasn't seen it: https://gleam.run/ https://gleam.run/ > The power of a type system, the expressiveness of functional programming, and the reliability of the highly concurrent, fault tolerant Erlang runtime, with a familiar and modern syntax. Haven't used it, but I'd like to hear about others experience.
- alberth 3y agoOfficial Elixir blog post on this exact topic from just 2-days ago. https://elixir-lang.org/blog/2023/09/20/strong-arrows-gradual-typing/ https://elixir-lang.org/blog/2023/09/20/strong-arrows-gradua...
- ralphc 3y agoI'm still new to Elixir, and see Erlang from over here in Elixir land. Recently on Twitter there were debates on static vs. dynamic typing, and the static typists said that it made software more reliable. Which made me think about all the literature I see about dynamically-typed Erlang has been making the most reliable software around for 30 years. I don't know how large Ericsson's telephone switching software is but I think it's more that 50,000 lines.