Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Ruby is slow. Despite improvements over the years, the language will never be as fast as a compiled language. To compensate for this, whenever Ruby developers need to run performance critical code, it's not uncommon for them to interoperate with a library written in C. Dozens of well known gems, such as Nokogiri and Bcrypt, already do this. But with C comes other problems: how can we ensure that our low-level code is safe from memory leaks and other security vulnerabilities? In this talk, I'll introduce the oxidize-rb project, which is a suite of open source tools which makes it possible to call Rust libraries from within Ruby. I'll also demonstrate how simple it is to incorporate Rust code (including Cargo dependencies) into a Ruby gem.
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 the talk titled 'Wrapping Rust in Ruby' presented by Garen Torikian at RubyConf 2023, the integration of Rust—a memory-safe programming language—with Ruby is discussed as an innovative approach to improve the performance of Ruby applications. The speaker, who is a seasoned Ruby developer and CTO at Yto, highlights Ruby's traditionally slower performance compared to compiled languages like C. To bridge this performance gap, many Ruby libraries utilize C extensions, but they come with challenges such as memory management complexities and security vulnerabilities. Key points discussed in the presentation include: - **The Limitations of Ruby Performance**: Ruby is often considered slow, even with ongoing efforts to enhance its performance, hence the necessity for alternatives in performance-critical scenarios. - **Using C for Performance**: Techniques employed by developers to speed up Ruby applications using C libraries, exemplified by Garen's experience with the CommonMarker gem which translates Markdown into HTML. - **Challenges with C Extensions**: Issues related to memory safety, debugging difficulties, and cross-platform compatibility when using C extensions in Ruby were prominently discussed. - **Introduction of Rust**: Garen showcased a proactive shift towards Rust, emphasizing its advantages in memory safety and modern programming practices, while illustrating how Rust can serve as an alternative to C for building performance-focused Ruby extensions. - **Oxidize-RB Project**: This community initiative aims to simplify integration between Rust and Ruby, with tools like Magnus facilitating the binding process and reducing boilerplate code. - **Practical Demonstration**: A live demonstration detailed how to create a Ruby gem utilizing Rust, highlighting steps like using Bundler to set up project structures, managing dependencies with TOML, and writing minimal glue code. - **Deployment using Docker**: Garen discussed the automation of the gem distribution process using Docker and GitHub Actions to pre-compile Rust code across different platforms, relieving end users from needing to compile themselves. In conclusion, the presenter encouraged Rubyists to explore Rust as a safer, modern alternative for performance enhancement, urging attendees to evaluate how much C they employ in their codebases and consider the implications of switching to Rust for their Ruby applications. Overall, the talk aimed to shift the narrative around Ruby performance by leveraging Rust's capabilities while mobilizing the developer community towards innovative solutions for integration.
Suggest modifications
Cancel