---
title: "WebAssembly support coming to CRuby"
publication: "Ruby Weekly"
issue: 587
published_at: "2022-01-20"
canonical_url: "https://rubyweekly.com/issues/587"
---

Plus JRuby now supports the M1, and a landmark birthday for Sidekiq. |        

#​587 — January 20, 2022 

[Read on the Web](https://rubyweekly.com/issues/587)   

Ruby Weekly 

[![\](https://res.cloudinary.com/cpress/image/upload/w_1280,e_sharpen:60/uczgfkvcjpzvqqfak4on.jpg)](https://bugs.ruby-lang.org/issues/18462)  

[Proposal to Merge WASI-Based WebAssembly Support into Ruby](https://bugs.ruby-lang.org/issues/18462) — There have been [experiments](https://runrb.io/) before, but having WebAssembly as an officially supported target for Ruby would open up some interesting use cases. While this is exciting news, it’s _very_ early days and with a variety of expected limitations (e.g. around threading). A story we’ll keep an eye on, for sure, and hopefully a headline feature for Ruby 3.2. 

Yuta Saito et al.   

🎉 [Happy 10th Birthday to Sidekiq, the Background Job Processor](https://www.mikeperham.com/2022/01/17/happy-10th-birthday-sidekiq/) — A true Ruby success story! The creator of the hugely popular [Sidekiq](https://sidekiq.org/) background job system celebrates a decade of work (to put it in perspective, [DynamoDB also turned 10](https://www.amazon.science/latest-news/amazons-dynamodb-10-years-later) this week!) by looking back at the decisions that made it possible and potentially handing the project over to the community in the future. 

Mike Perham   [![\](https://copm.s3.amazonaws.com/f0ba237b.png)](https://ter.li/9j962s) 

[Spend More Time Building with Scout APM](https://ter.li/9j962s) — Scout is a lightweight application monitoring service built for modern development teams. With a transaction based pricing model and unlimited seats, anyone on your team can be a performance expert for a low cost. Start your 14-day free trial today. 

Scout APM sponsor   

[Reducing Method Calls by 99.9% by Replacing `Thread#pass` with `Queue#pop`](https://mensfeld.pl/2022/01/reduce-your-method-calls-by-99-9-by-replacing-threadpass-with-queuepop/) — If you work with threads at all, you’ll enjoy this as it digs into some useful points about multi-threaded flow control in Ruby and when different approaches fit best. 

Maciej Mensfeld   

[On The Future of 'Adopting' Ruby Gems](https://blog.rubygems.org/2022/01/19/rubygems-adoptions.html) — The RubyGems project wants to introduce a formal process to allow owners of gems to hand the stewardship of those gems to new owners. Here’s a bit more about how it could work in practice. 

Aditya Prakash (RubyGems)   

**IN BRIEF:** 

- The exciting times for CRuby continue as [the idea of porting YJIT to Rust](https://bugs.ruby-lang.org/issues/18481) (to make it easier and faster to maintain and improve) has been proposed.
- Stripe has open sourced [their VS Code extension for Sorbet](https://sorbet.org/blog/2022/01/06/open-sourcing-sorbet-vscode) which can be used to hugely improve productivity when working with Ruby.     

Jobs  

[Backend Engineer | Remote within CET (-3/+3 hours) | Full-Time](https://jobs.lever.co/qonto/284b8162-5293-4ad7-a9e6-4ad26ce0c516?lever-origin=applied&lever-source%5B%5D=Cooperpress) — Europe's leading business finance solution. You will help us simplify everything from everyday banking and financing, to bookkeeping and spend management. 
Qonto   

[Senior Rails Engineer @ Nebulab (Remote)](https://nebulab.com/careers?gh_src=a6448332teu) — Join our distributed team and build high-volume eCommerce applications in a workplace made by developers for developers. 
Nebulab   

[Find Ruby Jobs Through Hired](https://hired.com/join/?utm_source=newsletter&utm_medium=sponsor&utm_campaign=%28b2c%29%28l-all%29%28r-all%29%28cooper-rubyweekly%29&utm_content=find-your-next-job) — Create a profile on Hired to connect with hiring managers at growing startups and Fortune 500 companies. It's free for job-seekers. 
Hired    

📕 Articles & Tutorials  

[On How FastRuby Uses RuboCop and StandardRB](https://www.fastruby.io/blog/ruby/code-quality/how-we-use-rubocop-and-standardrb.html) — FastRuby is a (commercial) Rails upgrading service so tooling around enforcing rules and code style standards is unsurprisingly of utmost importance to them. 

Ariel Juodziukynas   

[Build a Minimal Feature Flags Manager in Under An Hour](https://remimercier.com/minimal-feature-flags-manager/) — Feature flags provide a neat way to enable/disable potentially in-progress or prototype features for subsets of your users. Want to roll your own such system for a Rails app? It’s possible to do without much hassle. 

Remi Mercier   

[Build Time Series Data Apps with Ruby and InfluxDB](https://www.%E2%80%8Binfluxdata.%E2%80%8Bcom/blog/getting-started-ruby-influxdb/?utm_source=vendor&utm_medium=referral&utm_campaign=2022-01-20_spnsr-nl_getting-started-ruby-influxdb_global&utm_content=rubyweekly) — Get InfluxDB set up and build your real-time app with this tutorial. 

InfluxData sponsor   

[Looking at Ruby's Splat Operator](https://thoughtbot.com/blog/ruby-splat-operator) — A nice summary of what the operator does and why it can be confusing (as the author notes, _“it does two things that are the exact opposite of each other”_). 

Sami Birnbaum (thoughtbot)   

[How PlanetScale's Rails Test Suite Runs in 1 Minute on Buildkite](https://planetscale.com/blog/how-our-rails-test-suite-runs-in-1-minute-on-buildkite) — Essentially running a LOT of parallel workers and making sure test data was as efficient as possible – meaning you could do this, too. 

Mike Coutermarsh   

[Maintainable Rails System Tests with Page Objects](https://nts.strzibny.name/rails-system-tests-page-objects/) — An interesting way to clean up system tests with classes that represent each page that has some nice maintainability examples. 

Josef Strzibny   

[What You Can Learn by Merely Writing a Programming Language Changelog](https://zverok.github.io/blog/2022-01-06-changelog.html) — We linked to Victor’s excellent [Ruby 3.1 changelog](https://rubyreferences.github.io/rubychanges/3.1.html) two weeks ago. Now he reflects on what he learned, loved, and loathed in creating it. 

Victor Shepelev   

[Stop Paying Tech Debts, Start Maintaining Code](https://blog.testdouble.com/posts/2022-01-20-stop-paying-debts-start-maintaining-code/) — _“Every time you touch some code, clean something up.”_ 

Jesse O'Brien   

[Everything You Need (Nothing You Don't) to Build Video for Ruby](https://get.mux.com/3mwSSfL) 

Mux sponsor   

▶[Discussing WNB.rb with Emily Giurleo and Jemma Issroff](https://share.transistor.fm/s/15fa80be) — [WNB.rb](https://twitter.com/wnb_rb) is a Ruby community and meetup focused on women and non-binary folks and you can learn more about it in this show. 

Remote Ruby podcast   

[Five Easy to Miss PostgreSQL Query Performance Bottlenecks](https://pawelurbanek.com/postgresql-query-bottleneck) 
Paweł Urbanek   

[Configuring Rails System Tests for Headless and 'Headfull' Browsers](https://nts.strzibny.name/rails-system-tests-headless/) 
Josef Strzibny  

🛠 Code & Tools  

[JRuby 9.3.3.0 Released (Now with M1 Support)](https://www.jruby.org/2022/01/19/jruby-9-3-3-0.html) — The latest Ruby 2.6.x compatible release of the popular JVM-based Ruby implementation. The big news is added support for M1 processors, a.k.a. Apple Silicon. 

JRuby Core Team   

[Commontator 7.0: A Rails Engine for Comments](https://github.com/lml/commontator) — As an engine it provides its own models, views and controllers which you can then customize to your own commenting needs. 

Learning Machines Lab   

[online_migrations: Catch Unsafe Postgres Migrations in Development and Run Them Easier in Production](https://github.com/fatkodima/online_migrations) — Writing safe migrations can be difficult, especially at scale and in production, so this gem will stop problematic migrations from running and supply suggestions on how to run them safely. 

Dima Fatko   

[Reek 6.1: A High Level 'Code Smell' Detector for Ruby Code](https://github.com/troessner/reek) 
Timo Rößner       

💡**Tip of the Week** 

   

## `File` Methods: Part One 

Many of us are familiar with how to move around different directories or files when we're using our favorite editors. Our Ruby programs, or gems we use, often need to do similar movements to different directories, or to load different files. How can Ruby programs know which directories a certain file is in, or load other files? 

### [`__FILE__`](https://ruby-doc.org/core-3.1.0/doc/keywords_rdoc.html) 

For starters, `__FILE__` is a Ruby constant which gives us a String represenation of the path to the current file, from where it was called. For instance, if we have a file `example.rb` which looks like this: 

```
puts __FILE__
``` 

and I run it, I'll get 

```
$ ruby example.rb
example.rb
``` 

If we move one directory up though, so that `example.rb` is now in `ruby_weekly/example.rb`, and run it, we'll see the path including the `ruby_weekly` directory: 

```
$ ruby ruby_weekly/example.rb
ruby_weekly/example.rb
``` 

What if we need the full filepath of a file on a machine, not just the one we're running from? 

### [`File.expand_path`](https://ruby-doc.org/core-3.1.0/File.html#method-c-expand_path) 

`File.expand_path` will give us the full filepath. For instance, if we change `example.rb` to look like this: 

```
puts File.expand_path(__FILE__)
``` 

and run it, we'll see 

```
$ ruby ruby_weekly/example.rb
/Users/jemmaissroff/ruby_weekly/example.rb
``` 

This week's tip is laying the groundwork for us to dig into `File.join` and `File.dirname` (including a new Ruby 3.1 arg) next week!    

This week’s tip was written by [Jemma Issroff](https://twitter.com/jemmaissroff).          

Curated by [Peter Cooper](https://twitter.com/peterc), [Glenn Goodrich](https://twitter.com/ruprict) and [Cooperpress](https://cooperpress.com/). 

[Change your email address](https://rubyweekly.com/edit_subscription/*|UID|*) or[Stop getting this newsletter](https://rubyweekly.com/leave/*|UID|*) 

© Cooper Press Ltd · Fairfield Enterprise Centre, Louth, LN11 0LS, United Kingdom
