Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
A PoC-ish Trick: LLVM IR Generation with Ruby
Search
remore
November 11, 2016
Technology
1.4k
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
A PoC-ish Trick: LLVM IR Generation with Ruby
A Lightning Talk at RubyConf 2016
remore
November 11, 2016
More Decks by remore
See All by remore
Turning CDN edge into a Rack web server with ruby.wasm
remore
0
710
Prototyping Kubernetes CRI With Ruby and gRPC
remore
3
1.3k
How I made a pure-Ruby word2vec program more than 3x faster
remore
3
3.3k
Code, Arguments and Startups
remore
0
1.8k
詳解🔍Burn🔥
remore
4
5.4k
DockerCon 2015 Quick Recap
remore
0
470
dockerfileview: A Dockerfile viewer to trace ancestry of the base image
remore
2
470
Burn: 8-Bit Game Development With Ruby
remore
3
1.1k
Other Decks in Technology
See All in Technology
Amazon EVS で VCF 9.0 / 9.1 のサポート開始まとめ
mtoyoda
0
280
なぜ人は自分のプロジェクトを 「なんちゃってアジャイル」と 自嘲するのか
kozotaira
0
270
プロンプト_きのこカンファレンス2026_LT
yurufuwahealer
0
150
グローバルチームと挑むプロダクト開発
sansantech
PRO
1
170
実装だけじゃない! CCA-F取得エンジニアが教えるClaude Code開発プロセス活用術
diggymo
2
490
勉強会企画をアプリで構造化してみた 〜そこで見えた、AIとの付き合い方〜 / I've structured a study group plan using an app.
pauli
0
340
金融の未来を考える / Thinking About the Future of Finance
ks91
PRO
0
180
Docker Desktop不要の時代が来る? WSL標準の「wslc」で Linuxコンテナを動かしてみた.
ueponx
0
850
Road to SRE NEXTの今までとこれから
hiroyaonoe
0
260
Oracle Exadata Database Service on Cloud@Customer X11M (ExaDB-C@C) サービス概要
oracle4engineer
PRO
2
8.4k
SRE本の知られざる名シーン / The Hidden Gems of Google SRE Book
nari_ex
1
250
AWS Blocks を触ってみた/first-tach-aws-blocks
fossamagna
2
150
Featured
See All Featured
Side Projects
sachag
455
43k
Site-Speed That Sticks
csswizardry
13
1.2k
エンジニアに許された特別な時間の終わり
watany
107
250k
How GitHub (no longer) Works
holman
316
150k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
34
2.8k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.3k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
230
HTML-Aware ERB: The Path to Reactive Rendering @ RubyCon 2026, Rimini, Italy
marcoroth
2
320
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
870
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
62k
Building AI with AI
inesmontani
PRO
1
1.1k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
630
Transcript
A PoC-ish Trick: LLVM IR Generation with Ruby A Lightning
Talk at RubyConf 2016 Kei Sawada (@remore)
None
a modern, fast, and open source language for data science
and technical computing
Julia is 4 years old young Good performance, as fast
as C Dynamic typing Julia has Capability to call C functions directly without wrappers or special APIs a compiler that used LLVM to translate Julia programs into ef cient executable code
In short,
Write some Julia code then you will get LLVM IR
without hassle
debussy:~ guest$ julia _ _ _ _(_)_ | A fresh
approach to technical computin (_) | (_) (_) | Documentation: http://docs.julialang.o _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.6 (2016-06-19 17:16 UTC) _/ |\__'_|_|_|\__'_| | |__/ | x86_64-apple-darwin15.5.0 julia>
debussy:~ guest$ julia _ _ _ _(_)_ | A fresh
approach to technical computin (_) | (_) (_) | Documentation: http://docs.julialang.o _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.6 (2016-06-19 17:16 UTC) _/ |\__'_|_|_|\__'_| | |__/ | x86_64-apple-darwin15.5.0 julia> function hello() "rubyconf" end hello (generic function with 1 method) julia>
debussy:~ guest$ julia _ _ _ _(_)_ | A fresh
approach to technical computin (_) | (_) (_) | Documentation: http://docs.julialang.o _ _ _| |_ __ _ | Type "?help" for help. | | | | | | |/ _` | | | | |_| | | | (_| | | Version 0.4.6 (2016-06-19 17:16 UTC) _/ |\__'_|_|_|\__'_| | |__/ | x86_64-apple-darwin15.5.0 julia> function hello() "rubyconf" end hello (generic function with 1 method) julia> hello() "rubyconf" julia>
julia> code_llvm(hello, ()) define %jl_value_t* @julia_hello_21549() { top: ret %jl_value_t*
inttoptr (i64 4447575696 to %jl_value_t*) } julia>
julia> code_llvm(hello, ()) define %jl_value_t* @julia_hello_21549() { top: ret %jl_value_t*
inttoptr (i64 4447575696 to %jl_value_t*) } julia> code_native(hello, ()) .section __TEXT,__text,regular,pure_instructions Filename: none Source line: 2 pushq %rbp movq %rsp, %rbp movabsq $4447575696, %rax ## imm = 0x109189E90 Source line: 2 popq %rbp ret julia>
OK Julia is a thing But we are in
None
What if
You can write some Ruby code which can be translated
into Julia where you can get LLVM IR easily?
Ruby -> Julia -> LLVM IR
None
Julializer Allow you to convert your arbitrary Ruby code into
Julia code
Time to DEMO!
For more examples and attempts, check out: github.com/remore/julializer github.com/remore/virtual_module Thanks!