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
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
650
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.2k
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
Oracle Database@Google Cloud:サービス概要のご紹介
oracle4engineer
PRO
1
790
Strands AgentsのEvaluatorをLangfuseにぶち込んでみた
andoooooo_bb
0
100
会社紹介資料 / Sansan Company Profile
sansan33
PRO
11
390k
2025年のデザインシステムとAI 活用を振り返る
leveragestech
0
530
意外と知らない状態遷移テストの世界
nihonbuson
PRO
1
350
20251203_AIxIoTビジネス共創ラボ_第4回勉強会_BP山崎.pdf
iotcomjpadmin
0
150
Bedrock AgentCore Evaluationsで学ぶLLM as a judge入門
shichijoyuhi
2
300
通勤手当申請チェックエージェント開発のリアル
whisaiyo
3
620
Entity Framework Core におけるIN句クエリ最適化について
htkym
0
140
"人"が頑張るAI駆動開発
yokomachi
1
660
普段使ってるClaude Skillsの紹介(by Notebooklm)
zerebom
8
2.6k
Claude Skillsの テスト業務での活用事例
moritamasami
1
120
Featured
See All Featured
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
54
48k
Design of three-dimensional binary manipulators for pick-and-place task avoiding obstacles (IECON2024)
konakalab
0
320
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
So, you think you're a good person
axbom
PRO
0
1.9k
Refactoring Trust on Your Teams (GOTO; Chicago 2020)
rmw
35
3.3k
Building an army of robots
kneath
306
46k
Ruling the World: When Life Gets Gamed
codingconduct
0
120
Skip the Path - Find Your Career Trail
mkilby
0
28
Rails Girls Zürich Keynote
gr2m
95
14k
Building Adaptive Systems
keathley
44
2.9k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
400
Claude Code のすすめ
schroneko
67
210k
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!