5 ms·
Crystal is nearly at 1.0 and seems way faster than Ruby in addition to having a Ruby like syntax, i'd suggest you take a look at it, promising stuff there. htt
by yannoninator 6y ago
Crystal is nearly at 1.0 and seems way faster than Ruby in addition to having a Ruby like syntax, i'd suggest you take a look at it, promising stuff there.
https://crystal-lang.org/ https://crystal-lang.org/
edit: did i win the fastest comment to the bottom on hn? what do I get?
jokes aside, care to explain why folks?
In all seriousness, the results speak for themselves, when comparing to Ruby in terms of speed.
https://github.com/kostya/benchmarks https://github.com/kostya/benchmarks
https://github.com/kostya/crystal-benchmarks-game https://github.com/kostya/crystal-benchmarks-game
https://github.com/the-benchmarker/web-frameworks https://github.com/the-benchmarker/web-frameworks
- rezonant 6y ago> edit: did i win the fastest comment to the bottom on hn? what do I get? downvoted, apparently. As a Rails dev though, Crystal does look very promising, and as a Typescript dev, it has optional strong typing with a syntax that is much, much more appealing than RBS.
- ativzzz 6y agoLike the blog post says, people have already made their minds up about whether or not Ruby is fast enough for them, and incremental speed upgrades, or even faster languages like Crystal that market themselves as Ruby-like are irrelevant in this decision process. For the majority of us who use Ruby, we use Rails, and Rails is great. Crystal is irrelevant as a comparison to Ruby, because there is no Rails (I'm sure there's web frameworks, but they're not nearly as productive as Rails). Rails isn't perfect, and there's plenty of room for improvement, but switching languages and starting from scratch isn't the solution. The biggest downside of Ruby compared to other languages (besides speed, but like I said, that doesn't matter here), is lack of static typing. That may or may not be a problem depending on your usecase.
- yannoninator 6y ago> Crystal is irrelevant as a comparison to Ruby, because there is no Rails. I wouldn't say it's irrelevant, Crystal is already being used by ex-Rubyists and the ecosystem of crystal libraries are being built by them as well. After 1.0 you would see more of this happening. Lucky [0][1] by Thoughtbot is the closest to Rails in the Crystal world. > The biggest downside of Ruby compared to other languages (besides speed, but like I said, that doesn't matter here), is lack of static typing. That may or may not be a problem depending on your usecase. Then I shouldn't see any complaints about speed on Ruby if it doesn't matter, Crystal solves all of this built in, with the trade off of slower build times, but then again Rust also has slower build times as well. But to each their own. [0] https://luckyframework.org/ https://luckyframework.org/ [1] https://github.com/luckyframework/lucky https://github.com/luckyframework/lucky
- nerdponx 6y agoI suppose it's because Crystal isn't Ruby, and it's also a statically-typed ahead-of-time compiled language. Which, despite having similar syntax (and a lot of other positive aspects), make it very different from Ruby. I'm not sure "Ruby but faster" is the point. I'd argue that it's more "cool new language that should be comfortable for anyone already familiar with Ruby".
- cutler 6y agoIt's odd how Elixir gets plenty of mind-share amongst Rubyists despite only surface similarities yet Crystal has a hard time gaining any traction when it's virtually a statically typed Ruby clone.
- jeremy_k 6y ago> a statically typed Ruby clone Could be that. I've used Ruby for 10 years, I'm just used a dynamic language. I also dealt with a typed Javascript monorepo and it was not very fun to deal with when the types weren't working for whatever reason.
- vidarh 6y agoThe thing is, it's not a clone. The similarity is skin deep. Elixir never pretended to be anything it wasn't, but many pushed Crystal hard as a clone, and I think that has produced some resentment.
- ttt0 6y agoI tried it out at some point, and it's a nice language I guess, but man, the compile times. It's not worth it, just learn C or C++.
- yannoninator 6y ago> It's not worth it, just learn C or C++. And your productivity on your team plummets as a result. Rust also has slow build times [0], but it didn't stop people from using it. [0] https://pingcap.com/blog/rust-compilation-model-calamity https://pingcap.com/blog/rust-compilation-model-calamity
- metreo 6y agowell.. certainly it has stopped 'some' people from using it though for many the compilation costs are worth it
- yannoninator 6y ago> for many the compilation costs are worth it If the rust syntax and borrow checker wasn't masochistic enough...
- ttt0 6y agoIf compiling 7 lines of code in release mode takes few minutes in Rust, just like it does in Crystal (I don't know exactly how long, I got bored and gave up, so it's possibly more), then I wouldn't touch that language with a ten foot pole either. It's fine to make trade-offs, it's just not a trade-off I'm personally willing to make. As to the productivity thing, it's debatable I guess.
- ricardobeat 6y agoIt doesn't, a few seconds in debug mode, maybe 10-15s for release. I actually have a couple scripts that use `crystal run` instead of a compiled binary.
- natchy 6y ago
- vinceguidry 6y agoGetting sick of people pumping Crystal in every single Ruby posting. Just stop.
- yannoninator 6y agoThe title of this post is complaining about Ruby's speed, and it only makes sense to provide an alternative solution. It's good for people to know of alternatives. So, No.
- ketamine__ 6y agoCrystal has a similar syntax. Does anyone else hate macros?
- vinceguidry 6y agoThis argument has always confused me. Syntax is not, and never was, the point or beauty of Ruby. The semantics, deriving from the pure object model, are. Crystal's object model is just light years away from Ruby's. I suppose if one has never really achieved much proficiency in Ruby then they can be equated. Personally, I'd sooner code in Go than in Crystal. The tooling is way better. Mruby however would be my first choice for "Ruby but with compilation." http://mruby.org/ http://mruby.org/ If that won't work, then I'm looking to Go next.
- vidarh 6y agoSyntax very much matters to the Ruby community. Or we'd all just have used Smalltalk, which has near the same object model. A pretty syntax on top of a clean object model is a key selling point of Ruby. I agree with you about Crystal though. No interest in it.
- shirro 6y agoIt is the same in any language post here or on reddit. Language designers all optimise for different needs and if they find an audience they are doing something right for someone even if it isn't you.
- deleted 6y ago[deleted]
- vidarh 6y agoCrystal is schizophrenic. It was for a long time pushed by people as a faster Ruby, but it's diverged in seemingly pointless ways, to the point where the similarity is not very interesting. If I was to migrate away from Ruby, Crystal would not be a candidate.