6 ms·
Anyone using Crystal in production? What do you use it for?
by sergiotapia 8y ago
Anyone using Crystal in production? What do you use it for?
- sdogruyol 8y agoWe use Crystal at RainforestQA to replace our heavy-load / slowish Ruby microservices. It's been great so far and we love it. We're also increasing the adoption to Crystal inside the organization. Also Crystal has a dedicated a wiki page for production users Used in production: https://github.com/crystal-lang/crystal/wiki/Used-in-production https://github.com/crystal-lang/crystal/wiki/Used-in-product...
- abritinthebay 8y agoInteresting! I’m surprised you didn’t move to Elixir given the syntax similarities to Ruby
- RussianCow 8y agoElixir would probably not have been a huge improvement over Ruby if they switched languages for performance reasons. Elixir is great for many things, but raw number-crunching performance is not one of them.
- RX14 8y agoWhile elixir's syntax is inspired by ruby, the semantics are vastly different. That change in semantics is really good for elixir, because it means it can take advantage of the unique properties of the erlang vm, but it's worth noting that crystal is far far closer to ruby than elixir. For better and for worse.
- pmontra 8y agoThe syntax similarities between Elixir and Ruby stop as soon as one moves on from reading short blog post to writing real code. They are extremely different languages. Knowing Ruby helps only to remember the names of some standard library modules and functions, which were designed on purpose to match the name of the corresponding Ruby modules and methods, but not all of them. A vanilla example: $ iex > "1 2 3" |> String.split |> Enum.map(fn x -> String.to_integer(x) * 2 end) [2, 4, 6] $ irb > "1 2 3".split.map {|x| x.to_i * 2} [2, 4, 6] which by the way highlights the extra verbosity of Elixir compared to Ruby. It's less verbose on more complex examples, mainly because of pattern matching, but the proof would be too long for this reply.
- andyfleming 8y agoKotlin syntax: "1 2 3".split(' ').map { it.toInt() }
- yxhuvud 8y agoYour example doesn't do the same thing. The same as grandparent, in crystal: "1 2 3".split.map &.to_i.*(2)
- andyfleming 8y agoWhoops, you're right. "1 2 3".split(' ').map { it.toInt() * 2 }
- pmontra 8y agoI believe that Ruby also has that & shortcut (or similar) but it's totally unreadable. I never used it and I don't even want to check the exact syntax. Is it the only way it works in Crystal?
- yxhuvud 8y agoIt being readable is a matter of getting used to it. I find it more readable than the block version as there is less syntactic boilerplate. YMMV. Ruby has a similar version using colon instead of dot but that version isn't chainable and doesn't take arguments so it can't do the *2. And no, you can write out the full block just as you did in the Ruby version.
- abritinthebay 8y agoI hear this a lot but I keep seeing more and more Ruby devs moving to it trivially and as someone who reads-not-writes Ruby code I find it just as trivial to grok it. So I think the differences are there but they’re being overstated from a transfer of skills standpoint.
- pmontra 8y ago
- MaxBarraclough 8y agoWhat drew you to Crystal? If you'll forgive the snark, you've moved from one obscure language, to an even more obscure language that even fewer developers know. What is it about Crystal that outweighs the very boring practical downsides of production use of obscure and immature languages?
- nlh 8y agoI think many tens-of-thousands of developers would not agree that Ruby is obscure.
- rhencke 8y agoHow is Ruby an obscure language...? Their developers are already proficient in Ruby. Crystal is a very, very close cousin of Ruby, syntactically and structurally. This isn't like jumping from Java to Haskell.
- MaxBarraclough 8y agoI didn't know it was that similar. Neat idea for a language. The 'Boo' language does the same for Python.
- AsyncAwait 8y agoI'd say Nim is for Python what Crystal is for Ruby.
- MaxBarraclough 8y agoOn closer inspection I agree - hadn't realised Boo uses the Common Language Infrastructure.
- RX14 8y agoProbably because they loved the language. Humans are humans, and not everything is made with a rational financial decision. If you use the language, and like ruby and static typing, you'll find that there's a lot to love.
- k3liutZu 8y agoLet's make this more generic: Anyone using Crystal? What do you use it for?
- sergiotapia 8y agoI'm specifically interested in production settings, not toy projects. Using something in production is much more interesting.
- rkeene2 8y agoI do. I run a service called "HashCache" which caches resources by hash ( http://hashcache.rkeene.org/ http://hashcache.rkeene.org/ ). I use this as a central cache for build scripts which download resources from the Internet, and the upstream/origin server may go away. I wrote a version in Crystal (v0.10, I think) and Tcl to compare the two: Crystal: https://chiselapp.com/user/rkeene/repository/hashcache/artifact?ln=on&name=4af78cf4e694fa94 https://chiselapp.com/user/rkeene/repository/hashcache/artif... Tcl: https://chiselapp.com/user/rkeene/repository/hashcache/artifact?ln=on&name=5f7d01b159b7b5c9 https://chiselapp.com/user/rkeene/repository/hashcache/artif...
- rishav_sharan 8y agoI am making a simple bloggy webapp with Crystal.
- Thaxll 8y agoI'm not sure why anyone would actually use it in the current state, unstable, lack of libraries, lack of community and the biggest problem no multi-threading / windows support
- asterite 8y agoYou could basically say the same about any language. Just switch the descriptions. For example: C#: verbose, magical dependency injection, Microsoft, etc. Ruby: slow Go: ugly syntax, verbose, if err != nil, etc. If a language works for you I see no reason not to use it :-)
- benbristow 8y agoRuby's getting much faster now with recent speed improvements, JIT and recent developments by the TruffleRuby team
- crystalnewb 8y agoFor the thrill man! If it doesn't have a library you need you create it yourself. Eventually enough people who have the skill to contribute will become interested in Crystal and contribute a library, then one day crystal will replace java. In all seriousness, other than the multithreaded windows support, which libraries are missing?
- sam0x17 8y agoFor sure. I've had a lot of fun getting to be the person to create some basic libraries for things like image manipulation and an ORM for mongodb when I find no one else has done that yet. One big thing that is missing still is full google cloud platform and AWS libraries. There is an s3 connector but I think it's out of date.
- nlh 8y agoI know you’re (effectively) trolling here, but there are many reasons to “actually” use it. The community is great and helpful (check out the Gitter activity if you have any question about that). Lack of Windows support (for now) doesn’t matter if....you don’t use Windows. Multi-threading is being worked on. You’re rehashing the same 2 things many folks point out that Crystal is missing in its pre-1.0 state and while they’re obviously important for widespread adoption, they’re not reason in and of themselves to dismiss a language that’s otherwise super interesting to many.
- 33degrees 8y agoI'm planning on trying it to replace some Ruby code that updates our elasticsearch index in a background job. It's currently slow and memory hungry and crystal's similarity to Ruby should make it easy to port.
- sam0x17 8y agoAt BlockVue we use crystal for v2 of most of our core infrastructure (the old version of our app is Rails-based), and we also use crystal heavily in Google Cloud Functions via our gcf.cr (open source) tool. So mainly we use amber and gcf.cr in conjunction with one another. We host everything on Google App Engine and GCP.
- xiljin 8y agoWe're currently using Crystal 0.25.1 with the Kemal web framework to provide an online paycheck calculator for US based employees (it's basically a demo/tool for our SaaS based accounting, payroll and fund raising app). Really impressed with the language so far and hope to expand its use within our organization.
- sdogruyol 8y agoI'm the creator of Kemal, glad to see that you're liking it :)