Live data from Hacker News

From Ruby to Crystal: A Quick Look

spin.atomicobject.com

1–10 of 44 posts

Re: From Ruby to Crystal: A Quick Look

#3
Outside of speed benefits as compared to ruby, one of the main things going for crystal is it's ability to use all of the robust tooling that already exists. This post mentions it in passing but Crystal gets the benefit of all the existing tooling without having to build it as part of delivering the language to developers. I think that's a huge win. I also think this is one reason why Crystal has grown fairly quickly. This could largely but due to the fact that it's built upon LLVM. Regardless, the community and documentation is pretty awesome. I can't wait to see what happens for the 1.0 release.

Re: From Ruby to Crystal: A Quick Look

#4
Crystal could be a really powerful tool for enhancing existing Ruby code.

Imagine a world where you write your code in Ruby, but farm out the expensive operations to a Ruby-like Crystal extension (similar to what is commonly done with C or Rust). I think this is possible already (just after a quick Google search[1]), just not friendly for the average Ruby dev to implement.

[1] https://www.slideshare.net/AnnaKazakova/how-to-write-ruby-ex...

Re: From Ruby to Crystal: A Quick Look

#5

Crystal could be a really powerful tool for enhancing existing Ruby code. Imagine a world where you write your code in Ruby, but farm out the expensive operations to a Ruby-like Crystal extension (similar to what is commonly done with C or Rust). I think this is possible already (just after a quick Google search[1]), just not friendly for the average Ruby dev to implement. [1] https://www.slideshare.net/AnnaKazakova/…

Neat. Thanks for posting that. Hopefully, that process could be cleaned up and streamlined as a lot of it would be repetitive boiler plate.

Re: From Ruby to Crystal: A Quick Look

#9
post #6

70x faster? If Crystal gets its own port of Ruby on Rails, oh boy.

70x faster, with the caveat that the way that Ruby code is written really does not lend itself to speed.

E.g. using method calls inside the class instead of accessing instance variables instantly springs to mind, as does the "unsorted priority queue" which is basically a horrible abuse of Array but wrapped in a class that makes it even slower by adding additional method calls for every operation.

That's not to diminish the speedup Crystal gets, because it does illustrate how slow MRI's method calls are, but it'd be interesting in seeing a comparison with an astar implementation that was actually written to be fast in Ruby.

Also would be very interesting to see a comparison with jRuby+Truffle, of course.

Re: From Ruby to Crystal: A Quick Look

#10

Crystal could be a really powerful tool for enhancing existing Ruby code. Imagine a world where you write your code in Ruby, but farm out the expensive operations to a Ruby-like Crystal extension (similar to what is commonly done with C or Rust). I think this is possible already (just after a quick Google search[1]), just not friendly for the average Ruby dev to implement. [1] https://www.slideshare.net/AnnaKazakova/…

This is definitely possible-- I've done even more than basic PoC (Anna's slide deck was one of my starting points in fact).

https://github.com/phoffer/crystalized_ruby

Post reply on HN