News for hackers. Stuff that matters.
Re:Try Ruby (in your browser, now with 1.9) by aarongough on Thursday January 07, 2010 @07:24PM (#1038434)
Clever! But in all honesty, I was a little disappointed when I discovered that Ruby was not being emulated in JavaScript or something similar. Just bouncing the entered text back to a server-side instance of IRB instead...
Re:Try Ruby (in your browser, now with 1.9) by mpk on Thursday January 07, 2010 @07:59PM (#1038492)
Well, an official spec for Ruby is in the works and there's already one for JavaScript (ECMAScript). Someone is bound to build a Ruby VM in JS at some point and then it'll be trivial to build a site like this.

The performance will be horrible, of course, but once that happens some other person will come along and run a subset of Rails (or some other Ruby web framework) with an evented db backend on it (for async callbacks to the server over HTTP) to run an app in the browser.

Which would be pretty cool, though not useful. (But don't let that stop you, whoever you are!)

Re:Try Ruby (in your browser, now with 1.9) by scotth on Thursday January 07, 2010 @10:34PM (#1038767)
I can imagine a fairly clean mapping between languages. If the result of compilation was JavaScript code, to be passed on to the browser using eval(), the code would perform quite well.

So, assuming that I'm correct, what you would be left with is the one-time cost of parsing. And how costly is parsing generally? (I am keeping in mind that Ruby may not be general)

Re:Try Ruby (in your browser, now with 1.9) by ThinkWriteMute on Thursday January 07, 2010 @08:12PM (#1038509)
I believe a Ruby VM is already in the works, but my cold addled brain can't google fu right now.
Re:Try Ruby (in your browser, now with 1.9) by Zev on Thursday January 07, 2010 @08:25PM (#1038526)
That would be HotRuby, http://hotruby.yukoba.jp.
Re:Try Ruby (in your browser, now with 1.9) by nym on Thursday January 07, 2010 @07:41PM (#1038463)
Try-javascript-emulated-ruby?
Re:Try Ruby (in your browser, now with 1.9) by aarongough on Thursday January 07, 2010 @07:42PM (#1038469)
You forgot the '.org' :-D
Re:Try Ruby (in your browser, now with 1.9) by petercooper on Thursday January 07, 2010 @08:57PM (#1038564)
It would be possible to have a JRuby applet so everything would run within the browser but.. that'd involve having a multi megabyte applet to activate on the page and they kinda freak people out nowadays.

Some sort of Flash based Ruby VM that you can interact with through JavaScript would make it rather interesting though..

Re:Try Ruby (in your browser, now with 1.9) by jmonegro on Thursday January 07, 2010 @07:51PM (#1038480)
The problem with using a javascript-emulated version is that it'd be way too limited, unless the dev went out of his way to cover much of the ruby language. This way, you can try the whole thing.

JS emulated would be good if it was just a tutorial, but it's a bit more than that.

Re:Try Ruby (in your browser, now with 1.9) by city41 on Thursday January 07, 2010 @09:20PM (#1038613)
Type in "help", the tutorial that gets kicked off from that is pretty impressive. My Dad has been curious about programming and I think this is what I'm going to point him to.