News for hackers. Stuff that matters.
Re:Crystal: Fast as C, Slick as Ruby by rdtsc on Thursday August 04, 2016 @01:59AM (#12223690)
> Elixir is not a fast language.

Depends what we mean by fast. I have seen Erlang VM handle 100k requests per second on a distributed cluster. That's plenty fast. Moreover, because of fault tolerance, it means ability to have a better uptime, with less people on-call. "Fast" can also be measured to include that, if system goes 200k requests per second, but crashes at midnight and stays down for a few hours, the average "speed" can be quite low. In a laptop demo that's not visible, but in practice that's money and customers lost.

But if fast means, "let's multiple some matrices", then yeah can probably use Rust or C for that. It all depends on the problem domain.

Re:Crystal: Fast as C, Slick as Ruby by qaq on Thursday August 04, 2016 @09:04AM (#12225190)
Phoenix is slightly faster than Gin (Go web framework) so depending on your use case it can be fast :). Obviously one of the primary selling points is OTP/BEAM VM with all the concurrency, HA, soft realtime etc. but with simpler syntax than Erlang.
Re:Crystal: Fast as C, Slick as Ruby by jsmith0295 on Thursday August 04, 2016 @10:59AM (#12225928)
Its only faster at IO. Once you start adding CPU bound work to the equation, Phoenix's performance will begin to drop. It's similar to Node in that regard.
Re:Crystal: Fast as C, Slick as Ruby by qaq on Thursday August 04, 2016 @11:06AM (#12225980)
True any generalisation has flaws :) Even faster is relative do you care about avg or worst case performance do you care more about throughput or latency and on and on :)
Re:Crystal: Fast as C, Slick as Ruby by rdtsc on Thursday August 04, 2016 @11:16AM (#12226058)
> It's similar to Node in that regard.

No it's not, it is very different from Node. Elixir/Erlang know how to take advantage of multiple CPU cores easily. Node by default doesn't.

Re:Crystal: Fast as C, Slick as Ruby by jsmith0295 on Thursday August 04, 2016 @11:23AM (#12226108)
Well it does, but it still doesn't do it efficiently. That was the only point I was making. But in general, yes, Elixir/Erlang will handle CPU bound tasks better than node whenever they can be effectively parallelized.
Re:Crystal: Fast as C, Slick as Ruby by rdtsc on Thursday August 04, 2016 @01:13PM (#12227018)
> Well it does, but it still doesn't do it efficiently.

Oh interesting. Does it run callbacks on multiple threads? That's new, I haven't followed it for a couple of years.

Re:Crystal: Fast as C, Slick as Ruby by jsmith0295 on Thursday August 04, 2016 @04:58PM (#12228435)
Well what I meant to say is that both JS and Elixir/Erlang aren't very efficient at using CPU resources. Elixir/Erlang does a better job at compensating for this by being able to run many operations in parallel and across different machines, which isn't something you can easily achieve (or should even attempt) with Node.
Re:Crystal: Fast as C, Slick as Ruby by Scarbutt on Thursday August 04, 2016 @02:25AM (#12223768)
I have seen Erlang VM handle 100k requests per second on a distributed cluster

A single JVM server can do that load, scaling and providing fault tolerance for a server that just accepts requests is trivial these days, also, if your requests do computationally intensive stuff you are going to have a very bad time with Erlang.

It all depends on the problem domain.

Exactly, and the domain for Elixir/Erlang is way more niche and specialized than applicable domains of other languages.

I don't have anything against Elixir but part of its crowd just advertises it as the best thing for everything.

Re:Crystal: Fast as C, Slick as Ruby by ken47 on Thursday August 04, 2016 @04:15AM (#12224175)
The Erlang VM (modified) has supported over 2M concurrent connections: https://blog.whatsapp.com/196/1-million-is-so-2011?

Furthermore, assuming each request is mapped to an Erlang process, each of them get their own VM -- no stop-the-world.

Re:Crystal: Fast as C, Slick as Ruby by ken47 on Thursday August 04, 2016 @01:05PM (#12226960)
Correction: I meant to say each of them get their own GC, not VM.
Re:Crystal: Fast as C, Slick as Ruby by RX14 on Thursday August 04, 2016 @06:56AM (#12224692)
Just to add another data point, I've seen crystal do over 100k requests per second on a single desktop core.
Re:Crystal: Fast as C, Slick as Ruby by eggy on Thursday August 04, 2016 @06:15AM (#12224537)
LFE (Lisp Flavored Erlang) is a great alternative to Elixir if you prefer Lisp over Ruby syntax. Pony lang is looking to enter the BEAM/OTP arena with its own implementation of supervisors and such. It is actor-based, OOP and is supposedly very fast in the distributed niche.
Re:Crystal: Fast as C, Slick as Ruby by Scarbutt on Thursday August 04, 2016 @03:10PM (#12227753)
Since I haven't had use cases for the BEAM/OTP, LFE is definitely what's motivating me to finally dive into the whole erlang ecoystem.