dwyl / learn-elixir

:droplet: Learn the Elixir programming language to build functional, fast, scalable and maintainable web applications!
1.6k stars 107 forks source link

My Future with Elixir: set-theoretic types #179

Open nelsonic opened 1 year ago

nelsonic commented 1 year ago

https://elixir-lang.org/blog/2022/10/05/my-future-with-elixir-set-theoretic-types/ via: https://news.ycombinator.com/item?id=33096995

nelsonic commented 1 year ago

Still early days but stoked José + Co are investing time in this cause there are still loads of people who don’t use Elixir because they are dogmatic about types. I see the benefit of static typing for compile-time checking. It can be mega useful on larger codebases. Love how Elm does it, hate how annoying it made my recent TypeScript experience. 🤦‍♂️ I’m all for the exploration. But I think this will most likely just drive me toward using Rust. 💭

ndrean commented 1 year ago

Talking about types, you have 1 == 1.0, an intersection of Integer and Float. When f = to_string, then f(1) != f(1.0). Ok. Take "1.0" and "1" and g = String.to_float, then g("1") doesn't exist but g("1.0") == 1.0 == 1 .... Messy no?

nelsonic commented 3 weeks ago

https://news.ycombinator.com/item?id=40656747

ndrean commented 3 weeks ago

My 2 ç.

but for me, the killer feature is IEX, Elixir's REPL. Being able to interact directly with my running code easily ( in dev or in production ), introspect it, debugging it, is just life changing.

I was surprised at the beginning not to find a debugger "à la Javascript", where to can stop the code from running. But he is right, iex -S mix phx.server is a killer. And when you think about it, it is only processes that are running, so it probably does not make any sense (and perhaps it is impossible) to stop it from running. Saying that, you have LiveBook, a really great tool: you can run your code sequentially. The best thing I've seen.

Then for building apps, probably ash should be considered with more attention. But it seems very conceptual, like the "Context" thing. Too conceptual maybe?

Besides the machine learning efforts (still believe that Python is sooo much ahead and "universal" but I enjoy it with Elixir), the native effort is good. However, it should also be able to go "PWA", with service workers, being able to reconcile his state with the server (although I imagine that it might be hard to manage 2 states, client and server). A mobile app should not stop but on the contrary (try to) recover when the network is down. A CRDT like ?? Imagine you changing from your WIFI to your 5G, and your socket is down, and the app stops :( A mobile app that demands you to be immobile....