JavaScript is great, but let's face it, being stuck with just JavaScript in the browser is no fun.
Why not write and run Ruby in the browser, on the client, and on the server as part of your next web application?
5. Don’t know it, therefore don’t like it Miserable experience with the DOM, hated it (long pause) Prototype + JQuery: hey, this is not bad Writing pure JS FF extension – fun! Maintaining extension + debug: it’s ok… (personal) conclusion: it’s a great language (personal) JavaScript retrospective in 6 acts…
6. JavaScript as a monopoly? they (ECMA) are colluding against us!
7. … … … Diversity is good! experimentation leads to innovation …
14. require 'em-synchrony' require 'em-synchrony/em-http' require 'em-http/middleware/json_response' TRYRUBY = 'http://tryruby.org/levels/1/challenges/0/play’ EM::HttpRequest.use EM::Middleware::JSONResponse EM.synchrony do r =EM::HttpRequest.new(TRYRUBY).put :body => {:cmd => '1+1'} puts r.response['output'] # => 2 r =EM::HttpRequest.new(TRYRUBY).put :body => {:cmd => 'RUBY_VERSION'} puts r.response['output'] # => 1.9.2 end Server-side sessions not really in your browser…
15. require 'em-synchrony' require 'em-synchrony/em-http' require 'em-http/middleware/json_response' TRYRUBY = 'http://tryruby.org/levels/1/challenges/0/play’ EM::HttpRequest.use EM::Middleware::JSONResponse EM.synchrony do r =EM::HttpRequest.new(TRYRUBY).put :body => { :cmd => ’”a” * (2**25)’ } puts r.response['output'] # => ... end So, how much RAM can we claim? security is always an issue…
22. Setting: Live demo to Jim Clark (CEO of Netscape) Links to any file other than an image cause the user to be prompted to download the file.. However, when a user clicked on a link to a PDF file, the file instantly opened within the browser window, seamlessly blending HTML and PDF consumption! Clark: wow, who provided the support on our side? Adobe: we reverse-engineered it… Inception
45. No fork, process control, file system access, etc.http://code.google.com/chrome/nativeclient/
46. receive message functionmoduleDidLoad() { HelloTutorialModule=document.getElementById('hello_tutorial'); HelloTutorialModule.addEventListener('message', handleMessage, false); // Send a message to the NaCl module HelloTutorialModule.postMessage('hello'); } send message Talking to NaCl via Pepper API
47. virtualvoidHandleMessage(constpp::Var& var_message) { if (!var_message.is_string()) return; std::string message = var_message.AsString(); pp::Varvar_reply; var_reply = pp::Var(kReplyString); PostMessage(var_reply); } dispatch response Talking to the Browser via Pepper API