Skip to content

Instantly share code, notes, and snippets.

@headius
Created June 7, 2016 07:55
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save headius/7b18835fed6c62a44823668704ed050c to your computer and use it in GitHub Desktop.
Save headius/7b18835fed6c62a44823668704ed050c to your computer and use it in GitHub Desktop.
Prototype flatbuffer-based persistence and interpreter for JRuby
[] ~/projects/jruby $ cat blah.rb
puts 'Hello, flatbuffers!'
[] ~/projects/jruby $ java -cp lib/jruby.jar org.jruby.ir.persistence.flat.FlatIRInterpreter blah.rb
Hello, flatbuffers!
[] ~/projects/jruby $ ls -l blah.ir
-rw-r--r-- 1 headius staff 1024 Jun 7 02:54 blah.ir
[] ~/projects/jruby $ hexdump -c blah.ir
0000000 024 \0 \0 \0 020 \0 030 \0 \b \0 \f \0 020 \0 024 \0
0000010 006 \0 005 \0 020 \0 \0 \0 \0 \0 005 \0 ? 002 \0 \0
0000020 ? 002 \0 \0 ? 002 \0 \0 004 \0 \0 \0 \b \0 \0 \0
0000030 ? 002 \0 \0 ` 002 \0 \0 024 002 \0 \0 ? 001 \0 \0
0000040 230 001 \0 \0 ? \0 \0 \0 H \0 \0 \0 004 \0 \0 \0
0000050 020 ? ? ? \0 \0 \0 005 \f \0 \0 \0 030 \0 \0 \0
0000060 \f \0 \0 \0 ? ? ? ? ? ? ? ? v ? ? ?
0000070 \0 \0 \0 ? 001 \0 \0 \0 004 \0 \0 \0 004 ? ? ?
0000080 \0 \0 \0 003 004 \0 \0 \0 ? ? ? ? 004 \0 \0 \0
0000090 P ? ? ? \0 \0 \0 004 \f \0 \0 \0 T \0 \0 \0
00000a0 $ \0 \0 \0 ? ? ? ? 004 \0 \0 \0 \0 \0 026 \0
00000b0 034 \0 \f \0 020 \0 024 \0 \a \0 \b \0 \t \0 \n \0
00000c0 030 \0 \v \0 026 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
00000d0 001 \0 \0 \0 \f \0 \0 \0 001 \0 \0 \0 020 \0 \0 \0
00000e0 004 \0 \0 \0 p u t s \0 \0 \0 \0 \0 \0 \0 \0
00000f0 002 \0 \0 \0 034 \0 \0 \0 004 \0 \0 \0 204 ? ? ?
0000100 \0 \0 \0 003 004 \0 \0 \0 ^ ? ? ? 003 \0 \0 \0
0000110 230 ? ? ? \0 \0 \0 006 004 \0 \0 \0 & ? ? ?
0000120 \0 \0 \0 ? ? ? ? ? \0 \0 \0 001 \f \0 \0 \0
0000130 030 \0 \0 \0 \f \0 \0 \0 216 ? ? ? 003 \0 \0 \0
0000140 J ? ? ? \0 \0 \0 ? 001 \0 \0 \0 004 \0 \0 \0
0000150 ? ? ? ? \0 \0 \0 001 004 \0 \0 \0 ? ? ? ?
0000160 024 \0 \0 \0 020 \0 034 \0 004 \0 \b \0 \f \0 020 \0
0000170 024 \0 030 \0 020 \0 \0 \0 H \0 \0 \0 8 \0 \0 \0
0000180 034 \0 \0 \0 020 \0 \0 \0 \b \0 \0 \0 \0 \0 \0 \0
0000190 \a \0 \0 \0 b l a h . r b \0 023 \0 \0 \0
00001a0 H e l l o , f l a t b u f f e
00001b0 r s ! \0 005 \0 \0 \0 U T F - 8 \0 \0 \0
00001c0 023 \0 \0 \0 H e l l o , f l a t b
00001d0 u f f e r s ! \0 230 ? ? ? \0 \0 \0 003
00001e0 \f \0 \0 \0 030 \0 \0 \0 \f \0 \0 \0 B ? ? ?
00001f0 ? ? ? ? J ? ? ? \0 \0 \0 \0 \0 \0 \0 \0
0000200 ? ? ? ? \0 \0 \0 001 \f \0 \0 \0 030 \0 \0 \0
0000210 \f \0 \0 \0 j ? ? ? 002 \0 \0 \0 & ? ? ?
0000220 \0 \0 \0 ? 001 \0 \0 \0 004 \0 \0 \0 ? ? ? ?
0000230 \0 \0 \0 005 004 \0 \0 \0 B ? ? ? \0 \0 \0 ?
0000240 \f \0 024 \0 \b \0 \f \0 \a \0 020 \0 \f \0 \0 \0
0000250 \0 \0 \0 001 \f \0 \0 \0 030 \0 \0 \0 \f \0 \0 \0
0000260 ? ? ? ? 001 \0 \0 \0 r ? ? ? \0 \0 \0 ?
0000270 001 \0 \0 \0 \f \0 \0 \0 \b \0 \f \0 \a \0 \b \0
0000280 \b \0 \0 \0 \0 \0 \0 004 004 \0 \0 \0 226 ? ? ?
0000290 \0 \0 \0 ? ? ? ? ? \0 \0 \0 \a 024 \0 \0 \0
00002a0 \0 \0 \0 024 \0 \0 \0 \0 \0 006 \0 \b \0 004 \0
00002b0 006 \0 \0 \0 \0 \0 \0 \0 ? ? ? ? \0 \0 \0 ?
00002c0 \0 \0 \0 \0 \f \0 026 \0 \b \0 \f \0 \a \0 020 \0
00002d0 \f \0 \0 \0 \0 \0 \0 002 024 \0 \0 \0 ( \0 \0 \0
00002e0 034 \0 \0 \0 \0 \0 006 \0 \n \0 004 \0 006 \0 \0 \0
00002f0 ? ? ? ? \0 \0 006 \0 \b \0 \a \0 006 \0 \0 \0
0000300 \0 \0 \0 ? \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
0000310 \a \0 \0 \0 b l a h . r b \0 \0 \0 \0 \0
0000320 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0 \0
*
0000400
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment