Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Ruby without the Syntax

Syed Faraaz Ahmad
December 16, 2023
64

Ruby without the Syntax

Syed Faraaz Ahmad

December 16, 2023
Tweet

Transcript

  1. Yet Another Virtual Machine a.k.a YARV putobject 1 putobject 2

    opt_plus leave YARV 010101010101 100001010101 001010101010 101000010101 010100001011
  2. Top level methods are stored in the Kernel module >

    puts 25 25 => nil > Kernel.puts 25 25 => nil
  3. Top level methods are stored in the Kernel module >

    def foo = 420 => :foo > Kernel.private_methods => [..., :foo, ...]
  4. You can do all of it (I think) rb_require(...); rb_load(...);

    rb_raise( rb_eRuntimeError, "Error code %d", 404 ); VALUE gv; rb_gv_set("$x", gv); gv = rb_gv_get("$x"); iv = rb_iv_get(obj, "@x");