Does anybody have any experience with running Crystal in production?
I was just looking at Crystal the other day!
I thought this was a pretty good post about it and how it differs to Ruby: http://crystal-lang.org/2013/11/14/good-bye-ruby-thursday.html
Iām also surprised more people are not talking about it - it seems to be the closest thing to Ruby out there (that isnāt an official AltRuby)
If anybody is interested in current state of web frameworks in crystal.
Found these 2:
GitHub - manastech/frank: A small Sinatra clone for Crystal - Sinatra inspired
https://github.com/Codcore/Amethyst - Rails inspired
Nice find @tak1n!
Wonder if anyone has done any speed comparisons yet?
For the language itself, I think the creators made some benchmarks showing the performance against ruby etc.
The language itself is faster than ruby because itās compiled.
Also found this benchmark: GitHub - kostya/benchmarks: Some benchmarks of different languages
For the webframeworks I think manastech (the company behind crystal) is using frank for some of their apiās in production.
Thanks Benny - some interesting results thereā¦ Crystal sure is fast!!
Wonder where Elixir would be in itā¦
You may find this interesting regarding Crystal:
Differences from Ruby?
Nice one George. There are more differences in the link I posted (in post #2 - though I guess youāve read it already).
I think itās definitely worth keeping an eye on
I just watched this.
PolyConf 15: An Introduction to Crystal / Erik Michaels-Ober
I like that it runs/compiles Ruby code. ā¦ and itās faster then ruby considerably.
Great talk that - wonder how it compares to Elixir.
Good to see Soundcloud using it
There are some good comments about Crystal here: https://www.reddit.com/r/programming/comments/30symw/crystal_rubyinspired_compiled_language/
Is this better in performance than Elixir?, besides Elixir compiles to BEAM and Crystal to LLVM, what are other advantages?.
asterite:
We donāt have benchmarks against Elixir nor Erlang, so I canāt say anything about the performance. But since Crystal compiles to native code and Erlang/Elixir runs in a VM, my guess is that Erlang/Elixir is slower. But this is just a guess, and Iām sure in some benchmarks Erlang/Elixir will win, in others Crystal will win. But benchmarks arenāt very useful, real programs and how they behave is what matters.
One advantage of Crystal is that it is statically compiled. That means that you canāt have type errors. If I write a program 1.length I wonāt be able to make an executable out of it, it wonāt compile. In Elixir I can have String.length(1) in some part of my code, and I can have that running and as long as that path isnāt visited at runtime everything will be fine. But when it is visited, boom, error.
At least I feel this personally, but when I program in a dynamic language, unless I test everything, everything, I canāt be sure I wonāt have an āundefined method āxā for SomeTypeā at runtime, or some silly mistakes. With Crystal you canāt have these silly mistakes, which gives you a lot of confidence when your program compiles, and makes it easier to refactor your code, even if you donāt have tests for everything. Of course you can have type casts fail at runtime, like in other languages, but these are explicit and less often.
Another advantage is that it doesnāt need a VM. You compile the executable and thatās all you need (plus dynamic libraries if you use them). With Erlang you need to distribute the .BEAM but have the Erlang VM in that machine.
Yet another advantage is that thereās no VM boot time, so Crystal is ideal for writing command-line interfaces.
Of course dynamic languages have advantages too, you have to choose the right tool for the right job
I would love to see some comparable benchmarks with Elixir - could be a huge selling point for either language as I think both languages will appeal most to Rubyists.
Hi! ,I list up where the Crystal communities are, and more information about Crystal Lang
Have fun with Crystal!
Thanks for adding us @yahhonob
I tried the default http server (the API seems awesome and the language feels fast)
the starting time and request per second
i havent watched at the memory and cpu stats but itās fast
ābenchmarkā mbp retina
go app in prod with some code in it
36k
crystal default http server
http://crystal-lang.org/docs/overview/http_server.html
36k
linux ruby 2.1.6 (previous stable)
server puma (I will make a test on 2.2.2 unicorn too)
rack / roda (micro-framework like sinatra, improved routing and as lightweight as a rack app)
20k
sinatra hello world
5k
rails
i donāt want to know - oh my activesupport - rails with actioncontroller::metal as default controller should go faster but not fast enough, you should unload activesupport from rails-api - Lotus maybe?
Hoop - build native Mac apps with Crystal
Opinionated post about Crystal/Ruby
This video has some good information.
Ary Borenszweig & Juan Wajnerman - Crystal: a programming language for humans & computers - Curry On
This Christmas eve something curious happened: we were happily coding in Crystal when, one moment when we took our eyes away from the screen, a translucid figure appeared nearby. The entity approached and said: āIām the Ghost of Christmas Past. Come with me.ā
We saw ourselves coding a new language that would resemble Ruby but be compiled and type safe. At that moment the language was really like Ruby: to create an empty Array you would write , or Set.new to create an empty set. And we were happy, until we realized compile times were huge, exponential, unbearable, and got sad.
We spent an awful time trying to make it work with no avail. Finally, we decided to make a change: speficy the types of empty generic types, for example of Int32 or Set(Int32).new. Compile times were back to normal. And we were kind of happy again, but at the same time felt that we were leaving behind some of Rubyās feeling. The language diverged.
We looked back at the Ghost of Christmas Past to ask him what did all of that mean, but we found a similar but different figure in its place. She said: āIām the Ghost of Christmas Present. Join me.ā
There was a thread some time ago in crystalās google group regarding itās usage in production
https://groups.google.com/d/msg/crystal-lang/fXTAMilSo_Q/lMxM46mACgAJ