News for hackers. Stuff that matters.
Re:My Favourite Gleam Feature by kamikaz1k on Wednesday June 12, 2024 @12:26AM (#40654522)
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.

Re:My Favourite Gleam Feature by ilrwbwrkhv on Wednesday June 12, 2024 @12:54AM (#40654663)
But elixir doesn't have types.
Re:My Favourite Gleam Feature by brabel on Wednesday June 12, 2024 @02:59AM (#40655379)
Everyone knows very well the parent comment means "static types", come' on.
Re:My Favourite Gleam Feature by boxed on Thursday June 13, 2024 @04:16AM (#40667200)
No we don't. Many people are super confused about this.
Re:My Favourite Gleam Feature by brabel on Thursday June 13, 2024 @04:19AM (#40667204)
No we're not (yes, it's a bad answer, but that's what you've just done).
Re:My Favourite Gleam Feature by boxed on Thursday June 13, 2024 @06:02AM (#40667762)
Hello Many People. I am boxed.
Re:My Favourite Gleam Feature by brightball on Wednesday June 12, 2024 @01:17AM (#40654797)
It 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.

Re:My Favourite Gleam Feature by conradfr on Wednesday June 12, 2024 @01:48AM (#40654952)
Is it really strong typing if you can't type functions parameters and returns?
Re:My Favourite Gleam Feature by ReleaseCandidat on Wednesday June 12, 2024 @02:04AM (#40655026)
"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).
Re:My Favourite Gleam Feature by brightball on Wednesday June 12, 2024 @07:08AM (#40656705)
The 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.

Re:My Favourite Gleam Feature by crowdhailer on Wednesday June 12, 2024 @02:41AM (#40655264)
... and misses all the occasions where static typing can be a benefit.
Re:My Favourite Gleam Feature by Sparkle-san on Wednesday June 12, 2024 @12:55AM (#40654675)
Re:My Favourite Gleam Feature by darby_nine on Wednesday June 12, 2024 @01:25AM (#40654828)
You seriously think the language doesn't differentiate between strings and integers let alone all the other types of values in elixir?
Re:My Favourite Gleam Feature by _virtu on Wednesday June 12, 2024 @02:04AM (#40655032)
It 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.
Re:My Favourite Gleam Feature by bcrosby95 on Wednesday June 12, 2024 @01:11AM (#40654762)
So you're saying it's even better?
Re:My Favourite Gleam Feature by cess11 on Wednesday June 12, 2024 @01:07AM (#40654737)
Sure 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?
Re:My Favourite Gleam Feature by ReleaseCandidat on Wednesday June 12, 2024 @01:43AM (#40654924)
Like in assembler. Or, if you prefer that, in untyped lambda calculus.
Re:My Favourite Gleam Feature by cess11 on Wednesday June 12, 2024 @05:21AM (#40656144)
Now this is outside my comfort zone but I'd expect that to include integers.
Re:My Favourite Gleam Feature by alt0_ on Wednesday June 12, 2024 @07:55AM (#40657040)
Forth as well
Re:My Favourite Gleam Feature by felixgallo on Wednesday June 12, 2024 @11:57AM (#40659556)
assembler has tons of types. Bits, bytes, registers.
Re:My Favourite Gleam Feature by fire_lake on Wednesday June 12, 2024 @04:49AM (#40655964)
Many 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.
Re:My Favourite Gleam Feature by gregors on Wednesday June 12, 2024 @08:38AM (#40657412)
First 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-relea...