---
title: "A proposed new syntax for struct literals"
publication: "Ruby Weekly"
issue: 508
published_at: "2020-07-02"
canonical_url: "https://rubyweekly.com/issues/508"
---

Plus more of this week's Ruby news, views, and libraries.       

#508 — July 2, 2020 

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

Ruby Weekly 

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

[A Syntax for Anonymous Struct Literals](https://bugs.ruby-lang.org/issues/16986) — A proposed new Ruby feature where `${a:1, b:2}` would be roughly equivalent to `Struct.new(kw.keys).new(kw.values)` (where `kw` is `{a:1, b:2}`) which may be more practical in situations where you’d use a hash now. There’s already [a pull request](https://github.com/ruby/ruby/pull/3259) to bring this to Ruby. 

Koichi Sasada   

[Writing Better, Type-Safe Code with Sorbet](https://engineering.shopify.com/blogs/engineering/writing-better-type-safe-code-with-sorbet) — The initial Sorbet hype has abated, so now we’re into the Real World Examples phase. Here are four such examples that had me wishing I had interned at Shopify. 

Shopify Engineering   [![\](https://copm.s3.amazonaws.com/4bedb9de.png)](https://semaphoreci.com/resources/cicd-docker-kubernetes#utm_source=rubyweekly&utm_medium=cpc&utm_campaign=Kubernetes-20200702) 

[CI/CD with Docker and Kubernetes eBook by Semaphore](https://semaphoreci.com/resources/cicd-docker-kubernetes#utm_source=rubyweekly&utm_medium=cpc&utm_campaign=Kubernetes-20200702) — Learn how to deliver cloud-native applications at high velocity. 

Semaphore sponsor    

[AnyCable 1.0: Four Years of Real-Time Web with Ruby and Go](https://evilmartians.com/chronicles/anycable-1-0-four-years-of-real-time-web-with-ruby-and-go) — Built as an add-on to Rails ActionCable, AnyCable uses Go to handle WebSockets while remaining compatible with the core framework. It’s now production-ready and moving towards an ambitious v2. [GitHub repo](https://github.com/anycable/anycable). 

Martian Chronicles   

[Advanced Active Record: Using Subqueries in Rails](https://pganalyze.com/blog/active-record-subqueries-rails) — When your N+1 queries go beyond `includes`, understanding subqueries lets the database do the heavy lifting and minimizes round trips. Leigh goes through several real-world(ish) examples. 

Leigh Halliday  

💻 Jobs  

[Senior Software Engineer, Team Lead](http://www.framebridge.com/careers) — Got experience architecting Ruby/Rails projects? Join us and lead our product team, building web applications and integrations to help both our customers and employees. 

Framebridge   

[Find a Job Through Vettery](https://www.vettery.com/tech?utm_source=newsletter&utm_medium=cooper-rubyweekly&utm_term=tech&utm_content=grouped&utm_campaign=ad-77583) — Use Vettery to connect with growing tech teams at startups and Fortune 500 companies. 

Vettery  

ℹ️ _Interested in running a job listing in Ruby Weekly? There's [more info here](https://booking.cooperpress.com/jobs)_. 

📘 Articles & Tutorials  

[How GitLab Scaled Async Workload Processing with Sidekiq](https://about.gitlab.com/blog/2020/06/24/scaling-our-use-of-sidekiq/) — GitLab found Sidekiq to be a great tool for async processing until it couldn’t keep up.. but here’s how they got it back on track. (Their Sidekiq fleet is 26 servers with 158 CPUs between them, so GitLab’s problems are, let’s say, of a ‘certain scale.’) 

Rachel Nienaber (GitLab)   

[Troubleshooting Encoding Errors in Ruby](https://www.honeybadger.io/blog/troubleshooting-encoding-errors-in-ruby/) — Most of us probably don’t think about encoding until it breaks, so being aware of how to deal with common encoding errors is a good id\xCF\x88\xCF\x88. 

José M. Gilgado   

[The Ruby Spec Suite Compatibility Report](https://eregon.me/blog/2020/06/27/ruby-spec-compatibility-report.html) — ruby/spec is _the_ specification for Ruby compatibility targeted by all major interpreters. Here, Benoit tests TruffleRuby, JRuby, Opal, and Artichoke to see how they fare. 

Benoit Daloze   

[Why Pry Is One of the Most Important Tools a Rubyist Can Learn](https://www.honeybadger.io/blog/debugging-ruby-with-pry?utm_source=rubyweekly&utm_medium=email&utm_campaign=ruby) — From the Honeybadger Developer Blog featuring tutorials & good advice by the coolest error monitoring solution around. 😎 

Honeybadger sponsor   

[Rails and JavaScript: The Early Days](https://noelrap.substack.com/p/rails-and-javascript-part-1) — Noel (author of many Rails books, including one back in 2008) starts a series on the relationship between Rails and JavaScript. This first post covers pre-3.0 or, if you like, The RJS Days. 

Noel Rappin   

▶[Deploy Ruby on Rails on Google Cloud](https://www.youtube.com/watch?v=3d7xBvmu6Z4) — A handy intro if you’ve not seen GCP and Google App Engine before. 

nETSETOS       

🎧 Podcasts of the Week   

[Rails::Engine with Vladimir Dementyev](https://5by5.tv/rubyonrails/324) — Vladimir Dementyev is the author of [AnyCable](https://github.com/anycable/anycable), [test-prof](https://github.com/palkan/test-prof) and an advocate for building monoliths with Rails Engines. 

Ruby on Rails Podcast   

[MiniTest for Those Who RSpec](https://remoteruby.transistor.fm/83) — Two developers talk about MiniTest, RSpec, Tailwind CSS, factories, fixtures, Faker, Shoulda and a lot more besides. 

Remote Ruby    

🛠 Code and Tools  

[Graphiti: Add RESTful Graph APIs to Ruby Webapps](https://www.graphiti.dev/guides/) — Essentially a REST-flavored alternative to something like GraphQL which means you don’t need to leave behind the REST you know and love. To learn more, check out creator Lee Richmond’s [appearance on the Ruby Rogues podcast](https://devchat.tv/ruby-rogues/rr-462-graphiti-rest-and-graphql-with-lee-richmond/) this week. 

Lee Richmond   

[Diff::LCS: Generate Difference Sets Between Enumerable Sequences](https://github.com/halostatue/diff-lcs) — Uses the [Hunt–McIlroy](https://en.wikipedia.org/wiki/Hunt%E2%80%93Szymanski_algorithm) longest common subsequence (LCS) algorithm 

Austin Ziegler   

[Sidekiq 6.1: Simple, Efficient Background Processing for Ruby](https://github.com/mperham/sidekiq) — A new version of the perennially popular background jobs system. [sidekiq-statistic](https://github.com/davydovanton/sidekiq-statistic) is also worth checking out if you use Sidekiq as it provides a nice display of the statistics around your workers and jobs. 

Mike Perham   

[Speed Up Your Postgres Queries by 1000x. Learn How in This eBook](https://pganalyze.com/ebooks/optimizing-postgres-query-performance?utm_source=RubyWeeklySecondary07022020) 

pganalyze sponsor   

[GemUpdater: Update Gems in Your Gemfile and Fetch Their Changelogs](https://github.com/MaximeD/gem_updater) — The idea is that you don’t just want to update gems en masse, you want to know how they changed too. 

Maxime Demolin   

[Xlsxtream: A Fast, Streaming XLSX Spreadsheet Writer](https://github.com/felixbuenemann/xlsxtream) 

Felix Bünemann   

[Foreman 2.1: An Operations Manager for Your Apps and Servers](https://github.com/theforeman/foreman) — a complete lifecycle management tool for physical and virtual servers. Not to be confused with [the other Foreman](https://github.com/ddollar/foreman) that runs Procfile-based apps. 

The Foreman   

[JRuby 9.2.12.0 Released](https://github.com/jruby/jruby/releases/tag/9.2.12.0) 

JRuby Team         

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
