Live data from Hacker News

Elixir v1.20: Now a gradually typed language

elixir-lang.org

11–20 of 426 posts

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

#11
post #3

I've seen various posts about Elixir's gradual type system pop up on HN, but haven't been following too closely. Does anyone know whether this particular gradual type system can change the asymptotics of programs vs untyped code? As far as I'm aware, most gradual type systems (e.g. Racket) can make programs run asymptotically slower, although there are some exceptions [1]. [1] https://doi.org/10.1145/3314221.3314627

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

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

#12
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…

Fair. If you have this friction then it's not worth pursuing.

One thing that really helped me pick it up was saying YOLO and rewriting one part of the business stack from Ruby on Rails to Elixir. It taught me quickly and well.

The official guides are also great and IMO you can get through them all without a rush in two weekends. But again, if you don't want to then don't.

You can also try asking right here in this HN thread. Maybe I or others would be willing to give you a more detailed response.

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

#13
post #10

Oh shit here I go (and learn Elixir for a whole year (again)) again. I love everything about Elixir, but Elixir constantly makes me doubt myself like no other language. My brain isnt made for functional stuff, but this makes me want to try again. Sucks that it's not really a beginner friendly ecosystem and usually, when having questions answered, people assume you already know a lot about the language.

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…

Yea I've worked through Elixir in Action and appreciate all book recommendations. My issue is, tutorial style books rarely cover security related concerns.

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

#14
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…

> whether you understand the answers is a whole different story.

You can always ask follow up questions for clarification, people there are generally really friendly.

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

#16

Oh shit here I go (and learn Elixir for a whole year (again)) again. I love everything about Elixir, but Elixir constantly makes me doubt myself like no other language. My brain isnt made for functional stuff, but this makes me want to try again. Sucks that it's not really a beginner friendly ecosystem and usually, when having questions answered, people assume you already know a lot about the language.

What functional stuff is throwing you off? A whole bunch of it can be written procedurally when starting out.

With Elixir specifically it was the learning experience I had with Phoenix. I didn't understand how a Phoenix app booted, didn't know where to edit my config. Syntax like:

``` socket "/ws/:user_id", MyApp.UserSocket, websocket: [path: "/project/:project_id"]

```

Elixir gives you too much freedom on how to write something on a syntax level which really annoyed me.

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

#17

Earlier quoted context omitted.

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…

Fair. If you have this friction then it's not worth pursuing. One thing that really helped me pick it up was saying YOLO and rewriting one part of the business stack from Ruby on Rails to Elixir. It taught me quickly and well. The official guides are also great and IMO you can get through them all without a rush in two weekends. But again, if you don't want to then don't. You can also try asking right here in this HN…

When building I couldn't get "what if I have ghost processes", "what if I spawn too many processes", "what if this architecture is bad compared to...", "when to kill processes", "whats the correct restart strategy for this" out of my head... It's so confusing to build for the BEAM that I ultimately gave up on it.

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

#18

Earlier quoted context omitted.

What functional stuff is throwing you off? A whole bunch of it can be written procedurally when starting out.

With Elixir specifically it was the learning experience I had with Phoenix. I didn't understand how a Phoenix app booted, didn't know where to edit my config. Syntax like: ``` socket "/ws/:user_id", MyApp.UserSocket, websocket: [path: "/project/:project_id"] ``` Elixir gives you too much freedom on how to write something on a syntax level which really annoyed me.

> Elixir gives you too much freedom on how to write something on a syntax level

This is true perhaps compared to python or go, but not compared to Java, JS/TS, or some others.

> socket "/ws/:user_id", MyApp.UserSocket, websocket: [path: "/project/:project_id"]

Socket is a behavior, which is like a trait or interface. MyAppWeb.UserSocket implements the behavior. It's basically a convenience over having to write a bunch of repetitive WS or long poll handling every time you want a socket like thing. Its pretty well documented https://phoenix.hexdocs.pm/Phoenix.Socket.html.

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

#19

Earlier quoted context omitted.

Fair. If you have this friction then it's not worth pursuing. One thing that really helped me pick it up was saying YOLO and rewriting one part of the business stack from Ruby on Rails to Elixir. It taught me quickly and well. The official guides are also great and IMO you can get through them all without a rush in two weekends. But again, if you don't want to then don't. You can also try asking right here in this HN…

When building I couldn't get "what if I have ghost processes", "what if I spawn too many processes", "what if this architecture is bad compared to...", "when to kill processes", "whats the correct restart strategy for this" out of my head... It's so confusing to build for the BEAM that I ultimately gave up on it.

Ah, true. You are right this assumes some familiarity. Definitely a gap.

Check this out: https://www.theerlangelist.com/article/spawn_or_not

Written by one of the very best Elixir mentors. I believe it will dispel most (hopefully all) of your doubts and clear things up.

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

#20
Found elixir intriguing and so Phoenix.

Two reasons I put it aside again are:

You need Beam and the Elixir. I find that really weird, because I'm used to just the language like in Python, Java, C, Rust. Not something underneath it, too.

There is no debugger. The way to debug Elixir is to print stuff to the console, like 40 years ago. No thanks.

Post reply on HN