How MJIT Generates C From Ruby - A Deep Dive
17-Oct-2019 1575
I’ll give you the short version here: Ruby parses your code. It turns it into an Abstract Syntax Tree, which is just a tree-data-structure version of the operations you asked it to do. Before Ruby 1.9, Ruby would directly interpret the tree structure to run your code. Current Ruby (1.9 through 2.6-ish) translates it into buffers of bytecodes. These buffers are called ISEQs, for “Instruction SEQuences.” There are various tools like yomikomu that will let you dump, load and generally examine ISEQs. BootSnap, the now-standard tool to optimize startup for large Rails apps, works partly by loading dumped ISEQs instead of parsing all your code from .rb files.
How MJIT Generates C From Ruby - A Deep Dive #ruby #rubydeveloper #rubyonrails #Generates https://rubyonrails.ba/link/how-mjit-generates-c-from-ruby-a-deep-dive