Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Using Ruby in the browser is wonderful

Using Ruby in the browser is wonderful

RubyKaigi 2024の発表資料です。

- https://ledsun.github.io/kakikata/
- https://github.com/ledsun/orbital_ring

shigeru. nakajima

May 17, 2024

More Decks by shigeru. nakajima

Other Decks in Programming


  1. WA RB Using Ruby in the browser is wonderful 2024/05/17

    ledsun (中島滋:株式会社ラグザイア) 於 RubyKaigi 2024
  2. Self-introduction •ledsun@ github or X •Based in Tokyo •I am

    programing web applications by Ruby on Rails and JavaScript WA RB
  3. Today I will talk 1. What is ruby.wasm 2. What

    did I do for ruby.wasm 3. What I am going to do WA RB
  4. 1. Virtual Machine of CRuby is running on the browser

    2. Glue between CRuby and JavaScript WA RB
  5. What JavaScript has that Ruby does not •new operator •It

    is method in Ruby •property call •It is method in Ruby WA RB
  6. ruby.wasm provide glue between CRuby and JavaScript •JS.global •The globalThis

    in JavaScript •JS.eval •Eval JavaScript code •JS::Object •Wrapper for JavaScript Object WA RB
  7. The ruby.wasm is 1. Virtual Machine of CRuby is running

    on the browser 2. Glue between CRuby and JavaScript WA RB
  8. Self-introduction Part 2 •Sending pull requests for the Glue •Create

    JavaScript objects with the new method •JS::RequireRemote WA RB
  9. WA RB The new operator does not exist in Ruby.

    Instead, call the JavaScript code that calls the new operator
  10. (We are halfway through the presentation. Speakers will take a

    break for a drink of water. Please wait a moment.) WA RB
  11. SproutCore, Cappuccino, Knockout, Backbone.js, AngularJS, Ember.js, Agility.js, Derby, Spine, knockback.js,

    Meteor, CanJS, Flight, React, Polymer, Reactive.js, Durandal, Riot, Vue.js, Ampersand.js, mercury, Mithril, Cycle.js, aurelia-framework, Angular, Preact, Inferno, choo, Lightning Web Components, Hyperapp, Svelte WA RB No one can stop having fun making them.
  12. See https://ledsun.github.i o/kakikata/ WA RB Since a framework cannot be

    created by itself, it is built into applications.
  13. WA RB In Rails, it is equivalent to the classic

    autoloader, implemented using const_missing.
  14. Unfortunately, it does not handle structured names as well as

    the classic autoloader in Ruby on Rails. WA RB
  15. Orbital Ring is a science fiction idea that if a

    ring is built in satellite orbit and an orbital elevator is hung from it, it will be easy to go back and forth between the ground and space. WA RB
  16. If you have any ideas for applications or frameworks using

    ruby.wasm, please let me know. WA RB