TruffleRuby is now the first implementation besides CRuby to pass all of the 2180 #RubyGems' tests, no exclusions!
https://github.com/rubygems/rubygems/pull/2797#issuecomment-626150446
Hopefully we are much much closer to running Rails.
6
u/taw May 12 '20
What kind of weird things is Rails doing that makes it so hard to run?
3
u/chrisgseaton May 12 '20
It's not so much Rails, but Rails applications. They just involve an absolute mountain of code. If there's a bug here or there in TruffleRuby for so many lines of Ruby code, you end up with a lot of bugs trying to run a Rails application. Also at this point the bugs are getting pretty subtle.
2
u/ksec May 12 '20
I am waiting for the next GraalVM and TruffleRuby release, hopefully then I can drum up some noise within the community and gain valuable feedback to help.
11
u/faitswulff May 12 '20
Last I heard, a lot of metaprogramming.
7
u/zitrusgrape May 12 '20
sometimes i I feel that rails is 90% metaprogramming and rest is tests /s
6
u/chrisgseaton May 12 '20
sometimes i I feel that rails is 90% metaprogramming
This is why I hope TruffleRuby will succeed. TruffleRuby is *excellent* at optimising metaprogramming above all else.
2
u/zitrusgrape May 12 '20
will be truffleruby ready to be used next year?
16
u/chrisgseaton May 12 '20
We've got a major application at Shopify running on it. It still needs tuning, but we're making it work.
3
1
u/jeeperbleeper May 12 '20
Interesting. What are some of the issues you’re facing?
2
u/chrisgseaton May 13 '20
Just working at scale really. It's a lot of code - it's hard to understand how it should be optimising.
10
u/arcticblue May 12 '20 edited May 12 '20
And 70MB of Javascript now. I was floored when I saw how many JS dependencies it pulled in these recent versions of Rails. I just can't wrap my head around how web development got to this point where we have frameworks for frameworks to put some Javascript together for a Ruby framework. I miss the days of just adding what I need in a <script> before people decided the DOM needed to be reinvented in Javascript (I still cling to the idea of progressive enhancement). I didn't think Sprockets was all that bad either. Nowadays, 70MB of dependencies to put together a few hundred KB of Javascript... I like the simplicity of developing in Rails and the new JS stuff just seems to clash with that. I'm sure I'll warm up to it all eventually though, but I'll still miss the simpler days.
4
May 12 '20
Yeah I kinda agree. I think you can just cancel Webpack and stick to sprockets no? But honestly, eventually you will run into projects that use "modern" js there's just no escaping it.
2
u/jrochkind May 12 '20
I think sprockets days are numbered -- its been having a maintenance deficit for literally years, and has been receiving not much attention again lately.
I'd switch to webpacker if I were you. Which, I find hard to use too, but if you want any third-party JS dependency at all, odds are it's available as an npm package, and webpacker is pretty much your option, so i'm super glad it exists, and reluctantly acknowledge it's the right direction for Rails. The JS ecosystem is kind of insane, but it's still the right call for Rails to integrate with it more than try to reinvent it.
1
May 13 '20
and reluctantly acknowledge it's the right direction for Rails
yep. pretty sure that's what dhh was thinking, I'm certain he would prefer to just keep it simple with sprockets but he realised keeping up with the front end beast is too much of a hassle.
1
u/jrochkind May 13 '20 edited May 13 '20
It's not just that it's a "hassle", it just doesn't make any sense at all. People need to use npm dependencies, and they need to use toolchains like babel (sometimes because the npm dependencies require it).
It wouldn't make any sense to say the "Rails way" is not interacting with any of the existing front-end JS ecosystem, just not to use those dependencies; they kind of tried implying that for some years, but it wasn't flying and wasn't serving developers. And it makes no sense to try and re-invent an entirely separate toolchain to do these things, especially when the existing sprockets was already barely getting enough maintenance resources (thanks to heroic efforts of schneems who rescued it from abandonware status, but it was stagnating, one person, who has other interests, is not enough).
2
May 13 '20
Here's my problem: it is a bit ridiculous to keep both Sprockets and Webpack. I mean great, now new people in the framework need to learn both? The "Rails Way" is to try to streamline development and make the amount of concepts you need to understand minimal (for example, by not developing a SPA but a normal server rendered app with some js sprinkled on top). It's supposed to be a beginner friendly framework for chrissake. With the whole assets thing it seems like the good old Rails Way was left aside for now. I hope they can at least get rid of sprockets at some point.
1
u/jrochkind May 14 '20
I hear that. It's not a great place we've found ourselves. It doesn't help that webpacker is still really under-documented. Is it even mentioned anywhere on https://guides.rubyonrails.org/? From reading the guides -- which at one point were a really good reference introduction to Rails for someone who was familiar with the web and programming but not Rails -- I'm not sure you'd even know webpacker existed? There's still an Asset guide suggesting you use sprockets for JS though... oops.
→ More replies (0)3
u/ric2b May 12 '20
I miss the days of just adding what I need in a <script> before people decided the DOM needed to be reinvented in Javascript (I still cling to the idea of progressive enhancement).
This is pretty much what Svelte gives you. Instead of being a framework you load at runtime it's a compiler that lets you add reactivity/data bindings to javascript in a really simple way, no virtual DOM monster.
2
u/eskaparota May 13 '20
This is exactly how I feel. It felt like I understood sprockets pretty well. Getting my head around webpack seems a lot harder. At times it makes me afraid that I'm turning into a dinosaur just like that cobol programmer uncle....
1
May 13 '20
A lot of us feel that way. If you're mostly used to the Rails way, thinking about javascript asset management just probably isn't high on your priority / inclination / fun things to do. So it's just a major headache to you most likely.
So no, you're not a dinosaur. We just tend to dislike the complexity of this crap and wish it was simpler.
1
May 12 '20
Doesn't rails also rely on C-extensions?
3
u/chrisgseaton May 12 '20
Yes but TruffleRuby runs C extensions.
2
May 12 '20
is it binary compatible with the CRuby extensions and headers?
3
u/chrisgseaton May 12 '20
It's not binary compatible - it's source compatible. Which means you can install the same C extensions with
gem installorbundle install.(You can't be 'binary compatible' with a header - that's a contradiction in terms.)
11
4
May 12 '20
Well if you make Sinatra / Grape pass that's a great start. But then all of the entire gem ecosystem needs to pass as well ...
10
u/laerien May 12 '20
Sinatra worked years ago. Ruby and RubyGems specs all passing means pure Ruby gems will tend to just work.
3
May 12 '20
Ah thats great. So the problem is with gems with C extension or other things?
5
u/laerien May 12 '20
Yes, mostly C extensions. More and more of those are working and then there's passing the full Ruby Spec Suite, which seemed very close to totally green last I checked.
3
u/ric2b May 12 '20
I'm trying to get to TruffleRuby's Github page to learn more about it but there's no direct link from the post or the linked issue.
Yes, I'll google it but it helps to add a short description or homepage link for these sorts of important announcements.
3
u/choonggg May 13 '20
I've tried running Roda on Truffle Ruby but response is magnitudes slower compared to MRI, did I do something wrong?
0
u/nakilon May 12 '20
What about that specs that were developed by a single guy but CRuby was segfaulting so much that he abandoned it?
1
u/headius JRuby guy May 14 '20
You're probably referring to the RubySpec project. Those specs were later adopted by the core Ruby team and are now maintained alongside the CRuby test suite.
3
u/datsundere May 13 '20
wait oracle owns it? https://github.com/oracle/truffleruby