ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> ruby-talk
ruby-talk
[ANN] RubyJS 0.6 - pre-RubyConf version
by Michael Neumann other posts by this author
Oct 29 2007 9:05AM messages near this date
A screen cast of RubyCocoa | Re: [ANN] RubyJS 0.6 - pre-RubyConf version
Hi all,

After 9 months, the second incarnation of RubyJS is out (a complete rewrite). 
RubyJS compiles Ruby to Javascript and tries to be as efficient as possible
without sacrifying Ruby's beauty.

This is a pre-release. I hope I can import some local code that lies here around 
till RubyConf.

A small example:

   # hw.rb
   require 'rwt/DOM'

   class HelloWorld
     def self.main
       out = DOM.getElementById('out')
       DOM.setInnerText(out, 'hello world')
     end
   end

   <!-- index.html --> 
   <html> 
     <body> 
       <script src="hw.js"> </script>
       <a href="#" onclick="main()"> say hello</a>
       <div id="out"/> 
     </body> 
   </html> 


Compile it:

   rubyjs_gen --main HelloWorld hw.rb >  hw.js

And start index.html inside your browser.
Oh, and don't forget the optimization flags:

   rubyjs_gen --show-options


What works?
===========

   * Most if not all Ruby constructs!
   * Accessing/modifying DOM in your browser
   * JSON

What is missing?
================

   * The port of Google Web Toolkit is not yet completed.
   * Applications ;-)
   * A lot of methods in the core library

DOWNLOAD
=========

It's available from:

http://ntecs.de/hg-projects/rubyjs/

Best use Mercurial (www.selenic.com/mercurial) to check it out:

   hg clone static-http://ntecs.de/hg-projects/rubyjs/


Have fun and see you at RubyConf!

Regards,

   Michael
Thread:
Michael Neumann
James Britt

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved