hoodwink.d enhanced
RSS
2.0
XHTML
1.0

RedHanded

rb2js #

by why in inspect

Holy smokes: rb2js! A very clever hack ~200 lines. Outputs Ruby code as JavaScript, making up the difference with flgr’s ruby.js. Make sure you: gem install parsetree.

said on 05 Jul 2006 at 17:18

whoa, it’s a dsl but backwards!

said on 05 Jul 2006 at 17:19

Holy crap NICE !

said on 05 Jul 2006 at 18:04

i’ve had a feeling this was going to happen. good stuff.

i guess we better find the limitations and start hacking them out of existence.

said on 06 Jul 2006 at 11:01

Wow, something we’ve all dreamed about—but who knew it would be so easy?

said on 06 Jul 2006 at 11:14

jes5199: That’s the spirit! Let’s not rest until we can run Rails in the browser.

(Seriously, I think the hardest thing to address is going to be getting all the nooks and crannies of Ruby’s grammar covered. Heredocs … brr.)

said on 06 Jul 2006 at 11:39

MenTaLguY:, some corner of my brain says “if we were LISP hackers, we’d have the whole thing done by now”. ::shudder::

said on 06 Jul 2006 at 12:07

Ohh, wait a minute. It’s using ParseTree. Which means grammar is solved.

said on 06 Jul 2006 at 12:55

Glad you all like it so far! That’s only a quick proof of concept, though, to show that simple Ruby code can be expressed in JavaScript.

The biggest thing needed to make it Ruby-like is to implement message sending, I think. I have a plan for that!

jes5199: I don’t know about LISP , but Scheme hackers have already done it.

said on 06 Jul 2006 at 13:09

this is potentially fantastic. my javascript apps are getting more complex day by day. so it would be great to be able to write them in ruby !

said on 07 Jul 2006 at 11:08

I think it’s a really bad idea for real world use, it’s a cool little experiment though. Everyone seems to want to hide JavaScript under other languages at the moment but I don’t see the sense it. JavaScript isn’t a bad language at all if you take the time to learn it.

It’s only the browser implementations that are ropey but hiding it under lots of ruby isn’t going to help that in fact it will probably make it worse.

said on 07 Jul 2006 at 14:58

Dan W: There’s nothing wrong with Javascript. It’s just that it’s really appealing to be able to use the same language for the entire application, front to back.

said on 10 Jul 2006 at 11:25

Actually, after writing that I subsequently spent several days doing some hardcore Javascleept development. I take that back: there are somethings wrong with the Java Scripts. Ruby please.

11 Jul 2010 at 21:28

* do fancy stuff in your comment.

PREVIEW PANE