Live data from Hacker News

Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

dcs.gla.ac.uk

41–50 of 59 posts

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#41

Earlier quoted context omitted.

Akka is built on top of the JVM which doesn't support fibers (yet: see http://openjdk.java.net/projects/loom/ ). Akka implements its own scheduling atop Java's fork-join thread pool. Fibers at the JVM layer would be faster.

Not only that, its non blocking. Meaning you can have a very small thread pool with great performance. Think 1 thread per core.

[deleted]

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#42
I recently switched the core pages of my website (a small search engine) to Go from PHP. Have not implemented any goroutines yet, just focused on a line-by-line port for now, and it was overall a fun experience. I would highly recommend Go. Only downside is the smaller (but growing) community of developers, so you might spend a little more time finding answers. Also I wish it didn't force you to comment out unused libraries or unused variables when you're trying to troubleshoot something. It should be allowed when running, but keep it restricted when building maybe?

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#43
> In the experiments we use the following versions of the languages: Erlang/OTP 19.0, Go 1.7.1, Scala 2.12.0 with Akka 2.4.12.

These are pretty outdated, it would be interesting to see numbers on the latest versions. I'd be especially curious to compare with Erlang/OTP 21.0 (coming out today) as they did a lot of optimization work on the attributes tested in this benchmark.

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#44
post #42

I recently switched the core pages of my website (a small search engine) to Go from PHP. Have not implemented any goroutines yet, just focused on a line-by-line port for now, and it was overall a fun experience. I would highly recommend Go. Only downside is the smaller (but growing) community of developers, so you might spend a little more time finding answers. Also I wish it didn't force you to comment out unused li…

Look up the vscode-go extension. It adds/removes unused imports automatically and thus removes most of the friction.

Regarding unused variables, the only solutions I am aware of involve renaming to underscore, commenting out or passing to a function like fmt.Println.

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#45
post #35

Earlier quoted context omitted.

Benchmarks game used to have stats for Scala but apparently not anymore. Many of Scalas abstractions, unlike Kotlin, have runtime cost

Well, you don't have to use those abstractions. But yes, it's a sad fact that when programming in Scala, the closer to Java-style you program, the faster your program will be. I haven't read this paper closely, but it looks like it's more measuring the performance of Akka, rather than the performance of Scala. Akka does reasonably well here compared to Erlang, so I don't think there's anything we can complain about.…

[deleted]

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#46
post #44
post #42

I recently switched the core pages of my website (a small search engine) to Go from PHP. Have not implemented any goroutines yet, just focused on a line-by-line port for now, and it was overall a fun experience. I would highly recommend Go. Only downside is the smaller (but growing) community of developers, so you might spend a little more time finding answers. Also I wish it didn't force you to comment out unused li…

Look up the vscode-go extension. It adds/removes unused imports automatically and thus removes most of the friction. Regarding unused variables, the only solutions I am aware of involve renaming to underscore, commenting out or passing to a function like fmt.Println.

Atom IDE, vim, and just about anything that uses goimports, gocode, and the other packages works great.

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#47

Any thoughts on Cloud Haskell?

If you are comparing to Go then just regular Haskell has all the same capabilities and more (lightweight threads and communication primitives, plus extra cool stuff like software transactional memory). Cloud Haskell is trying to put it more in the Erlang camp where you can distribute beyond a single process transparently, but I don't think it is well maintained or really production ready.

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#48
post #37
post #34

Earlier quoted context omitted.

> Haskell execution tome is slower than many languages, but is probably comparable with Erlang and Scala. Do you have specifics on that matter ?

There are various multi-language benchmarks, e.g. https://benchmarksgame-team.pages.debian.net/benchmarksgame/

Those benchmarks do not compare like-for-like. Often the Haskell versions try to solve the problems elegantly with high-level functional code at the expense of performance, e.g. see Mandelbrot.

GHC Haskell is an advanced optimising compiler that will produce considerably faster functional code than both Erlang and Java. For maximum performance, it is perfectly possible to write imperative array-oriented code in Haskell, in which case performance should be comparable to Java.

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#49

Earlier quoted context omitted.

Akka is built on top of the JVM which doesn't support fibers (yet: see http://openjdk.java.net/projects/loom/ ). Akka implements its own scheduling atop Java's fork-join thread pool. Fibers at the JVM layer would be faster.

Quasar is Loom. Hopefully pron chimes in.

Loom is quite a bit different than Quasar, but pron (aka Ron Pressler), is leading the way on both. Loom is essentially Quasar would have loved to have baked into the JVM. It's the solution for the bytecode rewriting hackery and resulting limitations it faced.

Re: Comparing Languages for Engineering Server Software: Erlang, Go, and Scala/Akka [pdf]

#50
post #28

This paper covers all the mainstream languages but I feel an "alternatives considered" section is missing. I would love to know what's the author's input on Swift server side, Elixir and Crystal.

There were many languages that we would like to have considered. We do expect the performance of Elixir to be pretty similar to Erlang as it runs on the same VM (BEAM). With regards the "alternatives considered", Section 2 outlines key characteristics of server languages, and Table 1 analyses a selection of languages against these characteristics. We welcome others to report results for other languages using the benc…

Hi Phil,

One thing you might find interesting - a small, crude experiment suggests that changing maxBlocking.erl to use process hibernation for those dormant processes could almost double the max number of processes Erlang can support.

I changed maxBlocking.erl's final few lines to read

    p() ->
        erlang:hibernate(?MODULE, q, []).
    q() ->
        receive
            "hello" ->
                io:format("Hello")
        end.
RabbitMQ uses hibernation in many places to reduce memory usage when many resources are being managed by the server.
Post reply on HN