(no title)
mindfulmore | 4 years ago
Elixir checks pretty much every box I'd want in a language, but after dealing with nil in Ruby for years and having fun with TypeScript... I'm feeling more drawn to working with type systems.
mindfulmore | 4 years ago
Elixir checks pretty much every box I'd want in a language, but after dealing with nil in Ruby for years and having fun with TypeScript... I'm feeling more drawn to working with type systems.
dnautics|4 years ago
The one thing I wish is that people stopped writing boolean functions with is_ in front (that is supposed to be only for guards, but not everyone follows that convention).
cuddlecake|4 years ago
But, this might just be my wishful thinking.
QuinnWilton|4 years ago
I think that what you're looking for is already possible today, and that things only get easier over time.
mindfulmore|4 years ago
jolux|4 years ago
I suppose you could write Elixir in a style that was more type safe by writing in a less polymorphic or recursive style, but the language does not lend itself well to it. Structs and maps are mostly fine, discriminated unions less so.
lawik|4 years ago
Depending on what itches your types scratch for you it might be enough, might not. I've never wanted more type system in my Elixir personally.
linkdd|4 years ago
Either you have a strict type system that does not have an "any" type (yes, I'm looking at you Typescript), or you have a flexible type system like Python/Erlang/Elixir and you do runtime type checking whenever it's needed.
I'm writing more Typescript code than I would in Javascript for almost no type safety benefits (but for documentation, it's awesome).
[1] - https://github.com/keathley/norm
pdimitar|4 years ago
As another poster said, it can catch the very occasional potential bug but to me at least it's rarely worth the hassle.
I miss static typing after I got back to Elixir from Rust but the BEAM will likely never be statically typed.
To that end, I found utilizing metaprogramming to generate normal and property tests to be much more productive use of my time, with a measurable impact to boot.
vendiddy|4 years ago
I'd love to see experiments to replace typespecs with a more ergonomic type system.