RubyKaigi 2022
I was able to participate in RubyKaigi 2022 remotely last week. It was exciting and filled with energy!
There were many interesting topics talked about, but I want to choose some of them.
Ruby meets WebAssembly
This was the first talk of RubyKaigi 2022, given as a keynote. WebAssembly will come to Ruby! The speaker @kateinoigakukun talked about the challenges of porting CRuby to WebAssembly. My understanding of the difficulties is that some CRuby's implementations are incompatible with WASI (WebAssembly System Interface). I was not sure what WASI is, but WASI seems to be designed to focus on security. It's reasonable to make new interfaces to be secure because there are many attack vectors in the software world. But, it's not happy for CRuby. For example, CRuby uses setjmp/longjmp, but such a save/restore is not allowed in WebAssembly.
According to the talk, he could resolve the incompatibilities with Asyncify. Asyncify is a feature that allows pausing and resuming code. The motivation of Asyncify seems to transform synchronous operations into asynchronous ones so that WebAssembly code could be run asynchronously in a coordinated way with other JavaScript code, which has built-in asynchronous I/O operations. If WebAssembly code runs asynchronously, users don't have to wait for long, expensive I/O operations implemented by WebAssembly and can interact with UI smoothly.
Asyncify does unwind and rewind the call stack and stores the serialized state as locals. From my understanding of this talk, CRuby's WebAssembly feature is using this feature to convert setjmp/longjmp and Fiber. Also, it allows CRuby to scan data for GC as Asyncify preserves states in locals.
Here is the slide of this talk.
This was a great talk, and I enjoyed it.
Why is building the Ruby environment hard?
I was lucky to hear about the problem of building Ruby on macOS Ventura. According to the talk, Ruby cannot be built on the platform 😱
The speaker @hsbt also talked about other challenges of building Ruby on various platforms. For example, Ruby can't be built on Ubuntu 22.04 because of the incompatibility of OpenSSL, and he fixed ruby-build to be compatible with Ubuntu 22.04. After hearing this, I feel grateful that ruby-build is working hard behind the scene.
The most impressive phrase by @hsbt is "Software gets broken if you do nothing." This makes me recall a situation where application dependencies tend to be left behind.
Others
TRICK 2022 was very fun, and all of the codes are somewhat beautiful but difficult to understand! But, I learned how we could abuse Ruby's syntax aggressively!
Thank you, RubyKaigi, all staff, and its community.