12 ms·
Ruby on WebAssembly
- hhw3h 8y agoJust a thought experiment... Would this allow for full stack ruby apps? Writing a client side router and controllers in Ruby on Rails compiled to web assembly? If you could just toggle in production.rb if you want your routing to be client side or server side and the framework could transparently manage that for you.
- jballanc 8y agoIn theory you could already do this with Opal (https://github.com/opal/opal https://github.com/opal/opal).
- lloeki 8y agoIn practice too: http://www.voltframework.com http://www.voltframework.com
- mshenfield 8y agoNice. Anyone else getting a "Connection Lost..." message as soon as they visit the page?
- nick_urban 8y agoDoes not seem to be actively developed, however. Last commit was in early 2016: https://github.com/voltrb/volt/ https://github.com/voltrb/volt/
- reese_john 8y agoI believe Hyperloop[0] tries to accomplish something similar [0] http://ruby-hyperloop.org/ http://ruby-hyperloop.org/
- Asmod4n 8y agoThere is no Ruby on Rails for mruby, yet.
- keithnz 8y agoyes, and it's not only ruby doing this, various other languages are doing it also. So it's going to be interesting to see what kind of disruption that has on javascript on the client side.
- choxi 8y agoHow would you use features like event listeners and other web APIs from client-side mruby? I guess this is a question about WebAssebly in general: does each language that gets ported over have to re-implement those APIs?
- rollcat 8y agowasm has something akin to a syscall interface to talk to the JS side, but you can't just call arbitrary JS.
- steveklabnik 8y agoTo clarify this a bit, webassembly modules declare external functions they'd like to call. When you instantiate the module, you hook JS functions up to those names. So, you can "call arbitrary JS" in the sense that there's no restrictions on what JS is in those functions, but you can't "call arbitrary JS" in the sense that the module has to list up-front what it'd like to call and it's the instantiator's job to provide those things or decide to not instantiate.
- CyberDildonics 8y agoWhy would someone go through so much trouble to use a language that will run much slower than JITed javascript? I think most people miss that right now webasm is good for run speed, size, and loading speed, but is not geared nearly as much towards using any language in a web page, since IO needs to be exposed to javascript.
- robotmay 8y agoJavaScript isn't everyone's cup of tea, and performance isn't always a huge concern :) The more other languages I learn, the more often I come back to Ruby. I'm excited to see it becoming a more portable language, and I think it'll make a good language for web clients someday.
- CyberDildonics 8y agoAgain, all the IO still has to be done in javascript, you can only do raw processing in web assembly right now. If you try to write the web assembly part in ruby, you are sending your users a run time and using an interpreter that is itself being JITed, purely to transform some amounts of data between IO from the user, including any information to and from the DOM.
- untog 8y ago> performance isn't always a huge concern :) This is what concerns me a little with WASM. There are already too many web development experiences that prioritise developer experience and neglect user experience, I'm wondering what future we're walking into where we bundle three different standard libraries, ignore binary size, etc etc
- morgancmartin 8y agoI've never understood this take on things, though I'm ready to if it can be explained to me. :) To me, it seems that the user experience vs dev experience trade off is subject to market forces and if it swings too wildly in either direction, a competitor will come through and wipe the floor with everyone else, no? It's always seemed unnecessary to me to worry about the effects of _more_ options, at least in the context of application development anyway.
- singularity2001 8y agoRubies magic evaporated when I realized that its logic is unintuitive / broken: ``` puts true and not true >>> true x = true and false >>> true if 0; puts 'true';end ``` breaking backwards compatibility with every rails upgrade didn't help. Similar bad behaviour in kotlin
- abhorrence 8y agoand/or/not have different precedence than &&/||/!. The symbol versions of each of those would behave as you would expect. However, I can’t say much in favor of the existence of the word forms.
- deleted 8y ago[deleted]
- dragonwriter 8y agoSo, your first two complaints are you not understanding Ruby operator precedence, not Ruby logic being broken, and the other is you not understanding Ruby truthiness (null and false are not truthy, all other builtin/stdlib values [and conventionally all other values] are falsely.)
- heartbreak 8y agoAnd the final complaint was about Rails, not Ruby.
- 8y ago
- arkh 8y agoI hope we soon get Lisp on WebAssembly so we can run a full OS (emacs) in the browser.
- shakna 8y agoWe already have these two: * Schism [0], R6RS Scheme. * Arboreta [1], Common Lisp. [0] https://github.com/google/schism https://github.com/google/schism [1] https://github.com/Arboreta/arboreta-wasm https://github.com/Arboreta/arboreta-wasm
- wolfspider 8y agoMruby has captured my attention for quite a while now, especially the ability to compile and run its own bytecode as a module. The memory handling seems good and want to try running it with Cairo GL for iOS sometime for some immediate mode rendering.
- cobbzilla 8y agoCurious how fast/stable Ruby->wasm is on the frontend. I had a horrible experience with scaling a large rails app, but the usage patterns for server vs client are very different. I haven't played with wasm yet and am waiting a bit for a "best language" consensus to emerge. If I was to bet on a winner, my money wouldn't be on Ruby, but I've been wrong many times.