9 ms·
Looks very nice. I hope it gains momentum. For now, if you want a fast language with the beauty and productivity of Ruby, check out Elixir [0] and its web fram
by clessg 10y ago
Looks very nice. I hope it gains momentum.
For now, if you want a fast language with the beauty and productivity of Ruby, check out Elixir [0] and its web framework, Phoenix [1]. I've been using Phoenix for a year, and it's the first framework that I've actually liked more over time. And I've been a web developer for a decade. With its recent 1.0 release, Phoenix is gaining a lot of momentum.
If you want some idea of the performance differences between Phoenix and Rails, see [2] and [3].
[0] http://elixir-lang.org/ http://elixir-lang.org/
[1] http://www.phoenixframework.org/ http://www.phoenixframework.org/
[2] https://github.com/mroth/phoenix-showdown/blob/master/RESULTS_v3.md https://github.com/mroth/phoenix-showdown/blob/master/RESULT...
[3] http://www.phoenixframework.org/blog/the-road-to-2-million-websocket-connections http://www.phoenixframework.org/blog/the-road-to-2-million-w...
- pqdbr 10y agoI code in Ruby for about 4 years now, and Elixir still doesn't seem easy for me to get started with. Crystal, on the other hand, is as if I'm writing Ruby.
- acangiano 10y agoElixir is not a fast language. Not even close. Yes, it handles concurrency and parallelism beautifully which in turn enable distributed applications to perform quite well. But the language itself is significantly slower than Crystal / Rust / Go / Swift. It's not in the same category at all. That said, it's a great language worth recommending.
- clessg 10y agoOops, you're right that Elixir is not a computationally fast language. If you're looking for fast, raw number-crunching, look elsewhere. That said, real-world performance tends to be extremely good for real-time and networked applications (read: web apps). It's common for requests to be handled in microseconds, even in development.
- continuations 10y agoIs Elixir really fast for web apps though? According to the web framework benchmark [1] the performance of Elixir is pretty bad - it's consistently slower than python and ruby frameworks. [1] https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=fortune https://www.techempower.com/benchmarks/#section=data-r12&hw=...
- rdtsc 10y agoIt is hard to say how they measure and what they measure. According to their "multiple queries" benchmark, which I guess is the real world one? (Unless everyone expects all custumers to line up and send their requests one after another one). https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=query https://www.techempower.com/benchmarks/#section=data-r12&hw=... we should all be using Dart on the server coupled with MongoDB perhaps.
- Scarbutt 10y agoThe Dart vm is pretty damn fast, way faster for any CPU bound stuff than the BEAM.
- rdtsc 10y agoFaster than C++, Java, Go?
- igouy 10y agohttp://benchmarksgame.alioth.debian.org/u64q/compare.php?lang=dart&lang2=hipe http://benchmarksgame.alioth.debian.org/u64q/compare.php?lan... as-in FAQ 1.4 "What sort of problems is Erlang not particularly suitable for? … The most common class of 'less suitable' problems is characterised by performance being a prime requirement and constant-factors having a large effect on performance. Typical examples are image processing, signal processing, sorting large volumes of data and low-level protocol termination."
- sanswork 10y ago
- rdtsc 10y ago> 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.
- Scarbutt 10y agoI 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.
- ken47 10y agoThe Erlang VM (modified) has supported over 2M concurrent connections: https://blog.whatsapp.com/196/1-million-is-so-2011 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.
- ken47 10y agoCorrection: I meant to say each of them get their own GC, not VM.
- eggy 10y agoLFE (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.
- duaneb 10y agoI'm not sure why you're grouping those four languages as they overlap very little. Go has latency and emphasizes network bound services (and randomly docker for some reason, I'm sure a good one); rust is a c replacement; swift is for writing iOS/Mac apps; and crystal is a newborn. I'd actually call it quite close to go: a high emphasis on concurrency and services. Single thread performance matters much less when scaling horizontally is mandatory to smooth latency spikes, and I'm betting on io bound work erlang would be competitive with go. I've never used elixir but I assume it has a similar performance profile to erlang as it shares the vm.
- acangiano 10y agoI listed a few examples of emerging languages to clarify that Elixir is not in the same class when it comes to computational performance on a single machine. The performance profile is indeed Erlang-like. Keep also in mind that my reply was within the context of a thread on Crystal. OP sort of sold Elixir as a fast language that we can use now while we wait for Crystal to mature. My point is not that Elixir is useless. My point is that we must not oversell Elixir as a fast language. Generally speaking, it isn't. It excels at horizontal scaling, which is great, but I wouldn't call it "fast" without proper qualifiers.
- duaneb 10y agoYup, this makes sense. Sorry for the confusion.
- clouddrover 10y ago> swift is for writing iOS/Mac apps I think that's a little simplistic. It's true that it's early days for cross platform Swift but clear progress is being made: 1. https://swift.org/download/ https://swift.org/download/ 2. https://github.com/SwiftAndroid https://github.com/SwiftAndroid 3. https://github.com/tinysun212/swift-windows https://github.com/tinysun212/swift-windows 4. https://swiftforwindows.codeplex.com/ https://swiftforwindows.codeplex.com/ Better cross platform support is a goal of Swift 3.0: https://github.com/apple/swift-evolution https://github.com/apple/swift-evolution
- andy_ppp 10y agoOkay so the given example where on my machine elixir does the calculation of the the fibonacci number in 12.25s but if you add in HiPE and compile to native code in that module it's much closer to crystal than you might expect at 3.34s. Not bad really for a language that's meant to be slow at computational stuff :^) @compile [:native, {:hipe, [:verbose, :o3]}]
- klibertp 10y agoHm, what about HiPE and ability to natively compile Erlang modules? That's pretty solid technology by now (I think?) and it promised some good results last time I checked. Honestly asking - I did quite a few things with Erlang and a little less with Elixir, but never even tried to use them for raw speed, instead delegating number crunching to other processes via ports.
- sundarurfriend 10y agoElixir gets plugged so often in other-language threads - whether it's Julia or Ruby or, like here, Crystal - that if it wasn't FOSS I'd have decided it's being astroturfed. I guess it's a good thing that people like it so much, but it's really starting to feel marketing-y by now.
- rdtsc 10y ago> that if it wasn't FOSS I'd have decided it's being astroturfed. That's a good sign! You know why? Because it has a great community and is very friendly for new comers. Jose, Eric and the rest of the team made that a priority and it shows. It doesn't just mean being nice on IRC, it also means putting usability first, putting more effort in how example looks, how documentation looks and so on. If Google invented a language then proceed to push and sponsor it, by paying authors to work on it, organizing marketing, hackathons etc, then it is hard to say if it popular because of Google's backing or because it has its own merits.
- StavrosK 10y ago"Friendly for newcomers"? I tried to write something the other day, and had an Erlang developer friend to help me. The Elixir docs section just says "buy one of these books to get started", which is completely unacceptable, and we (mostly my friend, as I had no idea what anything is) spent an hour trying to figure out how to run a node, with Google not providing any useful answers. That's as hostile to newcomers as it gets. Contrast this with the Rust book, that gets you from "I have no idea how anything works" to "hey I just wrote a small program!" in a few minutes.
- iamd3vil 10y agoElixir has a very good getting started guide[0]. I don't know if you have seen this or not. Even in the learning section, it recommends going through the getting started guide. It mentions other books in other resources. I don't know why you think it's hostile to new comers. I learned Elixir totally from Getting started guide and then the documentation. Then for OTP, I have read an Erlang book to understand it well. Elixir's documentation is really awesome and one of the best I have seen. [0] - http://elixir-lang.org/getting-started/introduction.html http://elixir-lang.org/getting-started/introduction.html
- lmm 10y agoIs Elixir actually any more mainstream/momentum-having than Crystal? I'd be more inclined to point people to e.g. OCaml.
- iamd3vil 10y agoI don't know if Elixir is mainstream or not, but there are a lot of companies using Elixir in production (including the company I work for). You can find the list of companies at https://github.com/doomspork/elixir-companies https://github.com/doomspork/elixir-companies
- xutopia 10y agoCrystal aims to replace Ruby but at Railsconf and Ruby meetups I go to Elixir/Pheonix is mentioned 100x more than Crystal is.
- rogerdpack 10y agoI don't think it aims to replace ruby (they don't even claim any kind of "compatibility" level with ruby, more like "inspired by ruby" I would think), but...I wish it would replace it :)
- solidsnack9000 10y agoThe biggest practical downside with Elixir relative to Crystal is lack of types. The per-thread GC is an important advantage, though.
- iamd3vil 10y agoElixir has optional typing though. You can type check with Erlang's Dialyzer.
- bjz_ 10y agoDialyzer uses success types, which don't always let you know when you have a soundness problem. The only thing you can count on is that if it does cry out, there certainly is something you need to fix. It also lacks parametric polymorphism, which means you often lose a great deal of useful type information. The theory behind Dialyzer is impressive, but I was pretty disappointed with it in practice.
- im_down_w_otp 10y agoYou didn't enable the right flags.
- bjz_ 10y agoWhat flags?
- im_down_w_otp 10y agoTry using Wunderspecs, Woverspecs, and Wspecdiffs. You'll find that dialyzer catches things that are more the shape of what you'd accept a more typical type-checking system to catch.
- bjz_ 10y agoOh great, thanks! Unfortunate that I missed it. Still no luck on the parametric polymorphism though... :(
- rogerdpack 10y agoApparently it entered the TIOBE list recently, so perhaps it will gain some momentum.
- tbrooks 10y agoI don't have a CS background, so I can't speak much to the performance of Elixir and Crystal. As someone who has made the transition from Ruby to Elixir, I'm really, really intrigued by Crystal. Though, upon a cursory look into the Crystal docs and community, a couple things are clear... Elixir killed it on all the things surrounding the language. - docs - testing - Slack chan, IRC, mailing list - package manager (Hex) - build tool (Mix) - web framework (plug & Phoenix) - books from major publishers (manning, pragprog, etc.) - ElixirConf - ancillary teaching (ElixirSips, LearnElixir, Elixir Fountain, etc.) While the language may not be as computationally performant as some of others mentioned, all the things above lower the barrier to entry for adoption and make Elixir a more attractive language than some of the counterparts. And it's amazing that a language this young has nailed it on these fronts.
- twistedpair 10y agoLooks like Play! took #2. I can attest to it's efficiency. Just yesterday one of our mobile apps went nuts with repeating requests, and rps shot to 53K for a few minutes, but no one noticed, as our API max response time didn't break 15ms. JVM+FP FTW.