Skip to content

Instantly share code, notes, and snippets.

@beakr
Last active August 29, 2015 13:56
Show Gist options
  • Save beakr/9010964 to your computer and use it in GitHub Desktop.
Save beakr/9010964 to your computer and use it in GitHub Desktop.
Simple Ruby REPL with mruby. Made as a test for the mruby C API.
#include <stdio.h>
#include <mruby.h>
#include <mruby/compile.h>
int main(int argc, char ** argv)
{
mrb_state * mrb = mrb_open();
char code[250];
while (1) {
printf("[max:250]> ");
fgets(code, 250, stdin);
mrb_load_string(mrb, code);
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment