Live data from Hacker News

Elixir v1.20: Now a gradually typed language

elixir-lang.org

41–50 of 426 posts

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

#43

Earlier quoted context omitted.

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.

I'd also suggest skimming this free ebook: https://erlang-in-anger.com

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

#44
post #26
post #22

Earlier quoted context omitted.

Java has the JVM the same way that Elixir has Beam/OTP/...

Read again... Here's what you need to do for elixir: Download and run the Erlang installer Download and run the Elixir installer Here for Java: Download and run the Java SDK And for Python: Download and run the Python installer

To use Python/Java you have to download and install an OS. (Though some versions might run on bare metal)

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

#45
post #39
post #26

Earlier quoted context omitted.

Read again... Here's what you need to do for elixir: Download and run the Erlang installer Download and run the Elixir installer Here for Java: Download and run the Java SDK And for Python: Download and run the Python installer

Is your issue something with the runtime itself, or just the difficulty of installing it?

I think the issue is "I have to install two things instead of one thing" which is a pretty weird way to judge a programming language.

I guess we know how he feels about TypeScript.

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

#46

How does it compare to Gleam? Or rather, why use Elixir over Gleam now? I suppose Phoenix and Live View in particular are big draws to Elixir.

Do you like Rust or do you like Erlang? Writing Gleam is like writing Rust, writing Elixir is like writing Erlang.

I don't know the current state of Gleam OTP, but last I checked it wasn't great.

If you don't care about either of those things and only about types, use Gleam. But then why not just use Rust?

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

#47
Guys,

I am sorry for your loss here.

    def example(x) when not is_map_key(x, :foo)
I think this also shows that merely copy/pasting ruby's syntax, isn't an automatic win. I noticed this before with crystal, though naturally crystal had types from the get go.

Fundamentally:

   def foo()
   end
should stay simple. And this is no longer the case now.

(Ruby also went in error, e. g. "endless methods". I don't understand why programming languages tend to go over the edge in the last 5 years or so.)

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

#48
post #46

How does it compare to Gleam? Or rather, why use Elixir over Gleam now? I suppose Phoenix and Live View in particular are big draws to Elixir.

Do you like Rust or do you like Erlang? Writing Gleam is like writing Rust, writing Elixir is like writing Erlang. I don't know the current state of Gleam OTP, but last I checked it wasn't great. If you don't care about either of those things and only about types, use Gleam. But then why not just use Rust?

Your last sentence is basically where I'm at, writing my backends in Rust these days. I'm interested in the BEAM promise of letting things crash but not sure how good that is in Gleam due to its OTP still being somewhat immature as the devs are rewriting GenServer as a typed library.

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

#49
post #26
post #22

Earlier quoted context omitted.

Java has the JVM the same way that Elixir has Beam/OTP/...

Read again... Here's what you need to do for elixir: Download and run the Erlang installer Download and run the Elixir installer Here for Java: Download and run the Java SDK And for Python: Download and run the Python installer

If you're going to try and use this analogy, you need to compare Elixir to Kotlin or Scala or Clojure rather than Java. Elixir is a language written for the BEAM which was created for Erlang. The BEAM happened to be useful VM for these other languages such as Elixir, Gleam, LFE, & Luerl.

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

#50
post #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.

If you're used to Java, Elixir is like `javac`, Beam is like `java`. Mix is like a (way better) version of Gradle. You need elixir to compile your app, you only need the Beam to run it. Once you've built your project, you don't need Elixir anymore exactly like java/javac. C and rust compile to machine code so don't have a runtime dep, but otherwise they still require you to have a compiler at build time, just like elixir.
Post reply on HN