[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

comp.lang.ruby

Browser applications (applets, flash...) with Ruby?

Francis Rammeloo

9/12/2006 11:55:00 AM

Howdy,

Is it possible to write applications in Ruby and let them run in an
internet browser, just like you could with applets or flash? Preferably
without the user having to install a special plug-in...

Has it been done? Would this be possible with JRuby?
I'd appreciate your insights a lot, please share them.

Kind regards,

Francis

11 Answers

Richard Conroy

9/12/2006 12:11:00 PM

0

On 9/12/06, francis.rammeloo@gmail.com <francis.rammeloo@gmail.com> wrote:
> Howdy,
>
> Is it possible to write applications in Ruby and let them run in an
> internet browser, just like you could with applets or flash? Preferably
> without the user having to install a special plug-in...

Well you could host 'static content' flash and applets, and have them
referenced in your view templates. Not really the approach I would go
with (would use AJAX instead for rich content).

> Has it been done? Would this be possible with JRuby?
> I'd appreciate your insights a lot, please share them.

AFAIK there is no way to do this, unless there is some wierd
NET stuff where you can bundle up arbitrary code in something
that is browser runnable.

Daniel Baird

9/12/2006 12:16:00 PM

0

On 9/12/06, francis.rammeloo@gmail.com <francis.rammeloo@gmail.com> wrote:
> Howdy,
>
> Is it possible to write applications in Ruby and let them run in an
> internet browser, just like you could with applets or flash?
> [..] Has it been done?

There's RJS in the Ruby on Rails framework, that converts your Ruby
code into Javascript, or something.

See what Google has to say.

--
Daniel Baird
http://tidd... (free, effortless TiddlyWiki hosting)
http://danie... (TiddlyW;nks! :: Whiteboard Koala :: Blog ::
Things That Suck)

Logan Capaldo

9/12/2006 12:19:00 PM

0

On Tue, Sep 12, 2006 at 09:00:41PM +0900, francis.rammeloo@gmail.com wrote:
> Howdy,
>
> Is it possible to write applications in Ruby and let them run in an
> internet browser, just like you could with applets or flash? Preferably
> without the user having to install a special plug-in...
>
You would definitely need a special plugin, to directly run ruby on the
browser.
> Has it been done? Would this be possible with JRuby?
> I'd appreciate your insights a lot, please share them.
>
It might be possible with JRuby, if the browser has a JVM plugin and you
could send a verison of the JRuby interpreter down the pipe that would
be happy with the security restrictions on applets.

Another option is to try rb2js [1], which translates ruby into Javascript,
which can then of course be run in the browser.

[1] http://rb2js.ruby...

Francis Rammeloo

9/12/2006 2:27:00 PM

0

Thank you all. I would like to write some games like Tetris and post
them on my website. It's a bit frustrating that I have no other choices
but Java and Flash. (Oh and yes I've seen a Tetris written in
Javascript, but it's still too limited I think.)

Do you think this will become easier in the future? Maybe there will be
a sort of universal VM for running browser applications and that all
programming languages can compile to. Is there anything going on that
points in that direction?

Thanks a lot again for sharing your thoughts.

Kind regards,
Francis

Jonas Hartmann

9/12/2006 2:48:00 PM

0

francis.rammeloo@gmail.com wrote:
> Thank you all. I would like to write some games like Tetris and post
> them on my website. It's a bit frustrating that I have no other choices
> but Java and Flash. (Oh and yes I've seen a Tetris written in
> Javascript, but it's still too limited I think.)
>
> Do you think this will become easier in the future? Maybe there will be
> a sort of universal VM for running browser applications and that all
> programming languages can compile to. Is there anything going on that
> points in that direction?
>
> Thanks a lot again for sharing your thoughts.
>
> Kind regards,
> Francis
>
>
>
>

While I am really a noob, I still think JavaScript is NOT to LIMITED.
JavaScript has a bad scent cause there are so many people with really
NO idea about programming that want "nifty" javascript on their
webpages ;-(.

While I dont like JavaScript very much, I think its a REAL language
you can do REAL things with. Maybe you can take a look at CANVAS in
Safari/Mozilla or SVG and use these tools with JS to write web
browser, client side, based games.

Good luck :-)



Richard Conroy

9/12/2006 5:09:00 PM

0

On 9/12/06, francis.rammeloo@gmail.com <francis.rammeloo@gmail.com> wrote:
> Thank you all. I would like to write some games like Tetris and post
> them on my website. It's a bit frustrating that I have no other choices
> but Java and Flash. (Oh and yes I've seen a Tetris written in
> Javascript, but it's still too limited I think.)

Well in those respects, your Java & Flash content is effectively static
content unless you are doing interesting things like recording high
scores.

For interactive content online, Java & flash are probably the primary
development languages. For games that don't require real-time
control you can probably use Rails + AJAX, and down the road
yuu might be able to use SVG too.

> Do you think this will become easier in the future? Maybe there will be
> a sort of universal VM for running browser applications and that all
> programming languages can compile to. Is there anything going on that
> points in that direction?

One True Language-ism is dead. While you could do some funky .NET
stuff to get One True Binary at least, it probably would be overkill.

Daniel Baird

9/13/2006 4:13:00 AM

0

On 9/13/06, Jonas Hartmann <Mail@jonas-hartmann.com> wrote:
>
> While I am really a noob, I still think JavaScript is NOT to LIMITED.
> JavaScript has a bad scent cause there are so many people with really
> NO idea about programming that want "nifty" javascript on their
> webpages ;-(.
>
> While I dont like JavaScript very much, I think its a REAL language
> you can do REAL things with. Maybe you can take a look at CANVAS in
> Safari/Mozilla or SVG and use these tools with JS to write web
> browser, client side, based games.
>

I agree that JavaScript is a real language.. I'd even go so far as to
say that you can do more in JavaScript that in Java.

But, graphical output is very difficult to do in a cross-browser way.
So JS is not that good for certain types of in-browser games.


--
Daniel Baird
http://tidd... (free, effortless TiddlyWiki hosting)
http://danie... (TiddlyW;nks! :: Whiteboard Koala :: Blog ::
Things That Suck)

Ben Nagy

9/13/2006 8:52:00 AM

0

Hi,

I was just wondering if anyone has any example implementations of stateful
network protocols with Eventmachine they'd be willing to share. The built in
documentation uses very simplistic examples and has a "we should add this"
reference to more complicated example code that might exist...

Cheers,

ben


Francis Cianfrocca

9/13/2006 11:29:00 AM

0

On 9/13/06, Ben Nagy <ben@iagu.net> wrote:
> Hi,
>
> I was just wondering if anyone has any example implementations of stateful
> network protocols with Eventmachine they'd be willing to share. The built in
> documentation uses very simplistic examples and has a "we should add this"
> reference to more complicated example code that might exist...
>
> Cheers,
>
> ben
>
>
>

Hi Ben, if you sync to the latest version of the code from the
Rubyforge SCM, and look in version_0/lib/protocols, you'll find an
HTTP client implementation which is functionally incomplete but should
show you what you're looking for. This approach (essentially a
recursive-descent parser with the current parse-state stored in a
variable rather than on the call stack) may seem ugly, but it works
quite well for simple protocols. We've had some chatter lately on the
eventmachine list about using parser-generators for more intricate
protocols and some people have worked on this, but it's not ready yet.

If you'd like, please tell me what you're thinking of (feel free to do
so by private email) and I can perhaps suggest an alternative
approach. If you're implementing one ot the standard protocols, it
would be good to put it into the EM distro. Python's Twisted does
this, and EM eventually needs to have all the standards
out-of-the-box. The one I'm working on myself at the moment is AMQP.

Jonas Hartmann

9/14/2006 5:01:00 PM

0

Daniel Baird wrote:
> On 9/13/06, Jonas Hartmann <Mail@jonas-hartmann.com> wrote:
>>
>> While I am really a noob, I still think JavaScript is NOT to LIMITED.
>> JavaScript has a bad scent cause there are so many people with really
>> NO idea about programming that want "nifty" javascript on their
>> webpages ;-(.
>>
>> While I dont like JavaScript very much, I think its a REAL language
>> you can do REAL things with. Maybe you can take a look at CANVAS in
>> Safari/Mozilla or SVG and use these tools with JS to write web
>> browser, client side, based games.
>>
>
> I agree that JavaScript is a real language.. I'd even go so far as to
> say that you can do more in JavaScript that in Java.
>
> But, graphical output is very difficult to do in a cross-browser way.
> So JS is not that good for certain types of in-browser games.

If you do stuff on Bitmap basis. No.
And you can do that with <canvas> in a very speedy way afaik.