8 ms·
Tenderjit – A JIT for Ruby Written in Ruby
- gscho 5y agoLove seeing people make ruby 3.0+ faster!
- lathiat 5y agoI immediately want to test it out and see if I can get it to JIT itself. I feel evil.
- jhgb 5y agoSomething like http://kleinvm.sourceforge.net/ http://kleinvm.sourceforge.net/ ?
- tenderlove 5y agoHi! Yes, that is one of my goals. I'll be presenting this project at RubyConf and I hope that I can get the compiler to compile itself by then. Breaking the circular dependencies is somewhat tricky, and you'll see some frankly ridiculous code inside TenderJIT that is meant to break those cycles.
- d4mi3n 5y agoFor those unaware: Aaron Patterson, aka tenderlove, is an influential and longstanding personality in the ruby community who’s made many significant contributions to Ruby and Ruby on Rails over the years. He’s also a fantastic writer with a quirky style, highly recommend perusing his technical writing: http://tenderlovemaking.com/ http://tenderlovemaking.com/
- irjustin 5y agoI've had the pleasure of meeting Aaron at a number of ruby confs. He's supportive from the largest all the way to the smallest. My personal favorite thing he'll do is ask conference speakers questions that make the speaker look good/best-light-possible. Something slightly technical/challenging, not fully covered in the talk but definitely something the speaker can handle. To be able to do this consistently means he knows the topic better than the speaker themselves (at least this has been true when I've been there). This is in contrast to people who ask "gotcha" questions. Spend 3-4 minutes showing off their knowledge and then finally getting to the question which is to stump the speaker. I hate these kinds of people at conferences the most.
- d3nj4l 5y agoHis keynotes for RailsConfs are among the best talks I've ever watched. You always start off thinking it's just a comedy routine but by the end you know a lot more about Rails and Ruby than you did before.
- evilduck 5y agoAlso, you may learn a bit about his other passions. I once learned a fair bit about curing meats (and probably something about ruby, I guess) from tenderlove at one of his talks.
- GolDDranks 5y agoHe's also making cheese!
- skunkworker 5y agoI remember running into him at Rails at RailsConf in Phoenix a few years go and brought up his work on the Rails journey router, which is an NFA and his eyes lit up and was really excited that someone appreciated and understood that crucial yet under the hood part of the Rails core. It was enjoyable to talk and meet him.
- boffinism 5y agoHis handle and domain name are super gross. Every time I visit his website, woth its icky tagline, I feel the need to disinfect my eyeballs
- joelbluminator 5y agoYet you keep visiting his website despite how gross it is for you? Wow. That's some sacrifice you're making only to learn more about Ruby. I suggest the community gives you the Ruby Hero award wdyt? I'm not being totally sarcastic (only a bit) this shows some true grit on your part.
- moritonal 5y ago"Join STEM and build for the future! Don't let the cliche and sexist past our industry is known by prevent you from succeeding!" "Oh, you want to learn about low-level Ruby internals? I know a good blog... but, oh, about that.."
- baremetal 5y agono one is stopping them from being garbage collectors or construction workers either. maybe they just arent interested in STEM, as a whole. is that so bad?
- tenderlove 5y agoThank you so much, I really appreciate it. I really should blog more, I just haven't been "feeling it" lately. Words of encouragement really help, so thank you so much! :D
- throwawaygimp 5y agoApologies if this is obvious - is this ISA specific, or does it sit upon cross platform libs? I ask because I'm *very* interested in this, but am working on ARM Edit - just to be clear why I'm interested. For me it matters not if Ruby is slow, until it does, which is usually a very specific and obvious piece of code.
- arthur2e5 5y agoIt’s x86-64 only. A quick look at the https://github.com/tenderlove/tenderjit/blob/main/lib/tenderjit/iseq_compiler.rb https://github.com/tenderlove/tenderjit/blob/main/lib/tender... linked from the README reveals heavy references to x86-64 registers. The “Fisk” library used appears to be a x86-64 assembler in Ruby. I guess that’s to be expected with “pure ruby” — all the cross-insn backends you can use (Cranelift, LLVM) are written in not-Ruby.
- gnulinux 5y agoHow can you do ISA-agnostic JIT unless you implement a separate backend for each ISA? I.e. is it possible to write a JIT in a generic way such that it'll work for a class of ISAs?
- tenderlove 5y agoIt's x86-64 specific right now. I'm interested in adding ARM support so I'll do that at some point in the future. My desktop is x86-64 and our production machines are as well, which is why I started with it. Thanks for the interest!
- stanislavb 5y agoLong live Ruby. It has never lost wide interest; however, it seems there's a king of resurgence around it recently.
- swlkr 5y agoarstechnica wrote an article on server side languages and ruby was the only one aside from php that had much growth!
- nitrogen 5y agoI've been using Ruby for sound lately. It's a good exercise in optimization because Ruby's not that fast for numeric computation (without calling out to a C lib like Numo), so your algorithms have to be reasonable. I'm hoping that the various JIT efforts will eventually let me run multiple realtime voices in my synthesizer, without having to drop down to C.
- pjmlp 5y agoI guess you might find this interesting, https://twitter.com/headius/status/1261024699837890561 https://twitter.com/headius/status/1261024699837890561
- chrisseaton 5y agoCan you share any code? I'm interested in optimising interesting Ruby demos.
- nitrogen 5y agoYeah, here's my main sound repo: https://github.com/mike-bourgeous/mb-sound https://github.com/mike-bourgeous/mb-sound There's also an FFI wrapper for jackd: https://github.com/mike-bourgeous/mb-sound-jackffi https://github.com/mike-bourgeous/mb-sound-jackffi I'm certain there are still improvements that could be made to the APIs and to performance, so I'm not currently releasing these on rubygems. Edit: I should really try these with TruffleRuby myself. I'll try to reply here if I do.
- 5y ago
- d3nj4l 5y agoIs it called a plug if you're not shilling your own stuff? Well, anyway, if you're interested in this, you might also want to check out the recorded talks from the recent RubyKaigi. Specifically, there's two really interesting talks on JIT: - @k0kubun's talk on why Ruby's JIT was slow - https://www.youtube.com/watch?v=db3GHHllRyQ https://www.youtube.com/watch?v=db3GHHllRyQ This is about the MJIT engine built into MRI. - @maximecb's talk on YJIT - https://www.youtube.com/watch?v=PBVLf3yfMs8 https://www.youtube.com/watch?v=PBVLf3yfMs8 This is closer to TFA, which as written in the README was an experiment the author worked on to get comfortable working on YJIT. You can also check out the full con playlist here, but about half the talks in Japanese. They're pretty great, though, so if you do know enough Japanese to understand a bit, it might be worth your time. I personally recommend the opening keynote on Typeprof. The playlist: https://www.youtube.com/watch?v=xLeLW-p43bc&list=PLbFmgWm555yYgc4sx2Dkb7WWcfflbt6AP https://www.youtube.com/watch?v=xLeLW-p43bc&list=PLbFmgWm555... The talks in this playlist are a bit out of order, so you can refer to the schedule: https://rubykaigi.org/2021-takeout/schedule https://rubykaigi.org/2021-takeout/schedule
- pjmlp 5y agoThanks for sharing them.
- KingOfCoders 5y agoPet peeve of mine: "X compiler/interpreter/JIT written in X". Case in point five years and 150k+ lines with the slow Scala compiler written in Scala (it's conceptual slow because of the language (types, implicits, ...) and it's accidentally slow because written in Scala (a slow language) on the JVM (slow startups and warmups)). I do get the coolness, the eat your own dog food, the I-write-X-in-X-because-I-obviously-like-X-otherwise-I-would-not-create-it-duh, but as a user I hate it. I would prefer "X written in A" where A is the reasonably fastest language, e.g. Rust. I love the Go compiler for speed.
- kibibu 5y ago> I love the Go compiler for speed Wait till you find out what the Go compiler is written in then.
- KingOfCoders 5y agoIn one of the fastest languages, X==A :-)
- fredrikholm 5y agoGo! https://golang.org/doc/go1.5#c https://golang.org/doc/go1.5#c
- habibur 5y agoOnly for the build time to take a nosedive when they ditched C. Explained here, by a factor of 2. https://golang.org/doc/go1.5#performance https://golang.org/doc/go1.5#performance
- pjmlp 5y agoTrue, and as they explain, > Builds in Go 1.5 will be slower by a factor of about two. The automatic translation of the compiler and linker from C to Go resulted in unidiomatic Go code that performs poorly compared to well-written Go. Analysis tools and refactoring helped to improve the code, but much remains to be done. Further profiling and optimization will continue in Go 1.6 and future releases. And as of Go 1.17 that is pretty much forgotten waters.
- pjmlp 5y agoLove the approach, kudos for trying it out.
- pizza234 5y agoThere was actually an existing, similar in concept, Ruby JIT, Rhyzome: https://github.com/chrisseaton/rhizome https://github.com/chrisseaton/rhizome. It's good to see (IMO) the development of a JIT in a strict sense. I'm personally skeptical about the current approach (invoking a compiler separately). On the other hand, it's important to know that JITs may take a long development time to be performant, and that they also complicate the performance profile of a virtual machine.
- adgezaza 5y agoWhy are we still talking about Ruby?