News for hackers. Stuff that matters.
Re:Crystal: Fast as C, Slick as Ruby by clessg on Thursday August 04, 2016 @01:11AM (#12223512)
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/

[1] http://www.phoenixframework.org/

[2] https://github.com/mroth/phoenix-showdown/blob/master/RESULT...

[3] http://www.phoenixframework.org/blog/the-road-to-2-million-w...

Re:Crystal: Fast as C, Slick as Ruby by acangiano on Thursday August 04, 2016 @01:36AM (#12223614)
Elixir 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.

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.
Re:Crystal: Fast as C, Slick as Ruby by andy_ppp on Thursday August 04, 2016 @05:39AM (#12224423)
Okay 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]}]

Re:Crystal: Fast as C, Slick as Ruby by klibertp on Thursday August 04, 2016 @09:22AM (#12225283)
Hm, 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.
Re:Crystal: Fast as C, Slick as Ruby by clessg on Thursday August 04, 2016 @01:49AM (#12223656)
Oops, 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.
Re:Crystal: Fast as C, Slick as Ruby by continuations on Thursday August 04, 2016 @01:55AM (#12223674)
Is 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=...

Re:Crystal: Fast as C, Slick as Ruby by sanswork on Thursday August 04, 2016 @02:13AM (#12223727)
Chris McCord said the following on reddit after the results came out:

"We don't know what caused the errors and unfortunately we didn't have a chance to collaborate with them on a true run. A few months ago they added Phoenix in a preview, but it was a very poor implementation. They were testing JSON benchmarks through the :browser pipeline, complete with crsf token generation. They had a dev DB pool size of 10, where other frameworks were given of pool size of 100. And they also had heavy IO logging, where other frameworks did no logging. We sent a PR to address these issues, and I was hoping to see true results in the latest runs, but no preview was provided this time and we weren't able to work with them on the errors. tldr; these results are not representative of the framework."

From my personal experience going from Rails/Sinatra to Phoenix it feels a lot faster but I haven't done any benchmarks so take that with a grain of salt.

Re:Crystal: Fast as C, Slick as Ruby by asdf1234 on Thursday August 04, 2016 @06:21AM (#12224568)
Erlang/Elixir is much, much faster than either Python or Ruby especially when it comes to workloads like your typical web app.

In the Techempower benchmarks the Phoenix tests had a ton of errors and there was no preview run so whoever submitted them wasn't able to fix them. Look at the error column. I assume they'll be fixed in the next run.

Re:Crystal: Fast as C, Slick as Ruby by continuations on Friday August 05, 2016 @04:26AM (#12230786)
Error isn't why Elixir performed poorly in the web framework benchmark.

Take a look at the "Single Query" test [1]. The entry for Elli has zero error and is still slower than many Python & Ruby frameworks.

[1]: https://www.techempower.com/benchmarks/#section=data-r12&hw=...

Re:Crystal: Fast as C, Slick as Ruby by clessg on Friday August 05, 2016 @09:06PM (#12236587)
Honestly that site's benchmarks have never been accurate for me in production. But that's how benchmarks work I guess - my bad for bringing up benchmarks! My experience with using Elixir/Phoenix for web applications has been extremely positive performance-wise however, and has surpassed or matched Go, Ruby, PHP, and Python consistently in all production scenarios. For the latter three, the difference has been order-of-magnitude.

It depends on the problem domain as always. If you're doing a lot of naïve single-threaded number-crunching, have fun. But Elixir/Phoenix haven't failed me for web applications, even in very intensive situations. It's the first time I've barely had to do any tuning beyond external factors such as network and database queries (which, by the way, Phoenix's Ecto handles very gracefully and explicitly).

This is my experience with every Elixir/Phoenix app I've worked on thus far. I apologize if I made it sound like some sort of universal truth.

Re:Crystal: Fast as C, Slick as Ruby by rdtsc on Thursday August 04, 2016 @02:06AM (#12223711)
It 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=...

we should all be using Dart on the server coupled with MongoDB perhaps.

Re:Crystal: Fast as C, Slick as Ruby by Scarbutt on Thursday August 04, 2016 @02:15AM (#12223736)
The Dart vm is pretty damn fast, way faster for any CPU bound stuff than the BEAM.
Re:Crystal: Fast as C, Slick as Ruby by igouy on Thursday August 04, 2016 @03:40PM (#12227928)
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."

Re:Crystal: Fast as C, Slick as Ruby by rdtsc on Thursday August 04, 2016 @02:30AM (#12223796)
Faster than C++, Java, Go?
Re:Crystal: Fast as C, Slick as Ruby by duaneb on Thursday August 04, 2016 @02:22AM (#12223758)
I'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.

Re:Crystal: Fast as C, Slick as Ruby by clouddrover on Thursday August 04, 2016 @05:01AM (#12224316)
> 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/

2. https://github.com/SwiftAndroid

3. https://github.com/tinysun212/swift-windows

4. https://swiftforwindows.codeplex.com/

Better cross platform support is a goal of Swift 3.0:

https://github.com/apple/swift-evolution

Re:Crystal: Fast as C, Slick as Ruby by duaneb on Thursday August 04, 2016 @11:41AM (#12226264)
I actually had assumed it was cross platform but there was no reason to use it.

I certainly wouldn't invest my code anywhere near Apple unless that was also my market. Who knows what direction it's moving, aside from in Apple's interest. I'll stick with rust and go: between the two I get everything but easy objective c interop.

Plus, their design decisions with respect to null ability is... Interesting. It's gonna feel gimped by legacy needs for a long time.

Re:Crystal: Fast as C, Slick as Ruby by acangiano on Thursday August 04, 2016 @02:42AM (#12223839)
I 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.

Re:Crystal: Fast as C, Slick as Ruby by duaneb on Thursday August 04, 2016 @03:01AM (#12223900)
Yup, this makes sense. Sorry for the confusion.
Re:Crystal: Fast as C, Slick as Ruby by sundarurfriend on Thursday August 04, 2016 @01:40AM (#12223623)
Elixir 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.

Re:Crystal: Fast as C, Slick as Ruby by rdtsc on Thursday August 04, 2016 @01:53AM (#12223670)
> 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.

Re:Crystal: Fast as C, Slick as Ruby by StavrosK on Thursday August 04, 2016 @06:38AM (#12224631)
"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.

Re:Crystal: Fast as C, Slick as Ruby by iamd3vil on Thursday August 04, 2016 @07:32AM (#12224803)
Elixir 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

Re:Crystal: Fast as C, Slick as Ruby by StavrosK on Thursday August 04, 2016 @01:29PM (#12227118)
Jesus... I saw that page. What I didn't see is the "next" link at the very bottom, right above the footer :( There's a whole bunch of stuff I haven't read! That page should be better designed... I think I also skipped the sentence below "running scripts", the one that says "chapter 2", because I skimmed later and it was just "here's where you can ask questions".
Re:Crystal: Fast as C, Slick as Ruby by nkurz on Thursday August 04, 2016 @03:34PM (#12227892)
I have no involvement in Erlang, but I just looked at that page, and as an outsider I would agree that the navigation could certainly be improved. I think a lot of the problem for me is that there is no distinction between the numbers for "Chapters" and for "Sections", and this confused me as to where I was in the progression.

Maybe using numbers for chapters, letters for sections, and a 1.A notation for the headers? At the least, adding the chapter numbers to the header, so it says "1. Introduction"? Putting the chapter numbers in the URL would help too. So would adding some highlighting in the right column index to indicate the location of the current page.

It seems like fantastic introductory material, but only if people can find it. Usually, the first thing do when I encounter a paginated manual like that is to search for a "single page" or "print" or "PDF" link. Is there one there that I couldn't find? If not, adding one might be a simple (partial) fix.

Edit: If others have more (and better) suggestions, they can be added to the issue I filed here: https://github.com/elixir-lang/elixir-lang.github.com/issues...

Re:Crystal: Fast as C, Slick as Ruby by rdtsc on Thursday August 04, 2016 @11:11AM (#12226022)
Oh sorry to hear that Stavros. Sometimes Erlang knowledge doesn't translate directly to Elixir, there are just a few conventions to keep in mind.

I've used these before when playing with it:

* http://elixir-lang.org/getting-started/introduction.html

* https://howistart.org/posts/elixir/1

* Asking on #elixir-lang on freenode IRC

Here is a specific chapter on distribution and nodes:

http://elixir-lang.org/getting-started/mix-otp/distributed-t...

Their IRC channel, they were pretty helpful for me. And also I am sure they'd want to hear about your experience to also improve their docs and tutorials.

Re:Crystal: Fast as C, Slick as Ruby by StavrosK on Thursday August 04, 2016 @01:31PM (#12227142)
Thanks, the problem was that I didn't notice the rest of the pages on the guide :( I thought there was only the "installation" page.
Re:Crystal: Fast as C, Slick as Ruby by ocean3 on Thursday August 04, 2016 @10:47AM (#12225848)
Elixir has good starting guide. I was able to easily pick up reading from it. Book are further resources to learn.
Re:Crystal: Fast as C, Slick as Ruby by StavrosK on Thursday August 04, 2016 @01:31PM (#12227133)
Thanks, I seem to have missed the fact that there are multiple pages on that guide. Weird, because I saw that page again just now and thought "how is two paragraphs a good guide?" before noticing the contents on the side...
Re:Crystal: Fast as C, Slick as Ruby by geodel on Thursday August 04, 2016 @03:14PM (#12227773)
Yeah, I think Dart is failing and Go is succeeding because of Google backing.
Re:Crystal: Fast as C, Slick as Ruby by eggy on Thursday August 04, 2016 @06:31AM (#12224604)
I have similar feelings about it, but I have chalked them up to the web-dev crowd where there are more numbers of Ruby/ROR devs flocking to it. It has the same uptake as Ruby/ROR did at certain times.

Case in point, LFE (Lisp Flavored Erlang) was created by one of the original designers of Erlang, Robert Virding, has great support for a small FOSS project, true macros, but the popularity of Ruby has rocketed Elixir way ahead in terms of repositories and users. Erlang Solutions has it on the site, but it is not as touted as Elixir. People go with what they know, and let's admit it, Lisp is a great language, but not as popular in the web-dev crowd sans Clojure (which I don't see as so Lispy).

From the early looks of it, having come from industry and academia, Pony lang looks poised to muscle in on Erlang/BEAM/OTP, Elixir and LFE anyway. I personally don't like the syntax, but syntax is not semantics, and you get over it.

Popularity doesn't always win the day if you do something a bit more off the main road, and potential to earn more researching what you love: Look at qdb/k devs and jobs, and Haskell has started increasing in uptake by fintech. Go with what you like, or as Joseph Campbell said, 'Follow your bliss' and the rest will fall into place.

But don't listen to me. I spend many waking moments fiddling with J (jsoftware.com). Not actually the most loved or known PL out there. I think the array languages J/APL/K/Q will have their day due to where software and hardware are heading: Multicores, array processing (GPU/FPGA hybrids, custom computers).

Re:Crystal: Fast as C, Slick as Ruby by sms854 on Thursday August 04, 2016 @01:31PM (#12227134)
> Case in point, LFE (Lisp Flavored Erlang) was created by one of the original designers of Erlang, Robert Virding, has great support for a small FOSS project, true macros

LFE had no documentation, no tools, no learning resources for a really long time. Compare that to Elixir that focused on those aspects since day one. Furthermore, LFE has reached 1.0 only recently, almost 1.5 years after Elixir, and that has an impact on industry adoption.

LFE also was, for a long time, literally Lisp-flavored Erlang while Elixir attempted from the beginning to bring its own abstractions such as protocols, collections, Unicode support, UTF-8 strings, and they are still pushing it forward: http://elixir-lang.org/blog/2016/07/14/announcing-genstage/

So I think you are selling both languages short. There is much more happening in Elixir besides the "popularity of Ruby" and there is a lot of potential in LFE now that they are focusing on being more than a "lispy" Erlang.

Re:Crystal: Fast as C, Slick as Ruby by qaq on Thursday August 04, 2016 @09:10AM (#12225219)
Not sure why people would discuss it in Julia threads,but for Ruby and Crystal >50% of Elixir community came from Ruby so basically it's Ruby devs discussing newer alternatives to Ruby.
Re:Crystal: Fast as C, Slick as Ruby by netghost on Thursday August 04, 2016 @12:08PM (#12226491)
Perhaps it's time to pick a new language to drop in every thread. Something hip and cool, like HyperTalk!
Re:Crystal: Fast as C, Slick as Ruby by tbrooks on Thursday August 04, 2016 @10:48AM (#12225855)
I 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.

Re:Crystal: Fast as C, Slick as Ruby by pqdbr on Thursday August 04, 2016 @01:34AM (#12223604)
I 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.

Re:Crystal: Fast as C, Slick as Ruby by solidsnack9000 on Thursday August 04, 2016 @04:49AM (#12224286)
The biggest practical downside with Elixir relative to Crystal is lack of types. The per-thread GC is an important advantage, though.
Re:Crystal: Fast as C, Slick as Ruby by javiercr on Thursday August 04, 2016 @06:53AM (#12224681)
With pattern matching [1] and guards [2] you often don't miss explicit types.

[1] http://elixir-lang.org/getting-started/pattern-matching.html

[2] http://elixir-lang.org/getting-started/case-cond-and-if.html...

Re:Crystal: Fast as C, Slick as Ruby by iamd3vil on Thursday August 04, 2016 @06:28AM (#12224593)
Elixir has optional typing though. You can type check with Erlang's Dialyzer.
Re:Crystal: Fast as C, Slick as Ruby by bjz_ on Thursday August 04, 2016 @07:24AM (#12224774)
Dialyzer 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.
Re:Crystal: Fast as C, Slick as Ruby by im_down_w_otp on Friday August 05, 2016 @04:17AM (#12230763)
You didn't enable the right flags.
Re:Crystal: Fast as C, Slick as Ruby by bjz_ on Friday August 05, 2016 @05:00AM (#12230881)
What flags?
Re:Crystal: Fast as C, Slick as Ruby by im_down_w_otp on Friday August 05, 2016 @03:22PM (#12235092)
Try 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.
Re:Crystal: Fast as C, Slick as Ruby by bjz_ on Sunday August 07, 2016 @07:24AM (#12241769)
Oh great, thanks! Unfortunate that I missed it. Still no luck on the parametric polymorphism though... :(
Re:Crystal: Fast as C, Slick as Ruby by im_down_w_otp on Sunday August 07, 2016 @02:08PM (#12242955)
That's what Type Variables are explicitly for. They present the necessary semantics for bounded parametric polymorphism. In fact that's really the only reason they exist at all. The rest of the sub-type system works without them, but parametric polymorphism wouldn't work without them.

I don't know if the Erlang/Dialyzer docs cover that specifically, but I know the originial paper on Dialyzer and Dialyzer type specs does.

Re:Crystal: Fast as C, Slick as Ruby by bjz_ on Monday August 08, 2016 @01:03AM (#12245603)
I know you can do stuff like:

    @type pair(t, u) :: {t, u}
    @type result(t, e) :: {:ok, t} | {:error, e}
I'm more talking about type parameters on functions, and also constraining by behaviors and protocols. For example the typespec for Elixir's Stream.map/2 (http://elixir-lang.org/docs/stable/elixir/Stream.html#map/2):

    @spec map(Enumerable.t, (element -> any)) :: Enumerable.t
Note all the other similarly unspecific type definitions. In a parametrically polmorphic lang, you could do something like:

    @spec map[e1: Enumerable, e2: Enumerable](e1.t, (e1.element -> e2.element)) :: e2.t
And perhaps even intersections of behaviours and protocols:

    @spec foo[a: Eq & Ord](a.t, a.t) :: bool
('scuse the Elixir syntax...)
Re:Crystal: Fast as C, Slick as Ruby by lmm on Thursday August 04, 2016 @05:55AM (#12224481)
Is Elixir actually any more mainstream/momentum-having than Crystal? I'd be more inclined to point people to e.g. OCaml.
Re:Crystal: Fast as C, Slick as Ruby by xutopia on Thursday August 04, 2016 @09:49AM (#12225431)
Crystal aims to replace Ruby but at Railsconf and Ruby meetups I go to Elixir/Pheonix is mentioned 100x more than Crystal is.
Re:Crystal: Fast as C, Slick as Ruby by rogerdpack on Thursday August 04, 2016 @10:23AM (#12225704)
I 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 :)
Re:Crystal: Fast as C, Slick as Ruby by iamd3vil on Thursday August 04, 2016 @06:26AM (#12224586)
I 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
Re:Crystal: Fast as C, Slick as Ruby by twistedpair on Thursday August 04, 2016 @11:02AM (#12225941)
Looks 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.

Re:Crystal: Fast as C, Slick as Ruby by rogerdpack on Thursday August 04, 2016 @10:22AM (#12225698)
Apparently it entered the TIOBE list recently, so perhaps it will gain some momentum.