Weekly notes #12
On deserializing InstructionSequence
, Ruby-LLVM bindings, and how to critically read papers.
Ruby, systems, performance, and programming links from last week.
Ruby
YARV: Yet another RubyVM / Instruction Table - In Ruby 1.9, MRI got a new VM, with its own set of instructions. This is the original table and here are the current sources.
Class: RubyVM::InstructionSequence - the official documentation.
How can I store and read a
RubyVM::InstructionSequence?
- The InstructionSequence
API only returns the compiled bytecode by default, so a small hack using
Fiddle::Handle,
Fiddle::Function,
and Fiddle.dlwrap is required to expose rb_iseq_load
that can load it
back as well. There’s a skeleton implementation of this idea, too.
Ruby, Trace, Leave, Oh my! - how trace instruction and events work and how to compile the code without them.
Rewrite your Ruby VM at runtime to hot patch useful features - Patching trampolines into the binary to trace calls to ruby_newobj
.
Ruby bindings to LLVM - Ruby bindings into the LLVM toolchain.
Two interesting (partial) implementations of Ruby, one current, one older:
GoRuby, an implementation of Ruby written in Go
Articles
Learn programming languages efficiently - By setting goals, doing exercises, tests and using spaced repetition.
How do debuggers keep track of the threads in your program?
Papers we Scrutinize: How to critically read papers - Tomas Petricek on blindly accepting scientific papers as ‘the truth’ and on reading papers from a different perspective.