Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Going Native with FFI
Search
Juan Carlos Ruiz González
September 20, 2019
Programming
330
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Going Native with FFI
Slides of my Talk given at RubyConf Colombia 2019
Juan Carlos Ruiz González
September 20, 2019
More Decks by Juan Carlos Ruiz González
See All by Juan Carlos Ruiz González
Por qué elegir Rails en 2024
juancrg90
0
23
Surviving to third-party integrations - Ruby Peru Meetup
juancrg90
0
150
Going Native With FFI - Euruko 2021
juancrg90
0
68
Ecommerce en Rails con Solidus
juancrg90
0
130
Other Decks in Programming
See All in Programming
Findy - エンジニア向け会社紹介/Findy Company Deck
findyinc
6
400k
機械に任せるテスト、人が見るテスト ⽣成AIで引き直した、運⽤保守フェーズの線引き
dske104
0
190
Agentic Software Factoryに、すごく賢いIF文を。 / super smart IF statement into the Agentic Software Factory.
rkaga
8
2.2k
作って学ぶSpring BootのAuto Configuration / JJUG Night Seminar 2026-10-19
rshindo
0
150
ソニーのクラウド共通基盤の変遷とAI時代の開発スタイルに合わせた進化 / The Journey of Sony’s Common Cloud Platform and Its Evolution for AI-Native Development
kenjiyoneyama
0
270
Web Framework Benchmark Battle 2026, Any%
a_matsuda
2
2.3k
Unity6 URPによる海底をテーマにしたVJシステムの解説 | Unity Shader 完全に理解した 勉強会
gam0022
0
370
[ハンズオン]AIへの指示だけで「五目並べ」を作ってみよう
satoshi256kbyte
1
380
S3 TablesのIcebergデータに、AIエージェントからアクセスしてみた / 20261016developersio2026joetsu-accessing-iceberg-in-s3tables-via-agent
kasacchiful
PRO
0
160
Workers Cache を知る
syumai
0
370
Railsバージョンを4倍にした話
optim
0
430
Agents on Rails - Rails at Scale 2026
irinanazarova
0
560
Featured
See All Featured
We Are The Robots
honzajavorek
0
400
Darren the Foodie - Storyboard
khoart
PRO
4
4k
ラッコキーワード サービス紹介資料
rakko
1
5.4M
Lessons Learnt from Crawling 1000+ Websites
charlesmeaden
PRO
1
1.6k
How Software Deployment tools have changed in the past 20 years
geshan
2
35k
Information Architects: The Missing Link in Design Systems
soysaucechin
1
1.2k
Become a Pro
speakerdeck
PRO
31
6.3k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
123
22k
Deep Space Network (abreviated)
tonyrice
0
370
Designing Powerful Visuals for Engaging Learning
tmiket
1
610
SEO in 2025: How to Prepare for the Future of Search
ipullrank
3
3.9k
How to Think Like a Performance Engineer
csswizardry
28
2.9k
Transcript
GOING NATIVE WITH FFI Juan C. Ruiz
❏ Former software engineer @ MagmaLabs ❏ Remote work advocate
❏ RubyMe Q2 mentor ❏ I ❤ Open source @JuanCrg90
@JuanCrg90 Heroes' Causeway Arch Leon Guanajuato Photo By @marianozka
@JuanCrg90
@JuanCrg90
What are the options that we have to manage native
code on Ruby? @JuanCrg90
MKMF @JuanCrg90
@JuanCrg90 mkmf.rb is used by Ruby C extensions to generate
a Makefile which will correctly compile and link the C extension to Ruby and a third-party library.
library.h library.c @JuanCrg90
my_ruby_ext.c @JuanCrg90
extconf.rb @JuanCrg90
@JuanCrg90
@JuanCrg90
Pros: - We can use C functions in our Ruby
Code - We take advantage of the existing ruby.h library to create the extension Cons: - We need to add extra C code to create the bindings - This solution only works in MRI @JuanCrg90
FFI @JuanCrg90
A foreign function interface (FFI) is a mechanism by which
a program written in one programming language can call routines or make use of services written in another. @JuanCrg90
@JuanCrg90
Pros: - We don’t need to add additional C code
- An FFI extension is multi-platform and multi-implementation Cons: - Complex macros are difficult to maintain - Same for callback functions @JuanCrg90
PGM IMAGES @JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
@JuanCrg90
Conclusion @JuanCrg90
- https://github.com/JuanCrg90/my_ruby_ext - https://github.com/JuanCrg90/pgm_ffi @JuanCrg90
THANKS @JuanCrg90