Live data from Hacker News

Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

elixir-lang.org

151–160 of 170 posts

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#151

The last few years the Elixir ecosystem has started to become the simplest solution to so many use cases: - Web development with Phoenix and Liveview is immensely enjoyable and fast - AI with NX, Axon, Bumblebee - Audio and Video streaming and manipulation with Membrane - CQRS and Event Sourcing with Commanded - Embedded with Nerves to make your own devices - Mobile apps with Liveview Native ( in development ) - Queu…

When you use Elixir you have to go into it knowing you might have to end up maintaining any library you are using because the vast majority of Elixir libraries are abandoned. You have to search through libraries to find out which one is being maintained. For example if you want to use an OpenAI API client, you wouldn't want to use the most starred one because that hasn't been maintained in 7 months. If you just use P…

Honestly I don’t see it as such an issue.

If I had to use OpenAI API I would pick my favorite HTTP client and just use the Rest API and write a small wrapper around it for my needs.

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#152

Earlier quoted context omitted.

So inserting those type checks automatically will cause regressions because those checks are not free at runtime, and there are cases where the JIT will look at the code and not bother optimizing.

To clarify, the type-checker does not modify compilation to the beam at all. Instead, it takes into account the predicted runtime checks to inject more static types into its analysis. For instance, without even introducing annotations, if a function head has a guard `is_boolean(x)`, using the + operator on x within that function would lead to a type error.

exactly. The potential performance regression of guards is exactly why the elixir typechecker doesn't insert them. I guess I hadn't made that point clear in my comment. IIRC The elixir guides talks about excessive typechecking being a code smell.

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#153

Earlier quoted context omitted.

Go back? Have you ever worked on a significant project in either Erlang or Elixir? If so, what issues did you experience?

This was meant for the statical typesystem. I've worked without statical typesystem in other languages, yes. (never professionally on the BEAM though)

This seems to be the case for 99% of people I've noticed worrying about types for Elixir.

I've worked with a wide spectrum of type systems and none of the things that caused issues for me due to typing in large JS or Ruby projects ever did in Elixir. The schema-based structs and pattern-matching make a huge difference. I don't feel quite as confident of a poorly tested Elixir code base as one written in Rust, but I'd take it over one written in TypeScript or Obj-C any day of the week.

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#154

Earlier quoted context omitted.

This was meant for the statical typesystem. I've worked without statical typesystem in other languages, yes. (never professionally on the BEAM though)

This seems to be the case for 99% of people I've noticed worrying about types for Elixir. I've worked with a wide spectrum of type systems and none of the things that caused issues for me due to typing in large JS or Ruby projects ever did in Elixir. The schema-based structs and pattern-matching make a huge difference. I don't feel quite as confident of a poorly tested Elixir code base as one written in Rust, but I'd…

This is my experience too. Elixir's lack of static types never caused me nearly as many problems as they have in other languages; it's surprising how little I've missed a static type system. I wrote about it here:

https://phoenixonrails.com/blog/you-might-not-need-gradual-t...

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#155
post #101

Any recommendations for an entry point into Elixir? I've been teaching myself Rust through resources like Rustlings and 100-exercises-to-learn-rust, and I've found that approach to be pleasantly accessible. I've yet to find something similar for Elixir, whether interactive or just well laid-out.

Shameless plug: I created a video course that shows you how to build and deploy a product with Elixir really quickly. https://indiecourses.com/catalog/build-an-mvp-with-elixir-6i...

Hello Peter, fyi, I'm having trouble accessing the cashblog.app website. Not sure if it's just on my end but might be worth taking a look. Cheers.

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#156

Earlier quoted context omitted.

> Very very few companies build and maintain SDKs for Elixir. This is true with any tech until it gets traction. React/Next is backed by a big company, but Vue/Nuxt still managed to grab its piece of the pie. In order to get traction Erlang / Elixir needs enthusiasts who are ok with risking and introducing it to their company or product, at least partially. No offense, but instead of condemning the Elixir ecosystem,…

We did and it was a lot of work. We had to maintain 5-6 libraries ourselves instead of using one maintained by the services themselves. We had to fork libraries because they became abandoned. Elixir has been around for 12 years now and still hasn't gained any meaningful traction. The risk of using Elixir vastly out ways the benefits today if you are trying to build a product. There is a reason why almost every produc…

NPM is anything but fun, I’ve seen tertiary dependencies cause complete application failures due to bad patch version releases.

Packages depending on packages not maintained or containing security issues.

I don’t know how many times Next has released broken updates without any mention of it in their change log and then you find a GH issue where it’s essentially “works on vercel hosting”…

Easy to find developers is often touted as a plus, but the process for making sure you get the right ones are scarce, and JS code bases almost always ends up as complete spaghetti as a result. As someone doing JavaScript for a very long time my statement is that it’s one of the hardest ecosystems to get right and it requires exceptional developers to do so, unfortunately it’s also where many start their journey and without exposure to other technologies becoming great at it is very hard.

The fact that I can do `mix hex.outdated` and get a code diff on dependency changes makes me smile every time, compared to the insanity that is updating npm packages in any sizeable project with hundreds of updates weekly.

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#157

Earlier quoted context omitted.

This seems to be the case for 99% of people I've noticed worrying about types for Elixir. I've worked with a wide spectrum of type systems and none of the things that caused issues for me due to typing in large JS or Ruby projects ever did in Elixir. The schema-based structs and pattern-matching make a huge difference. I don't feel quite as confident of a poorly tested Elixir code base as one written in Rust, but I'd…

This is my experience too. Elixir's lack of static types never caused me nearly as many problems as they have in other languages; it's surprising how little I've missed a static type system. I wrote about it here: https://phoenixonrails.com/blog/you-might-not-need-gradual-t...

Ah, yes. You pointed out immutability in that post, which also makes a significant difference!

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#158

Earlier quoted context omitted.

This is my experience too. Elixir's lack of static types never caused me nearly as many problems as they have in other languages; it's surprising how little I've missed a static type system. I wrote about it here: https://phoenixonrails.com/blog/you-might-not-need-gradual-t...

Ah, yes. You pointed out immutability in that post, which also makes a significant difference!

Have you ever worked in a language where pretty much everything is immutable AND you have a very powerful static typesystem though? (so not Java and also not Rust).

If not, maybe it's hard to understand where I come from. On top of that, people are different. Maybe Elixir is the right thing for you, but still not for me as I'm more prone to typos and such kind of small errors.

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#159
post #56

Earlier quoted context omitted.

I love elixir. I use it for basically everything. And LiveBook has become my go-to place to start building toy software. I just can't do liveview. I have a very hard time grokking it, and it has a lot of footguns. (ex: if you need to remember to perform auth checks both doing a `pipe_through` in a router and using the `on_mount` callback in a LiveView, see [0].) In fact, the fact that the above sentence has zero mean…

Thanks for the link. This is my fault because the sentence is ambiguous. Where it tries to explain that "you need to remember to perform auth checks both", it rather means that you need to protect controller routes and LiveView routes the same way, but for a single LiveView, you don't need to do both. I will try to clarify it! If you have other footguns in mind, feel to shot me an email at jose dot valim on gmail!

I really appreciate that you took the time to clarify this. I was surprised by parents comment about needing auth twice but they seemed confident. Honestly worried I have apps with auth gaps!

But what you wrote matches my understanding. I have some routes that are pure LiveView and some that go through controller routes with HTML, and it was clear to me where I needed auth when I made them.

Re: Elixir 1.17 released: set-theoretic types in patterns, durations, OTP 27

#160
post #87

Earlier quoted context omitted.

Hi Brian, thanks for all effort put into LiveView Native. Quick suggestion, it would be nice if the landing page [1] has more information or links to actual examples of how to use LiveView Native. That page has not been updated in a long time and give the (misleading) impression that the project is on hold. [1] https://native.live/

website comes last

That is sad to hear. Spending even just thirty minutes on the website to better communicate what one can/cannot do would go a long way.

In any case, thank you for your work.

Post reply on HN