8 ms·
Ruby 1.9 lands NaCl support, can run in Chrome
- charliesome 14y agoI always thought Ruby used Git (https://github.com/ruby/ruby https://github.com/ruby/ruby), but this links to an SVN repo. What's up with that?
- Argorak 14y agoThe official Ruby repository is still on svn, as all the tooling is implemented on top of it. ruby/ruby is the official mirror on github and does accept pull requests, etc.
- djacobs 14y agoI've talked with one of the core devs, who has said that the primary reason they haven't switched is of them use Windows.
- petercooper 14y agoWhich is reasonably ironic considering Ruby's reputation for running on Windows (which has taken major third party efforts to get it to work in any sane way).
- VeejayRampay 14y agoIt's pretty ridiculous that Ruby still uses Subversion yeah.
- jgmmo 14y agoWhat is significance of this? When can I write Ruby as easily as JS/PHP?
- zitterbewegung 14y agoThis means that you can run ruby in the NaCL component of google chrome. It doesn't mean that the language syntax will change or make it "easily as JS/PHP"
- phamilton 14y agoYou already can write Ruby as easily as PHP (they are both server-side languages). What this means is that Ruby can be used as a client side language via NaCl, provided browsers support it.
- kennystone 14y agoProbably never as easily as JS in the client. You should look at CoffeeScript if you don't like JS syntax.
- azakai 14y agoYou can compile other languages than CoffeeScript to JS. C++, Java, C#, for example. Also, you can run Ruby in the browser right now by compiling its runtime (in a standards-compliant way without NaCl), http://repl.it/#:languages http://repl.it/#:languages
- VeejayRampay 14y agoOf course it will be just as easy eventually. Surely you don't think we'll be forced to use JS forever now do you? Coerce people into using a UNIQUE and LIMITING solution and they will find ways to use something else. The sooner the better.
- icco 14y agoHere is the same commit in GitHub: https://github.com/ruby/ruby/commit/76bc2d1ed7f13fb329c33f48756ea3c24c59a6ea https://github.com/ruby/ruby/commit/76bc2d1ed7f13fb329c33f48...
- peppertree 14y agoDoes anyone know if future versions of chrome will come bundled with ruby runtime? Or is it going to be a plugin download.
- koko775 14y agoProbably never. NaCl lets you embed programs into a webpage, protected by a layer in between the OS and the actual code so that it can't break out and wreak havoc like ActiveX once did. So this means that any website could embed Ruby code (more strictly speaking, it could embed a Ruby interpreter) to be executed client-side on a browser supporting NaCl.
- deleted 14y ago[deleted]
- drivebyacct2 14y agoThat's like asking if Chrome is going to come with Adblock Plus or some other random extension or app...
- megaman821 14y agoThe whole point of NaCl is to stop bundling runtimes with the browser. You can develop in whatever language you like as long as it can compile to NaCl byte-code. That said there could be a Chrome app that is a Ruby interpreter running on NaCl.
- gcp 14y agoThe whole point of NaCl is to stop bundling runtimes with the browser Ironically enough that's exactly what NaCl itself is.
- obtu 14y agoI think that's stretching the definition; NaCl is part of the runtime environment, but only as a sandbox which programs won't notice unless they go off the rails. Unless you meant Pepper, which does provide enough platform support for a port of the flash plugin. But Pepper is an API, and the functionality it gives access to would be part of Chrome anyway.
- thedeuce 14y agonoooooooooooooooooOOOOOOOoooooooooooo and i thought javascript in my browser was bad..now i'll need noscript and noruby ;__;
- icepick 14y agoHas anyone built this and have a demo?
- Spakman 14y agoHere you go: http://yugui.jp/nacl/example.html http://yugui.jp/nacl/example.html Chrome/Chromium(?) 19+ required, I think.
- EricR23 14y agoInteresting. I wonder, though, what the advantages of executing sandboxed ruby in the browser are?
- eklitzke 14y agoThis would let you write Chrome extensions in Ruby (rather than JS).
- TazeTSchnitzel 14y agoYou could already do that by compiling Ruby with Emscripten, there is nothing new here.
- obtu 14y agoPorting a rails application to run serverless.
- ippa 14y agoWhile NaCL is exciting tech I wonder how user-friendly (load times, performance etc) and how easy to develop on top of it, it will be in reality.
- eagsalazar 14y agoOn the one hand I get why people are excited about this and why people like coffeescript, especially when source maps start working in inspector/firebug. You can write web apps in the language you love and know. Cool! On the other hand, this really sucks. Javascript is just maturing to where it is really awesome! And there is a ton of collaboration among app developers because javascript was the only game in town for so long. Of course people will continue to collaborate but not, I fear, at the same level. 3rd party libraries will continue to be available, but not as many will fit in so neatly with people coding in other languages. This has already come up a few times with coffeescript and in a couple years when it is truly easy for people to work in other languages, we'll have a tower of babel effect. JS is really good. It isn't that hard to learn if you already know other languages. It has warts but it is also very powerful so often it is worth it (check out the lines of code and speed vs other languages): http://shootout.alioth.debian.org/u32/javascript.php http://shootout.alioth.debian.org/u32/javascript.php
- chii 14y agoI think that NaCl is more geared towards being a target of a port for an existing application thats been written (like the supreme commander game that google managed to coerce a studio to port to NaCl). I htink the pie is big enough for both NaCl and javascript apps.
- azakai 14y ago> I think that NaCl is more geared towards being a target of a port for an existing application thats been written It is, but you can also port existing applications to JS. > I htink the pie is big enough for both NaCl and javascript apps. It's a different pie. NaCl is chrome-only (and just enabled in the chrome store, in fact), while JS runs in all browsers.
- Drakim 14y ago> It is, but you can also port existing applications to JS. You can't just port things to JavaScript the same way. JavaScript is a very different sort of language. "porting" something to JavaScript pretty much always means remaking the whole thing from ground up and hoping that your pixel pushing in canvas runs at an acceptable speed.
- derefr 14y agoOn a complete tangent: of all the language runtimes I'd expect to be converted to run in NaCl, I don't think Ruby's would top my list for "immediate practical uses." On the other hand, porting the Erlang BEAM VM--and thus allowing a web client to become a node in an Erlang process network, and have arbitrary code pushed to and executed on it by the network--would have tons of relevant applications. Anyone working on this? Should I start working on this?
- eagsalazar 14y agoyes, you should. (ignore my previous tower of babel whining wrt this particular application which sounds completely awesome)
- andrewflnr 14y agoallowing a web client to become a node in an Erlang process network, and have arbitrary code pushed to and executed on it by the network Does this sound scary to anyone else?
- derefr 14y agoWe already have arbitrary code pushed to us and executed in our browsers all the time--it's called Javascript (and with JSONP, we even have more Javascript being pushed to us in realtime in response to events and eval'ed live. Nothing new here.) The difference in running Erlang here is simply that the browser would be joining a network of agents and spawning agents of its own, instead of joining a network of processes and spawning threads/web-workers of its own. This would allow a uniformity of process logic, such that an agent could be transparently running on a browser or on a server to complete a task, and messages could be being passed transparently across the network to facilitate this, without any of the code having to differentiate the cases. NaCl ensures the browser sandbox environment remains in place--so, other than perhaps getting a bit hot, your computer won't be doing anything it wasn't already doing just running the Javascript the server served it.
- tomjen3 14y agoNot if you know how NaCL works.
- nato1138 14y agoI think it was Bruce Eckel who said the ultimate destination for programming languages was, english. Which makes sense to me. Doesn't Ruby trail-blaze a little harder towards this next goal than, JS?
- bad_user 14y agoI see that some people wonder why this is useful. I wonder the same thing, and in general I don't like the concept of NaCl, which will be ActiveX all over again, even though it has a better security sandbox, as poor security wasn't the biggest problem of ActiveX ... seems to me like Google is trying really hard to be like Microsoft. However, I can't help but notice that Ruby, as a programming language, is getting ported everywhere. It runs on all desktop operating systems, it runs on top of the JVM and on top of Android. For iOS there are 2 competing versions already. For .NET the interest was low, so IronRuby is kind of dying, but it's still decent for a .NET implementation. Ruby MRI evolved a lot from 1.8 to 1.9, being a decent VM for a scripting language. Rubinius is much like Smalltalk, having the standard library in Ruby itself, allowing you to access the internals of the VM. JRuby is awesome. Then there are the specs. Amongst the scripting languages people use today, Ruby has some of the best specs. It started with RubySpec, which are test suites started by the people working on Rubinius and now used by everybody else. And now Ruby is becoming an ISO standard. This makes me happy because when it comes to equivalent dynamic languages, there is no spec other than the reference implementation, making third-party implementations an unfeasible task. Perl 5 is a really good example of this. So does anybody else find this exciting? As a language, Ruby is really mature these days, while still being fun and productive. Much like Smalltalk was back in the day.
- cageface 14y agoI would be thrilled if somebody waved a magic wand and completely replaced Javascript with Ruby. But since that's not going to happen, I instead lean heavily towards the path of least resistance when it comes to languages. I write iOS apps in Obj-C, CRUD apps in Rails, DSP code in C++, and web front end in JS. The cost of context switching is less than the cost of swimming upstream all the time.
- dsirijus 14y agoI couldn't agree with this one more. I only swim upstream if I have absolutely no other choice, courtesy of the Deadline. But here's the thing - there's always Deadline. :)
- 14y ago
- pjmlp 14y agoNaCl == Google's ActiveX, no thanks.
- tomjen3 14y agoNo true. NaCl doesn't use proprietary APIs and is, in fact, a standard. It is just that the other browsers haven't implemented it yet. Blame them, not Google (or blame users who don't use Chrome, without whom this would be a non-issue).
- markus2012 14y agoNaCL != ActiveX. ActiveX code had unrestricted access to OS services. NaCL does not.
- pjmlp 14y agoIt still follows ActiveX concept of a plug-in for native code, which is made available only on a single browser outside the W3C web standards. Coming from the Chocolate Factory company does not make it suddenly good. If you want native code just use native code on the desktop. The web is for documents and network protocols.
- markus2012 14y agoThis is neat. It would be fantastic if someone did the same thing with the jvm. Then I could use Java or Clojure or whatever JVM-based language I wanted - and make use of tons of pre-existing libraries. NaCL is the sandbox I want, not the craplet sandbox. With NaCL I can use C libs and access useful OS services without having to sign the app and ask the user for permission to delete their hard drive.