Top
Best
New

Posted by cloud8421 1 day ago

Elixir v1.20: Now a gradually typed language(elixir-lang.org)
945 points | 377 commentspage 4
cui511511 13 hours ago||
[dead]
swordlucky666 8 hours ago||
[dead]
Miles_Stone 12 hours ago||
[dead]
melon_tsui 18 hours ago||
[dead]
Miles_King 15 hours ago||
[dead]
maoliofc 20 hours ago||
Its cool
shevy-java 1 day ago||
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.)

josevalim 1 day ago||
The syntax you are commenting on has always existed in Elixir, before v1.0, as part of patterns and guards.

You are commenting as if we added this now but we have made no changes to the language surface. The difference is that we now leverage these same language constructs to extract precise type information.

andy_ppp 1 day ago||
You can of course still do the second thing, the types are not forced if you don't want them!
7bit 1 day ago|
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.

victorbjorklund 1 day ago||
That is just wrong.

> 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

The beam is a VM. You get that Java requires a VM too right? It’s called JVM for a reason. And Python requires an interpreter.

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

That is false. https://www.erlang.org/doc/apps/debugger/debugger_chapter.ht... and you have observer. And you have a lot of other debugging tools. I hear Java has a good one and maybe it’s better (I never used it) but it’s not true there exist no debuggers for the beam.

Spixel_ 1 day ago||
Almost nobody uses it though, which is too bad, especially since multi-head functions sometimes make it difficult to follow the execution path.

I'd like to do step by step but I cannot plug the debugger to VScode from inside a docker container.

seanclayton 1 day ago|||
No one I know wears the shoes I like to wear, which is too bad, because that means I can't enjoy them as much now.
Spixel_ 1 day ago||
I meant that it doesn't get much love from the community, it's pretty clear it's not used much, that's why things like `dbg` gets added to the language.
ch4s3 1 day ago||||
I've used it, but I've very rarely needed to do so.
cmoski 1 day ago|||
People use it.
Spixel_ 1 day ago|||
Some do, but the DX was bad last time I tried, I did not find a way to use it with my setup.
lionkor 1 day ago|||
Java has the JVM the same way that Elixir has Beam/OTP/...
hackyhacky 1 day ago|||
And CPython runs Python bytecode, which is basically running in a Python virtual machine.

I am not sure what GP is objecting to.

rfgplk 1 day ago||
> I am not sure what GP is objecting to.

Elixir always felt like it would be a solid functional systems programming language, so not having a compiled backend is a genuine downside.

7bit 1 day ago|||
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

sbuttgereit 1 day ago|||
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.
7bit 1 day ago||
No, I don't. I'm not writing gleam etc for the same reasons.
dematz 1 day ago||
If you don't want to then fair enough :) that said if your problem is just installation, some of the gleam people realized it can be tricky and made a nice guide for various operating systems and package managers: https://gleam.run/install/

Note this includes installing erlang as well

While it is multiple steps, the frustration is a much more one time thing compared to the problems and frustrations you'd have using a language or its ecosystem for a long time or big project

freedomben 1 day ago||||
For Java you need a JRE and JDK depending on whether you're just running or also building. That they are bundled (for Windows) is slightly convenient, but they're not bundled on Linux so what you're saying is OS dependent
burnt-resistor 1 day ago||
JRE or JDK, not "and". The JDK is a superset of the JRE.
freedomben 21 hours ago||
Thank you, appreciate the correction
flexagoon 10 hours ago||||
> Download and run the Erlang installer Download and run the Elixir installer

No, you just install the elixir package from a package manager. Windows not including a proper one by default is not a fault of the language.

dematz 1 day ago||||
Is your issue something with the runtime itself, or just the difficulty of installing it?
WolfeReader 1 day ago||
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.

sokols 1 day ago||||
To use Python/Java you have to download and install an OS. (Though some versions might run on bare metal)
WolfeReader 1 day ago|||
Here's what you need for Java:

Download SDKMan/Jenv

Install the version(s) of Java you need for your projects

Make sure your JAVA_HOME environment variable is set

Ensure your IDEs locate the correct Java home

Compared to all that, Elixir's two installers are trivial.

And if you have a competent package manager, you can just tell it to get Elixir and it'll handle Erlang for free.

vips7L 1 day ago||
No you don't. The process is exactly the same for Java.
WolfeReader 1 day ago||
Nah, I work on a team that has multiple microservices written over the years in different versions of Java. "Just click the installer" is not sufficient. That's why programs like jenv, SDKman, nvm, and others even exist (and are popular). Your lack of real-world experience is showing.
vips7L 1 day ago||
LOL LaCk oF eXpErIeNcE. Bro all you have to do is open intellij and it will prompt you to install the correct version of Java.
WolfeReader 1 day ago||
Don't tell OP this - he doesn't want to install multiple things. You'll scare him away from Java.
7bit 9 hours ago||
Java is ugly anyway
freedomben 1 day ago|||
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.
hmmokidk 1 day ago|||
I genuinely needed that laugh. Thank you
7bit 1 day ago||
You make me laugh as well, all is good.
wkrp 1 day ago|||
To be fair, there is more than just print debugging. You have access to tools like red(x)bug https://github.com/nietaki/rexbug, the Elixir-LS project has Debug Adapter Protocol support. And in my opinion, the REPL (and decent software architecture) makes it easy to investigate your code by just running the functions as needed (even if your live production system if you want).
lkuty 16 hours ago||
But then you have all the Erlang libraries for free which is huge. And you add to them the Elixir libraries and that gives you a lot of stuff, just like you get with languages with rich libraries e.g. Java, Ruby, ... I find it reassuring.