Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In this presentation from RubyKaigi 2024, Uchio Kondo discusses an implementation of mruby for WebAssembly. He introduces himself as an infrastructure engineer and translator from Japan, and emphasizes the purpose of utilizing WebAssembly to efficiently run Ruby code in various environments, including browsers. Key points outlined in the talk include: - **Introduction to mruby and WebAssembly**: Kondo explains that Ruby can be compiled into a binary format suitable for execution in web browsers and presents mruby as a specialized version for WebAssembly use cases. - **Compiling with mruby**: The presenter demonstrates how to compile Ruby files into WebAssembly using two components: the mruby compiler and the mrb command. Kondo outlines how to prepare the necessary RBS files for compiling into a single WebAssembly file that exports functions. - **Execution example**: A practical example is provided where a WebAssembly file exports a Fibonacci function, which can be verified through the 'wasm object dump' command. Kondo confirms that the generated WebAssembly file can run in a browser through an HTML setup that invokes the Fibonacci function. - **Overview of WebAssembly**: Kondo elaborates on the versatility of WebAssembly, describing it as a stack-based virtual machine that is used not only in browsers but also in diverse environments such as cloud-native settings, load balancers, and various applications. - **Integration with Ruby**: He discusses the importance of specifying export and import functions when compiling Ruby files, offering an example of a simple Ruby addition operation that is successfully executed via WebAssembly. - **Understanding WASM structure**: Kondo shares insights into the binary format of WebAssembly, including its structure consisting of different sections for function declarations, memory, globals, and more. This allows developers to inspect and validate function signatures using WASM object analysis tools. - **Efficient runtime**: Kondo introduces the implementation of mbh, designed to enable efficient code management for both mruby and WebAssembly. He compares the size of mruby with its dependencies to mruby for WebAssembly, highlighting the latter's compactness and efficiency. For instance, while standard mruby with dependencies may reach 18MB, a Fibonacci function example compiled with mbh is only 174KB. - **Future potential**: The talk concludes with an encouraging note on the growth potential of mruby integrated with WebAssembly, offering improvements in performance and efficiency for Ruby applications on the web. Overall, Kondo's presentation emphasizes the integration of mruby with WebAssembly as a promising approach for developing lightweight and efficient Ruby binaries suitable for web environments.
Suggest modifications
Cancel