Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 56 lines (40 sloc) 2.493 kb
571299ff »
2013-06-16 Travis
1 # rexpl [![Build Status](https://secure.travis-ci.org/txus/rexpl.png)](http://travis-ci.org/txus/rexpl)
2466c7d0 »
2011-06-17 Add some readme and a bit of output
2
3 **rexpl** is a sandbox to experiment and play with the [Rubinius](http:://rubini.us)
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.
7
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.
11
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.
14
73ab3ecd »
2011-06-17 Now for realz
15 ![Rexpl](http://dl.dropbox.com/u/2571594/rexpl.png)
0da04e95 »
2011-06-17 Add screenshot
16
2466c7d0 »
2011-06-17 Add some readme and a bit of output
17 ## How to use it?
18
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](http://rubini.us) 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](http://beginrescueend.com/interpreters/rbx/).
22
a76bdccc »
2011-06-17 Full docs
23 $ gem install rexpl
24 $ rexpl
2466c7d0 »
2011-06-17 Add some readme and a bit of output
25
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](http://rubini.us/doc/en/virtual-machine/instructions/)
28 and see what happens!
29
30 There are three extra commands to take advantage of the stack introspection:
31
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.
36
37 ## When to use it?
38
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.
44
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
49
d5a8e331 »
2013-06-16 Readme
50 ## Who's this
37a1a391 »
2011-06-17 Fix docs
51
d5a8e331 »
2013-06-16 Readme
52 This was made by [Josep M. Bach (Txus)](http://txustice.me) 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
55
d5a8e331 »
2013-06-16 Readme
56 [twitter]: https://twitter.com/txustice
Something went wrong with that request. Please try again.