<!-- mobian-agent-page publisher="dailydev" canonical="https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0" -->

---
title: updating a c extension for a modern vm | daily.dev
description: Ruby's C extension API has stayed remarkably stable from version 2.0 to 4.0, and any random old 15+ year old extension likely works out of the box on the...
canonical: https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0
twitter:card: summary_large_image
twitter:site: @dailydotdev
og:type: website
og:site_name: daily.dev
og:title: updating a c extension for a modern vm | daily.dev
og:description: Ruby's C extension API has stayed remarkably stable from version 2.0 to 4.0, and any random old 15+ year old extension likely works out of the box on the...
og:url: https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0
og:image: https://api.daily.dev/og/posts/PIPkUZ9U0.png
og:image:alt: updating a c extension for a modern vm
og:image:width: 1200
og:image:height: 630
og:locale: en
---

> ## Documentation Index
> Fetch the complete documentation index at: https://daily.dev/llms.txt
> Use this file to discover all available pages before exploring further.

# updating a c extension for a modern vm

**[Ivo Anjo](https://daily.dev/sources/ivoanjo)** · 2 min read · 0 upvotes · 0 comments

## Summary

Ruby's C extension API has stayed remarkably stable from version 2.0 to 4.0, and any random old 15+ year old extension likely works out of the box on the latest Ruby. That stability has a cost: the VM bends over backwards to keep old APIs working, adding a lot of overhead that hurts performance. Ivo Anjo's research turned into a tiny doc that now lives as part of the official Ruby documentation, 'Tips for updating Ruby C extensions for efficiently using Ruby 4 VM APIs.' He also presented the topic at RubyKaigi 2026, with video and slides available.

## Full article

daily.dev links to this article rather than hosting it. Read it at the original source: <https://ivoanjo.me/blog/2026/09/23/updating-a-c-extension-for-a-modern-vm>

## Questions this post answers

### why are old Ruby C extensions slower on newer Ruby versions even though they still work

Old Ruby C extensions remain compatible because the Ruby VM bends over backwards to keep legacy C APIs working unchanged since Ruby 2.0, but that backward compatibility adds significant runtime overhead. This tradeoff means extensions written against 15-year-old APIs still run on Ruby 4.0, but they miss out on performance gains available through newer, more efficient VM APIs.

_Developers maintaining C extensions can track Ruby VM performance guidance like this on daily.dev._

### where can I find official guidance on writing efficient Ruby C extensions for Ruby 4

Official guidance is published as 'Tips for updating Ruby C extensions for efficiently using Ruby 4 VM APIs,' a document now included in the official Ruby documentation under doc/contributing. It resulted from research into how Ruby's C extension API constrains VM performance, and was also presented as a talk at RubyKaigi 2026 with accompanying slides and video.

_Anyone optimizing native extensions can keep up with Ruby VM API changes via daily.dev._

## Similar posts on daily.dev

- [Going beyond Ruby: Writing a simple C extension](https://daily.dev/posts/going-beyond-ruby-writing-a-simple-c-extension-wpjhkpncz) · RUBYLAND · 0 upvotes · 0 comments
- [FFI: How Ruby Talks to C](https://daily.dev/posts/ffi-how-ruby-talks-to-c-ziuiprg0q) · Ruby Flow · 0 upvotes · 0 comments
- [Ruby 4.0.5 Released](https://daily.dev/posts/ruby-4-0-5-released-twcsdi9wj) · Ruby · 1 upvotes · 0 comments
- [Ruby 4.0 and Ruby Box: What Changed and How to Upgrade Safely](https://daily.dev/posts/ruby-4-0-and-ruby-box-what-changed-and-how-to-upgrade-safely-kufntjlvw) · RUBYLAND · 0 upvotes · 0 comments

---

Tags: [#performance](https://daily.dev/tags/performance), [#ruby](https://daily.dev/tags/ruby)

[View this post on daily.dev](https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0)

```json
{"@context":"https://schema.org","@graph":[{"@type":"Organization","@id":"https://daily.dev/#organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180},"sameAs":["https://twitter.com/dailydotdev","https://github.com/dailydotdev","https://www.linkedin.com/company/daily-dev-ltd"]},{"@type":"WebSite","@id":"https://daily.dev/#website","url":"https://daily.dev","name":"daily.dev","publisher":{"@id":"https://daily.dev/#organization"},"potentialAction":{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https://daily.dev/search?q={search_term_string}"},"query-input":"required name=search_term_string"}}]}
{"@context":"https://schema.org","@type":"TechArticle","headline":"updating a c extension for a modern vm","url":"https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0","mainEntityOfPage":{"@type":"WebPage","@id":"https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0"},"datePublished":"2026-10-25T08:15:55.950Z","dateModified":"2026-10-25T08:22:02.658Z","description":"Ruby's C extension API has stayed remarkably stable from version 2.0 to 4.0, and any random old 15+ year old extension likely works out of the box on the...","image":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","thumbnailUrl":"https://media.daily.dev/image/upload/s--0_ODbtD2--/f_auto/v1722860399/public/Placeholder%2008","isAccessibleForFree":true,"articleSection":"Ivo Anjo","inLanguage":"en","publisher":{"@type":"Organization","name":"daily.dev","url":"https://daily.dev","logo":{"@type":"ImageObject","url":"https://daily.dev/apple-touch-icon.png","width":180,"height":180}},"author":{"@type":"Organization","name":"Ivo Anjo","logo":"https://media.daily.dev/image/upload/logos/placeholder.jpg","url":"https://daily.dev/sources/ivoanjo"},"commentCount":0,"discussionUrl":"https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0","interactionStatistic":[{"@type":"InteractionCounter","interactionType":{"@type":"LikeAction"},"userInteractionCount":0},{"@type":"InteractionCounter","interactionType":{"@type":"CommentAction"},"userInteractionCount":0}],"keywords":"performance,ruby","timeRequired":"PT2M"}
{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https://daily.dev"},{"@type":"ListItem","position":2,"name":"Ivo Anjo","item":"https://daily.dev/sources/ivoanjo"},{"@type":"ListItem","position":3,"name":"updating a c extension for a modern vm"}]}
{"@context":"https://schema.org","@type":"FAQPage","@id":"https://daily.dev/posts/updating-a-c-extension-for-a-modern-vm-pipkuz9u0#faq","mainEntity":[{"@type":"Question","name":"why are old Ruby C extensions slower on newer Ruby versions even though they still work","acceptedAnswer":{"@type":"Answer","text":"Old Ruby C extensions remain compatible because the Ruby VM bends over backwards to keep legacy C APIs working unchanged since Ruby 2.0, but that backward compatibility adds significant runtime overhead. This tradeoff means extensions written against 15-year-old APIs still run on Ruby 4.0, but they miss out on performance gains available through newer, more efficient VM APIs. Developers maintaining C extensions can track Ruby VM performance guidance like this on daily.dev."}},{"@type":"Question","name":"where can I find official guidance on writing efficient Ruby C extensions for Ruby 4","acceptedAnswer":{"@type":"Answer","text":"Official guidance is published as 'Tips for updating Ruby C extensions for efficiently using Ruby 4 VM APIs,' a document now included in the official Ruby documentation under doc/contributing. It resulted from research into how Ruby's C extension API constrains VM performance, and was also presented as a talk at RubyKaigi 2026 with accompanying slides and video. Anyone optimizing native extensions can keep up with Ruby VM API changes via daily.dev."}}]}
```

