Skip to content
This repository


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
100644 56 lines (40 sloc) 2.493 kb
571299ff »
2013-06-16 Travis
1 # rexpl [![Build Status](](
2466c7d0 »
2011-06-17 Add some readme and a bit of output
3 **rexpl** is a sandbox to experiment and play with the [Rubinius](http:://
4 Virtual Machine and its bytecode instructions. It comes wrapped in a REPL
5 (Read-Eval-Print Loop) à la IRB, so that anytime you can open a terminal,
6 fire up **rexpl**, and start playing with instant feedback.
a76bdccc »
2011-06-17 Full docs
8 This intends to be a fun tool to use when learning how to use Rubinius
9 bytecode instructions, for example when bootstraping a new language targeting
10 the Rubinius VM for the first time.
2466c7d0 »
2011-06-17 Add some readme and a bit of output
12 Its main feature is **stack introspection**, which means you can inspect
13 what the stack looks like after each step of your instruction set.
73ab3ecd »
2011-06-17 Now for realz
15 ![Rexpl](
0da04e95 »
2011-06-17 Add screenshot
2466c7d0 »
2011-06-17 Add some readme and a bit of output
17 ## How to use it?
19 Needless to say, **rexpl** runs only on Rubinius. Thus, your first step is to
a76bdccc »
2011-06-17 Full docs
20 install it. Go to the [Rubinius website]( to find how, or if
2466c7d0 »
2011-06-17 Add some readme and a bit of output
21 you are using RVM, just follow [this instructions](
a76bdccc »
2011-06-17 Full docs
23 $ gem install rexpl
24 $ rexpl
2466c7d0 »
2011-06-17 Add some readme and a bit of output
26 Now you should see a welcome banner and an IRB-like prompt, and you're good to
27 go! Just start typing some [VM instructions](
28 and see what happens!
30 There are three extra commands to take advantage of the stack introspection:
32 * `list` lists the instruction set of the current program.
33 * `reset` empties the instruction set and starts a new program.
34 * `draw` prints a visual representation of the stack after each instruction of
35 your program.
37 ## When to use it?
39 Imagine you are bootstrapping a new language targeting the Rubinius VM and you
40 just implemented a particular AST node, but when you try to run the tests, you
41 keep getting nasty stack validation errors. Net stack underflow? What the heck
42 does this even mean? Where the hell is that extra `pop`? Did this or that
43 instruction consume stack? Or maybe produce it? Oh fuck it, let's go fishing.
45 Don't panic. You always have your friends pen and paper ready to help you out,
46 Read through the source code, and knowing what each instruction does, try to
47 follow along and draw what the stack looks like at each step (does that sound
48 familiar to you?). Or just fire up **rexpl**.
37a1a391 »
2011-06-17 Fix docs
d5a8e331 »
2013-06-16 Readme
50 ## Who's this
37a1a391 »
2011-06-17 Fix docs
d5a8e331 »
2013-06-16 Readme
52 This was made by [Josep M. Bach (Txus)]( under the MIT
53 license. I'm [@txustice][twitter] on twitter (where you should probably follow
54 me!).
73ab3ecd »
2011-06-17 Now for realz
d5a8e331 »
2013-06-16 Readme
56 [twitter]:
Something went wrong with that request. Please try again.