Upgrade to PRO for Only $50/Year—Limited-Time Offer! 🔥
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
1.4k
A PoC-ish Trick: LLVM IR Generation with Ruby
A Lightning Talk at RubyConf 2016
remore
November 11, 2016
Tweet
Share
More Decks by remore
See All by remore
Turning CDN edge into a Rack web server with ruby.wasm
remore
0
640
Prototyping Kubernetes CRI With Ruby and gRPC
remore
3
1.2k
How I made a pure-Ruby word2vec program more than 3x faster
remore
3
3.1k
Code, Arguments and Startups
remore
0
1.8k
詳解🔍Burn🔥
remore
4
5.4k
DockerCon 2015 Quick Recap
remore
0
450
dockerfileview: A Dockerfile viewer to trace ancestry of the base image
remore
2
450
Burn: 8-Bit Game Development With Ruby
remore
3
1k
Other Decks in Technology
See All in Technology
チーリンについて
hirotomotaguchi
6
2.1k
文字列の並び順 / Unicode Collation
tmtms
3
610
ペアーズにおけるAIエージェント 基盤とText to SQLツールの紹介
hisamouna
0
420
AWS Security Agentの紹介/introducing-aws-security-agent
tomoki10
0
320
子育てで想像してなかった「見えないダメージ」 / Unforeseen "hidden burdens" of raising children.
pauli
2
300
CARTAのAI CoE が挑む「事業を進化させる AI エンジニアリング」 / carta ai coe evolution business ai engineering
carta_engineering
0
2k
Snowflakeでデータ基盤を もう一度作り直すなら / rebuilding-data-platform-with-snowflake
pei0804
6
1.6k
AI時代の新規LLMプロダクト開発: Findy Insightsを3ヶ月で立ち上げた舞台裏と振り返り
dakuon
0
230
AWS re:Invent 2025~初参加の成果と学び~
kubomasataka
0
140
regrowth_tokyo_2025_securityagent
hiashisan
0
260
Sansanが実践する Platform EngineeringとSREの協創
sansantech
PRO
2
940
Power of Kiro : あなたの㌔はパワステ搭載ですか?
r3_yamauchi
PRO
0
180
Featured
See All Featured
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
150
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
170
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
83
What Being in a Rock Band Can Teach Us About Real World SEO
427marketing
0
140
Noah Learner - AI + Me: how we built a GSC Bulk Export data pipeline
techseoconnect
PRO
0
69
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
286
14k
Mind Mapping
helmedeiros
PRO
0
35
Data-driven link building: lessons from a $708K investment (BrightonSEO talk)
szymonslowik
0
840
WCS-LA-2024
lcolladotor
0
380
My Coaching Mixtape
mlcsv
0
6
Applied NLP in the Age of Generative AI
inesmontani
PRO
3
1.9k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
130
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!