
Convert Ruby to JavaScript - jmonegro
http://po-ru.com/diary/convert-ruby-to-javascript/
======
judofyr
Or just use Red? <http://wiki.github.com/jessesielaff/red>

------
tlrobinson
I'm sure you're all getting sick of me posting this link, but this is
relevant:

<http://github.com/tlrobinson/cappruby/tree/master>

It's the same idea but it uses the Objective-J runtime which is similar to
Ruby's runtime.

------
camccann
I don't mean this as an attack, it's an honest question: _Why?_

I don't grasp the value of this sort of thing. If it's meant mostly as a
novelty, a "because I could" type thing, then that's always fun, but I get the
impression that people would use this for other purposes.

Yes, Ruby is a charming language, but I don't really see what it offers in
this context that Javascript doesn't. Are there some crazy metaprogramming
techniques that can be done in Ruby to reduce code size that wouldn't work in
JS? Do people really hate the idea of having to use more than one language in
different layers of an application?

I could see the desire to compile something very different into JS (e.g., a
static-typed language), but Ruby and JS seem similar enough that I'm just not
getting it.

~~~
jmonegro
I'm guessing that by handing over some of your tasks to javascript, you can
reduce server load because javascript is a client-side language.

Also to quote from the Red github link, "What does this mean for today’s Ruby
developer? Simple. _You don’t need to learn JavaScript._ "

~~~
thwarted
Oh, the burden of learning and increasing your marketability.

------
petercooper
Just a note that this is three years old and somewhat outdated, but... it's
still a pretty cool trick/idea, similar to the Ruby->PHP compiler mentioned
here recently: <http://www.ruby-php.org/>

I'm not sure, though, that it's useful enough to "break through." _judofyr_
mentioned Red ( <http://github.com/jessesielaff/red> ) as a more production
ready Ruby-JavaScript tool but even that hasn't been updated in a year it
seems :-(

~~~
threedaymonk
Yes, I was quite surprised to see it being picked up after such a long time!
It's just a quick implementation that I ran up in a lunch break one day.

If you want to see a better implementation of a Ruby to JavaScript compiler,
have a look at <http://www.ntecs.de/projects.html>

~~~
petercooper
If you're Paul, I just want to give you a virtual knighthood for your work
with iplayer-dl - as I'm sure thousands of others would love to.

~~~
threedaymonk
That's me. Thanks, I accept! Do I get a sash or a garter or something?

