Live data from Hacker News

Elixir v1.20: Now a gradually typed language

elixir-lang.org

141–150 of 426 posts

Re: Elixir v1.20: Now a gradually typed language

#141

Earlier quoted context omitted.

Elixir's gradual type system cannot change the asymptotic complexity of your programs. The design explicitly rules out mechanism that causes slowdowns in other gradual type systems (runtime casts at static/dynamic boundaries) Most gradual type systems insert coercions when values cross the types/untyped boundary (checking every element of a list, wrapping values in typed proxies, etc) but Elixir's team published a "s…

i think the design can push people into writing unnecessary matches/guards just to trigger the typechecker. that said, I'm a fan

I had to do this just the other day. I found it to be a minor papercut, but it was an easy fix.

Re: Elixir v1.20: Now a gradually typed language

#142
post #42

It's very nice updating Elixir, having no breaking changes across my many projects and it then the compiler just finds bugs for free. I'm so spoiled.

The stability of the language is such a blessing.

I think that's part of the reason that LLMs do so well with it, despite its relative lack of popularity.

Re: Elixir v1.20: Now a gradually typed language

#143
post #133

Earlier quoted context omitted.

I think Elixir is interesting and there is real value but some stuff being sold as "all these libs/packages that haven't had any updates for over a year is fine because Elixir" I just don't buy it and to that point around typing feels like the same wish-washy hand waving from the community that is very off putting BEAM has genuine use cases but its not as wide as its made to believe. There are very good places where…

You can buy it if you use discernment. Obviously you'll run into compatibility issues in certain situations - like you aren't going to be able to use a library coupled to Phoenix 1.3 functionality in a Phoenix 1.8 project, but I continue to be surprised at how I can add a package like https://hex.pm/packages/deep_merge , which is 6 years old and it works just fine.

Phoenix is the exception to the usual rule. It's the only Elixir package where I've encountered substantial friction during upgrades.

Unfortunate, since it's one of the flagship Elixir packages, but I think the upgrades are worth the trouble. Better to improve something than to leave it broken solely for the sake of legacy compatibility IMO.

Re: Elixir v1.20: Now a gradually typed language

#144

Im so happy seeing this. We are approaching „great language” level and for me this is the first one. I would be thankful for pointing at any other language that reliably and safely adds great features and is already convenient to use. I jumped from mastering Go to learning advanced C#, because Go stopped with adding great things :(

I don’t know if it satisfies “already convenient to use”, but IMO ocaml fits “adds great features reliably and safely”. They merged their multicore compiler ~4 years ago, which was a pretty huge change that added parallelism through domains. Notably, they had a working version ~10 years ago, but refused to merge it until they sorted out some performance issues that would have affected existing single-threaded code.

I only say it’s not “already convenient to use” because I heard tons of complaints about the dev environment - mostly that there’s no debugger, no official package manager, etc. But they are working on ‘dune’, and just like the language itself, I got the impression that the dune developers were being conscious to “add great features reliably and safely”. So overall I thought it was a great language/ecosystem, ymmv though.

Re: Elixir v1.20: Now a gradually typed language

#145

Im not Jose so I bow to his wisdom but imho thinking about Elixir in types means you arent treating is like a lisp any more, which imho undermines how great Elixir is in the agent of agents this will probably give us a big boost though so thankyou Elixir team

Why are types anti-lisp?

Re: Elixir v1.20: Now a gradually typed language

#146
post #27
post #10

Earlier quoted context omitted.

https://pragprog.com/titles/lhelph/functional-web-developmen... don't let the title fool you - the first half of the book is just elixir over the past 8 years this is the book i've used to ramp back up on elixir and it works like a charm every time - i've never finished it for me, a mark of a good programming book in this tutorial-project style is that I have started it half a dozen times and never finished it becaus…

I've heard that Phoenix has changed a lot since that book was written. How relevant are those framework specific parts still?

As someone who learned Elixir during the Phoenix 1.7 release, let me tell you: If you downgrade to Phoenix 1.6 and learn from there, you should be fine.

The upgraded versions are mostly the same, but the differences in Phoenix 1.7 are enough to break the tutorials enough to confuse a newbie. Now, in the post-LLM age, that's not nearly as bad. But it was a real pain when I was learning.

Re: Elixir v1.20: Now a gradually typed language

#147

Maybe it is only my experience, but i feel that languages that were not typed since the begining never work as well as "true" typed ones.

It was poorly bolted on in Python. Well I dislike types to begin with, but aside from that, Typescript somehow did it better.

Re: Elixir v1.20: Now a gradually typed language

#148
post #4

Earlier quoted context omitted.

I invite you to ask on ElixirForum. I have never seen a truly hostile response. Sometimes posts don't get traction due to ambiguity, and some smelled like "do my homework" so people ignored them. But every post with a genuine curiosity in it gets answered, as far as I can tell.

Yea I've posted there twice as far as I remember. You will absolutely get help, whether you understand the answers is a whole different story. Elixirs community is great. Its just hard to learn because it's not yet widely adopted, there are no (non senior) roles for it and it's a lot of work understanding all the BEAM concepts. A thing just being interesting isn't enough motivation for me to learn, I need a bigger go…

I haven't dug into this for a while, bit you should be able to define a catch-all event to return a respond to non-compliant requests . It should be built-in to some degree IMO, but I think it's not an unsolved problem.

Re: Elixir v1.20: Now a gradually typed language

#149

Earlier quoted context omitted.

I think the lack of parentheses is whats throwing me off regularly with Elixir.

I find the optional parentheses, and the way that keyword lists are defined to be the two biggest stumbling blocks when I come back to Elixir after a while way. Coming from other languages, I find that example("with", 3, extra: "arguments", as: "a", keyword: "list") being equivalent to example("with", 3, [extra: "arguments", as: "a", keyword: "list"]) and example "with", 3, extra: "arguments", as: "a", keyword: "list…

Elixir has enough syntax sugar to cause diabetes.

Personally, I like the flexibility, but yes there are a lot of rules to keep in mind.

Re: Elixir v1.20: Now a gradually typed language

#150

Maybe it is only my experience, but i feel that languages that were not typed since the begining never work as well as "true" typed ones.

It was poorly bolted on in Python. Well I dislike types to begin with, but aside from that, Typescript somehow did it better.

> Typescript somehow did it better

I don’t think JavaScript’s syntax was ever designed with the idea that TypeScript would one day exist. Yet somehow it feels like it left the perfect open spaces for TS to later occupy.

Post reply on HN