Ruby is fast. Mass produced. Impersonal. What if it wasn't? What if we could return to a simpler time, when every computation was handcrafted by a real human being?
A Ruby VM where the CPU is you.
human-ruby compiles your Ruby program to "bytecode" in a spreadsheet format designed to be run by people.
It is based on the mruby bytecode (actually uses the mrbc compiler).
It supports
- running the program locally using Excel.
- using a cloud-provided human processing unit (Amazon MTurk).
- It also has an auto mode to simulate a human running the program.
This was built for a talk at RubyConf 2026.
mrbc(mruby's compiler) parses your Ruby and emits bytecode.- The bytecode is broken down into sub-steps and compiled into a spreadsheet.
- The operator executes the program by walking the steps.
- The CLI watches the file and acts as the program's stdio.
You need:
- Ruby 3.4 (see
.ruby-version) - Python 3 with openpyxl (used to render the spreadsheet. Will eventually be ported to Ruby and merged into the bin.)
- mruby, built from source, at
./mruby(a symlink works too) — tested against mruby master (4.0.0 development) - A spreadsheet app — Excel or LibreOffice, anything that opens
.xlsxand saves it back.
git clone git@github.com:JoeDupuis/human-ruby.git
cd human-ruby
git clone https://github.com/mruby/mruby.git
(cd mruby && rake) # builds mruby/bin/mrbc
bundle install
pip3 install openpyxl # skip if your python already has itIf you use devenv, devenv shell provides Ruby and Python (with openpyxl) for you — you still build mruby yourself.
human-ruby mirrors ruby:
bin/human-ruby examples/while_loop.rbThis compiles the program, generates while_loop.xlsx, opens it in your spreadsheet app, and starts watching the file. Execute the program by following the workbook's steps.
Useful flags:
| Flag | What it does |
|---|---|
-o FILE |
output path (default ./<name>.xlsx) |
--no-open |
don't launch the spreadsheet app |
--inputs a,b,c |
provide ARGV |
--keep-values |
regenerate without losing the cells you already filled |
-v, --verbose |
print the workbook path and streaming status |
To only generate the workbook — for handing to someone else — use compile:
bin/human-ruby compile examples/fact.rb -o fact.xlsxSimulates the human: an executor drives LibreOffice headlessly. Useful for verifying a workbook actually runs to completion. Requires LibreOffice.
bin/human-ruby run examples/fact.rb --auto| Flag | What it does |
|---|---|
--auto-trace |
stream the per-tick trace to stderr |
--auto-max-steps N |
bail out after N ticks (headless tests, infinite loops) |
Provision a human processing unit from the cloud. Biological serverless compute.
You need:
- AWS credentials for an account registered as an MTurk Sandbox requester. Put them in a named profile and pass
--aws-profile. - A Microsoft account with OneDrive — the workbook is hosted there so the worker can run it in Excel for the web. The first run walks you through a device-code login and caches the token. Google Sheets is not yet supported.
bin/human-ruby run examples/bump.rb --mturk --aws-profile mturk --verboseWhat happens: the workbook is uploaded to OneDrive (folder set by --mturk-folder, default human-ruby), shared through an anonymous edit link, and posted as a HIT on the worker sandbox. The run ends when they reach the exit code. If a worker abandons or breaks a segment, it's re-posted for a fresh worker (--max-attempts-per-segment). Every segment's filled sheet is archived under traces/.
Knobs you'll want:
| Flag | What it does |
|---|---|
--segment-steps N |
fence long programs into ~N-step segments, each posted as its own paid HIT (default: auto-sized from the hourly rate so each HIT stays under MTurk's $10 cap) |
--hourly-rate DOLLARS |
pay rate used to price each HIT (default 17.00) |
--max-spend DOLLARS / --max-hits N |
pause and ask before blowing the budget |
--hit-timeout SECONDS |
post a backup worker if a HIT sits unanswered |
--resume RUN_ID |
pick an interrupted run back up from its last checkpoint |
There are many more flags — run bin/human-ruby --help for the full list.
To clean the sandbox account between experiments (stale HITs also make the worker preview page show old content), flush everything:
bin/human-ruby mturk-flush --aws-profile mturkIt expires every HIT, approves any submitted assignments, and deletes them; HITs a worker still holds are reported as skipped (exit code 1) — rerun once they're abandoned.
It's real mruby bytecode underneath, and the workbook renderer covers essentially the whole mruby instruction set: integers, strings, arrays, hashes, ranges, if/while/until, method definitions, classes, instance/global/class variables, blocks, exceptions, puts/gets. Core methods like Array#each and Integer#times aren't faked — their genuine mruby bytecode is stitched into the workbook and the operator steps through them too.
Certain choices to keep the VM simple to run, especially around cell types (integer vs string), have been taken that could result in bugs or different behavior vs mruby.
bundle exec rake test # fast structural suite (~1m)
bundle exec rake test:all # everything, parallelThe mruby source in ./mruby doubles as the reference for opcode semantics — the point of the project is that the human VM follows it faithfully.
