Live data from Hacker News

Show HN: Compile Ruby to C

github.com

1–10 of 110 posts

Re: Show HN: Compile Ruby to C

#3

For practical use, how does this compare to crystal?

Those are probably not for the same use case. Crystal is a whole another language, and you'd have to migrate your whole codebase there. This (in my understanding) is more for compiling certain heavily used functions in your otherwise Ruby codebase to get a quick performance boost.

Re: Show HN: Compile Ruby to C

#4
Looks great - but since you mention you're inspired by Sorbet, why not use their type annotations instead of rolling your own with Rubyspeed::T? (I don't know too much about C, so this might be obvious to some)

Otherwise, I'm excited to try this out. I don't really have any performance-sensitive ruby personal projects, but with time and improvements pushing this to a production-ready state this could be a lifesaver in production for computationally heavy parts of a rails codebase.

Re: Show HN: Compile Ruby to C

#5
post #3

For practical use, how does this compare to crystal?

Those are probably not for the same use case. Crystal is a whole another language, and you'd have to migrate your whole codebase there. This (in my understanding) is more for compiling certain heavily used functions in your otherwise Ruby codebase to get a quick performance boost.

Doesn't the new ruby JIT already do the same thing?

Re: Show HN: Compile Ruby to C

#6
post #3

Earlier quoted context omitted.

Those are probably not for the same use case. Crystal is a whole another language, and you'd have to migrate your whole codebase there. This (in my understanding) is more for compiling certain heavily used functions in your otherwise Ruby codebase to get a quick performance boost.

Doesn't the new ruby JIT already do the same thing?

I haven't looked into the new ruby JIT too deeply, but as far as I remember it had several limitations that made it slow Rails apps down instead. This would make it easier to select and optimise for specific methods instead.

Re: Show HN: Compile Ruby to C

#7
post #3

Earlier quoted context omitted.

Those are probably not for the same use case. Crystal is a whole another language, and you'd have to migrate your whole codebase there. This (in my understanding) is more for compiling certain heavily used functions in your otherwise Ruby codebase to get a quick performance boost.

Doesn't the new ruby JIT already do the same thing?

Yeah, this is pretty much how the JIT works.

Re: Show HN: Compile Ruby to C

#8
post #3

Earlier quoted context omitted.

Those are probably not for the same use case. Crystal is a whole another language, and you'd have to migrate your whole codebase there. This (in my understanding) is more for compiling certain heavily used functions in your otherwise Ruby codebase to get a quick performance boost.

Doesn't the new ruby JIT already do the same thing?

Current Ruby JIT doesn't take any type hint.

Re: Show HN: Compile Ruby to C

#9
I'm sad Ruby has been, or is, left behind by python. There are lots of little reasons but no real big one. I just love ruby. I love little things like 'unless'. I know it's still with us, but still feels a little sad.

Re: Show HN: Compile Ruby to C

#10

I'm sad Ruby has been, or is, left behind by python. There are lots of little reasons but no real big one. I just love ruby. I love little things like 'unless'. I know it's still with us, but still feels a little sad.

While I feel sad too, I think the primary reason why it imploded under its own weight was the "magic". I still love Ruby, for all its developer friendliness and the consistency of its idioms. But too much of that sugar leads to bloat, that requires a bunch of hair-pulling for newbies to grok.

Now of course, there exist other simpler frameworks (a la sinatra), but when your posterchild is a thing like Rails, you can't expect people to not be burnt in the long term and still come back.

Post reply on HN