Git Product home page Git Product logo

iruby's Introduction

iRuby

This begins life as a straight line for line port of the IPython repo stored here: https://github.com/fperez/zmq-pykernel/

Ideally it becomes something more consequential later.

Development

This is meant to be run from the IPython notebook. install the bundle and generate an rvm wrapper for this bundle with:

rvm wrapper 1.9.3#iruby iruby

You'll have to use our ipython fork's ruby_kernel branch. You'll also want to install ipython to point to your dev version with sudo python setupegg.py develop

Then you just run the IPython notebook web server with ipython notebook --Session.key='' That will execute the server and open your web browser to the notebooks index page.

Building an in-browser REPL for Ruby (iRuby)

Hey, I'm Josh Adams. I'm a partner and CTO at isotope|eleven. We alo host Birmingham, AL's Open Source Software meetup - BOSS.

At one of these sessions in early 2012, Tom Brander did a presentation and used IPython in his browser to manage it (there was much code and it was executed live). This was the first time I'd seen IPython in the browser where it actually worked like it was supposed to, and I was extremely impressed.

If you've not seen IPython, it looks like this <* Insert Screenshot Here *> in its web-browser mode. It also manages a lot of console-basd REPLs.

Anyway, it has notebooks that you can save out to execute later, and you can pass them around as little code snippets for other people to check out. It's very impressive.

But I'm primarily a Rubyist, and I'm happy that way :) I couldn't sit by while Python had this awesome tool that we lacked. I looked around for a bit, and there was nothing like IPython in our ecosystem. There were, however, quite a few people asking about it. So I figured I'd do something about it.

The Architecture

So the IPython guys did a great job explaining their core architecture, both in words and in pared-down code, in a blog post they wrote concerning it. In general, it works like this <* Diagram *>

There's a kernel that runs in the background and gets connected to by a frontend. They communicate using zeromq, and they send json formatted messages back and forth. These messages are in a very well defined structure. Anyway, this way the frontend of the repl is disconnected from the environment that's running it.

So the code repository they linked to in their blog post included the kernel and the frontend as small-ish python files - around 300 and 200 lines respectively. We had a hack weekend at isotope|eleven where myself and Robby Clements got together and (when we weren't playing Counterstrike1.6) did the closest thing to a straight port that we could swing. Within about 2 hours of work, we had a working proof of concept that was primarily a 1 to 1 port.

The next move was to build the web frontend. This just consists of a websocket server and a fairly basic frontend webpage.

iruby's People

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.