Hacker News new | ask | show | jobs
by shrugger 3653 days ago
I switched from Ruby to Scala, and I have had an absolute blast. Elixir is sort of chained to BEAM, which doesn't appear to have as bright a future as the JVM or LLVM does, so Scala seemed like a safer bet.

Reading about Elixir is cool sometimes, but then I look at Dotty, and I feel confident that I made the correct choice.

I've also been keeping an eye on Crystal (statically typed Ruby-esque language, LLVM), but they aren't making great PLT choices so far. Maybe they'll get it together later. Scala-Native will blow it out of the water most likely anyways.

Sort of the opposite of losing statically typed programming, but I've really enjoyed the journey and it's improved my work a lot more than I thought it would. I know Ruby pretty well and I used to feel really dumb all the time when things would break, and it took some time for me to realize that it was a language problem. Looking back and reading some of the Ruby that I ported, it was impossible to reason about, and very difficult to make guarantees for. Nothing was solid at all, and runtime errors could hypotehtically stop the show at any time. With Scala there's a much sharper baseline of what will definitely work or not work.

Types make a LOT of things so much easier, in exchange for making a few things SLIGHTLY more tedious. After doing it, I'd make that trade ten more times if I had to.

4 comments

> Elixir is sort of chained to BEAM, which doesn't appear to have as bright a future as the JVM or LLVM does, so Scala seemed like a safer bet.

Where does this impression come from? The BEAM VM is maintained by Ericsson, we get new "major" releases every year. In the last years we got the maps data type, the new scalable timer API, better tracing facilities, dirty schedulers, and so on. Lately, at ElixirConf Berlin, we heard about the current efforts on scaling the Erlang Distribution to thousands of nodes out of the box (it is already possibly today, just not by default).

They are also plenty of research projects, mostly in Europe, about improving the VM, development experience and scalability in different ways, such as http://release-project.eu/, http://www.prowessproject.eu/ and http://paraphrase-ict.eu/. That's not including the usual suspects like Chalmers and Uppsala in Sweden, which have been exploring different aspects, specially in the testing area with property-based testing, concolic testing, systematic concurrent testing, etc.

Companies like Adapteva (behind Parallella), Basho, Erlang Solutions, Plataformatec, and many more are investing in the ecosystem too. If there is one thing I am not worried about is the VM and the runtime bright future.

In my opinion, the simple fact we have a runtime with preemptive light-weight processes from the ground-up (instead of tackled on top as a library/framework) with per process garbage collection and inter-node communication taken care of is enough to hold the VM for the next handful of years, even if all development ceased today.

I would argue that Elixir's success will further guarantee BEAM's future. (Not that it would die otherwise, but it doesn't hurt.)
can you give an example of questionable Crystal desicions?
When you say BEAMs future is not as bright, what indicators are pointing you in that direction?
I can't speak for shrugger, but when I see the manpower invested in improving Java, .Net, JavaScript, Go, LLVM runtimes/compilers, I'm personally wondering if BEAM will be able to follow. We are starting to see languages like Python fade away because of that, when fast execution starts to matter.
Relative to LLVM, I mean. I don't think there are any huge red flags with regards to BEAM.
Apples and oranges. LLVM is not a virtual machine, it's a compiler development infrastructure. But JVM vs. BEAM is a sensible VM comparison.
Doesn't LLVM (or a related project) support JIT compilation?
That's right, LLVM does support JIT compilation. But it's just one tool in the toolbox. I would hazard a guess that most projects which depend on LLVM don't use the JIT compiler.

But even with a JIT compiler, LLVM doesn't provide the kind of runtime services (e.g., memory and resource management) that we would typically associate with a VM runtime like the JVM's. Like their Web site says, "Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them."

Note the lack of technical claims that one is superior to the other, thanks for pigeonholing what I was getting at.
I don't think you've communicated what you were trying to accomplish very well with your LLVM comparison. Many people will see it and think you're confused at what you're talking about.
> Scala

That means being chained to JVM. That is a big downside for me.

Or JS with Scala.js Or literally anything with Scala Native, which is being sponsored and supported by EPFL directly.

So yeah, no.

I saw about 5-6 products which use Scala.js and I haven't heard of any of them before. Who else uses that? Seems rather obscure.

Is Scala Native used widely? They just finished implementing java.lang.String 20 days ago or so. At least Erlang on Xen has been serving web pages for a few years now: http://erlangonxen.org

But most usage of Scala is on JVM still, wouldn't you agree? We are not talking CPython/Jython/PyPy/Numba... I don't know, the claim that Scala is widely implemented on other platforms while Elixir is tied to BEAM doesn't quite go far for me.

I understand, but your opinion doesn't change the facts. Scala.js is more than mature, with some huge projects already built in it. I'd not heard of erlangonxen, but it would take a lot of convincing to re-write something in Erlang to begin with, when I could write it quicker in Scala, and run on 2, eventually 3 different platforms.

Scala Native is not very far along compared to Scala.js, but it is actively being improved, and is considered an official extension. Additionally, Dotty will bring huge improvements for JVM scala.

I am not super happy with JVM most days, but I'd far and away prefer to be chained to JVM than BEAM. I mean, it's not even a question at this point, considering the billions of dollars spent developing JVM and the work of the brightest minds of several generations. Joe is a cool guy and all, but Erlang is objectively a niche platform compared to JVM.