6 ms·
These are all the same reasons to like Elixir. For anyone that hasn’t tried writing Elixir style code with the pipeline operator should definitely check it out
by kamikaz1k 2y ago
These are all the same reasons to like Elixir.
For anyone that hasn’t tried writing Elixir style code with the pipeline operator should definitely check it out. It’s fun to iterate in the repl too, since you can build it sequentially without adding braces for nesting calls.
- ilrwbwrkhv 2y agoBut elixir doesn't have types.
- Sparkle-san 2y agoIt will soon. https://github.com/elixir-lang/elixir/releases/tag/v1.17.0-rc.0 https://github.com/elixir-lang/elixir/releases/tag/v1.17.0-r...
- cess11 2y agoSure it does. How could it be dynamically typed if it didn't have types? How would you even program in a language that doesn't have any types?
- ReleaseCandidat 2y agoLike in assembler. Or, if you prefer that, in untyped lambda calculus.
- cess11 2y agoNow this is outside my comfort zone but I'd expect that to include integers.
- alt0_ 2y agoForth as well
- felixgallo 2y agoassembler has tons of types. Bits, bytes, registers.
- bcrosby95 2y agoSo you're saying it's even better?
- brightball 2y agoIt does. Always has. It just doesn’t have static types, it has strong types. That difference gives you the flexibility to avoid circumstances where static typing can be a hindrance.
- conradfr 2y agoIs it really strong typing if you can't type functions parameters and returns?
- ReleaseCandidat 2y ago"Strong typing" most of the time means "no implicit type conversion" like e.g. C or Javascript do. That is indepentend of having statíc or dynamic typing (and anything between).
- brightball 2y agoThe thing is, low level types can already be inferred by the operators anyway. That’s what dialyzer does and it catches most things. For the rest of it, you have a conversation where the benefits of full static typing don’t exist in a distributed environment. Example, you’re making function calls to other nodes in the cluster and the node is updated while your code is running potentially changing the function call. You won’t get the chance to do a contract exchange live with other nodes, recompile and examine results. Instead, you have to pattern match on the parts you care about just like with an API call to a server you don’t control. Even with Gleam, static typing only protects your node. In a distributed environment you can’t validate everything and on the BEAM everything is a distributed environment. Once you accept this, you realize that the benefit of static typing simply doesn’t exist here.
- crowdhailer 2y ago... and misses all the occasions where static typing can be a benefit.
- darby_nine 2y agoYou seriously think the language doesn't differentiate between strings and integers let alone all the other types of values in elixir?
- _virtu 2y agoIt doesn’t right now, but it will. Jose and company have been working on a gradual type system. Elixir 1.17 recently released the first typing features.
- brabel 2y agoEveryone knows very well the parent comment means "static types", come' on.
- fire_lake 2y agoMany argue that static types and Beam style of deployments are actually a bad fit. Static types assume atomic deployment of a statically checked codebase for their guarantees.
- gregors 2y agoFirst release of Elixir with gradual typing announced today. It's not complete but the work is underway. https://elixir-lang.org/blog/2024/06/12/elixir-v1-17-0-released/ https://elixir-lang.org/blog/2024/06/12/elixir-v1-17-0-relea...
- mahguy 2y ago[dead]