Elixir is now a gradually typed language
twitter.com
twitter.com
Elixir has been one of the nicest things I've discovered since becoming a dev back in 2010. I hope this new feature can improve the experience for larger orgs while keeping it great for indie hackers and new learners!
nice! i'm jealous.
Incidentally, 'nitter.net' isn't the only deployment. See here for a long list of alternative instances: https://github.com/zedeus/nitter/wiki/Instances
Working with these constraints and still being able to deliver what they did is nothing short of incredible. They had the maturity and experience to ship something that wasn't Yet Another Copy Of Java's Type System, like Sorbet and Dart, for example.
[1] https://www.typescriptlang.org/docs/handbook/type-compatibil...
Yes, AFAIK, Hejlsberg did the original TS type system. He, from what I can tell, wanted to build a usable type system for JS than any theoretical soundness. He seems to have succeeded in that.
Types should pass a whole range of runtime errors to build time error, which is a huge plus for reliable software!
I used Elixir for a period and loved the language but I got fed up with using Dialyzer so I switched to other typed languages.
When this is done, I'll be coming back as I think Elixir does pretty much everything else better when it comes to writing web apps vs other languages.
As the project became more complex though, and I learned more about elixir, dialyzer became progressively more useful.
Most of the time when I chase a weird type error in TypeScript it turned out that the types were not correct enough and had to be fixed.
When I’m chasing weird dialyzer complaints, most of the time I discover that it was actually a bug in my code. Honestly sometimes I’m astonished how it can reason about very complex things so well. It’s just the error messages are usually very confusing, but with experience that kinda solves itself.
The difference to me so far has been that dialyzer finds bugs in my code, rather than in my types, which is quite nice.
If they make the built-in type system of elixir faster and with better error messages, I’ll be a very happy camper.
It's much easier compared to typing Ruby or JavaScript in terms of difficulty.
This will make it my default choice the next time I need to build a web app or service.
[0] https://lfe.io/
A more pragmatic approach is to use Elixir for the Phoenix specific parts, and from there call the other Erlang based languages for your business logic.
All the Elixir macro magic, however, will not carry forwards, so you'll have to be using the compiled Phoenix bytecode
> Writing Phoenix controllers, templates, plugs, and live views from Erlang
Jose's elixirconf keynote this year did a great job providing details on how how this new type system works:
Is so, what's a ballpark of perf improvement?
However, keep in mind the Erlang VM already uses typing information (from patterns, guards, and built-in functions) to optimize code through its JIT compiler.
I feel like an anti-evangelist. I actually like reading complaints about the language...that just means there is less competition.
- K8s/microservices are better/standard.
- Elixir is too slow.
- Dynamically typed languages suck.
- There aren't enough libraries/ecosystem. And a lot of the libraries look like they are dead.
- No big companies use it for anything.
- It needs a better auth library, something like devise for ruby.
- It is a functional language, and everyone knows they are too hard to use.
- It is too difficult to hire good people.
But now, one of the standard complaints is gone. :(
This means invariably more people finding out that you can build incredible products with tiny teams. :(
Thank you Jose for your leadership and building an incredible community and ecosystem. Hopefully, as the language grows, this stays the same.
This announcement says it is detecting pattern matching and guards at build time instead of runtime, so nothing is changing.
And the "upcoming" (still in investigation) new types are totally optional. Only enabled if you use fat arrows.
You'll still have the advantages of having the core library and third party libs typed in your IDE, even if you don't use types.
I.e., if a desire for static types was keeping a large number of devs away, then this development will lead to far more devs using Elixir. This would erode some of throwaway_64000’s competitive edge as those devs also got the productivity gains of using Elixir.