Skip to content

notozeki/nacl-mruby

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

nacl-mruby

nacl-mruby is a mruby interpreter works on Native Client (NaCl). Ruby code runs on the browser, and you can use Pepper API from Ruby.

This is ALPHA version. Some APIs still not working 😢

Live demos

Access these pages from Google Chrome browser.

  • repl: A read-eval-print loop console
  • mandelbrot: Plotting mandelbrot set

How to use

Prerequisites

1. Preparation

First, set NACL_SDK_ROOT environment variable to the path to the Native Client SDK. For example:

$ export NACL_SDK_ROOT=/Users/notozeki/src/nacl_sdk/pepper_31

Second, check out naclports. You need to install depot_tools to use gclient.

$ mkdir naclports
$ cd naclports
$ gclient config --name=src  https://chromium.googlesource.com/external/naclports.git
$ gclient sync

# See https://code.google.com/p/naclports/wiki/HowTo_Checkout for more details.

Third, install PCRE library via naclports. PCRE is required in order to compile mruby-pcre-regexp gem later.

$ cd src
$ ./make_all.sh pcre

2. Download and build nacl-mruby

Clone nacl-mruby repository into a directory wherever you like. And setup submodules.

$ git clone git://github.com/notozeki/nacl-mruby.git
$ cd nacl-mruby
$ git submodule init
$ git submodule update

Then, run make.

$ cd plugin
$ make

Now you have newlib directory and nacl-mruby executables in it.

3. Run examples

Currently there are three examples:

  • examples/simple
  • examples/mandelbrot
  • examples/repl

To run an example, change directory to the example directory, and run make and make run.

$ cd ../examples/mandelbrot
$ make
$ make run

Now http server is running in the local, access localhost:5103 from Google Chrome browser.

4. Write your application

(Coming soon...)

License

under the MIT License:

Copyright (c) 2014 Yasuhiro KOSEKI

About

mruby interpreter works on Native Client

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published