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
call Ruby methods from Python - An introduction...
Search
Sponsored
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
Yohsuke Murase
January 17, 2017
Programming
400
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
call Ruby methods from Python - An introduction of rb_call
Yohsuke Murase
January 17, 2017
More Decks by Yohsuke Murase
See All by Yohsuke Murase
mathematics of indirect reciprocity
yohm
1
470
Successful social norms with ternary reputation for indirect reciprocity
yohm
0
520
Friendly-rivalry strategies for general n-person public goods game
yohm
1
360
Deep Learning Exploration of Agent-Based Social Network Model Parameters
yohm
0
400
Five rules for friendly rivalry in direct reciprocity
yohm
0
170
Automata representation of successful strategies for social dilemmas
yohm
0
120
Structural transition in social networks: the role of homophily
yohm
0
250
OACIS hands-on tutorial
yohm
2
580
Conservation of population size is required for self-organized criticality in evolution models
yohm
0
150
Other Decks in Programming
See All in Programming
一参加者から『中の人』へ 〜全通PHPerがブースに立って学んだ、カンファレンスを100倍楽しむコツ〜
wp_daisuke
0
120
自分的「カンファレンスの楽しみ方」
syumai
0
190
LLMは4年分のCompose移行を再現できるのか?実プロダクト279件のXMLで探る自動化の境界線
makun
0
420
Claude Codeを組織的に動かして月400PRを実現した話
happy_ryo
0
260
型解析で実現する Go の言語内 DSL / Conference に Go! タイムテーブルの歩き方 for Gophers
mazrean
0
130
新人はどこまで自力でやり、どこからAIに頼るべきか/エンジニア育成に向き合う_先輩たちの悩みと知見共有会
toppan_digital_dev
1
560
What We Talk About When We Talk About XP
m_seki
2
360
Seeing Through Serverless: Observability for AWS Lambda with ADOT and CloudWatch Application Signals
seike460
PRO
1
120
「つくるAI」だけではバグは見つからない ~テストに必要な「見つけるAI」を分離させる戦略~
mfunaki
0
230
Building an Out-of-Order CPU
latte72
0
680
Hello, Hiroshima Geospatial Data! — Exploring DoboX with Python
ra0kley
0
170
異なる設計思想のフレームワークを経験して得た学び
amekuhideki
2
1.5k
Featured
See All Featured
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2.1k
Crafting Experiences
bethany
1
290
Dominate Local Search Results - an insider guide to GBP, reviews, and Local SEO
greggifford
PRO
0
320
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
16
2.1k
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
3k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
2
560
WENDY [Excerpt]
tessaabrams
12
39k
How STYLIGHT went responsive
nonsquared
100
6.3k
The Curse of the Amulet
leimatthew05
2
14k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1.2k
Technical Leadership for Architectural Decision Making
baasie
3
550
The Curious Case for Waylosing
cassininazir
1
500
Transcript
1ZUIPO͔Β3VCZͷϥΠϒϥ Ϧ͕͑Δ SC@DBMMͷհ @yohm13
About Me • ଜ༸հ • twitter : @yohm13 • github:
yohm • ৬ۀ : ݚڀऀ • ౷ܭཧ • agent simulation • Ruby, C++ • ࠷ۙPython࢝Ί·ͨ͠
rb_callͱ ͨͱ͑͜ΜͳrubyͷεΫϦϓτ͕͋Δͱ͢Δ Python͔ΒRubyͷϝιου͕͑ΔϥΠϒϥϦ https://github.com/yohm/rb_call
Python Ruby Python͔Β͜Μͳ෩ʹݺΔ
͏গ͠ෳࡶͳྫ generatorOK Ruby Python
ྫ֎औΕΔ Ruby Python
Railsͱͷ࿈ܞ γϛϡϨʔγϣϯδϣϒཧRailsΞϓϦ OACIS https://github.com/crest-cassia/oacis • numpy • matplotlib • jupyter
• pandas
SC@DBMMͷΈ
MessagePack-RPC MessagePack-RPCΛར༻ 1ZUIPO 3VCZ https://github.com/msgpack-rpc/msgpack-rpc ϝιου໊ + Ҿ ฦΓ ༷ʑͳݴޠͰ࣮͕ެ։͞Ε͍ͯΔ
1ZUIPO 3VCZ ϝιου໊ + Ҿ ฦΓ
ϝιουνΣʔϯͰ͖ͳ͍ Mongoid::CriteriaΫϥεͷΠϯελϯε ྫ 1ZUIPO 3VCZ ϝιου໊ + Ҿ ฦΓ
ղܾࡦ 1ZUIPO 3VCZ ϝιου໊ + Ҿ ฦΓ ΦϒδΣΫτID ΠϯελϯεRubyϓϩηεͷதͰอ࣋ͨ͠·· ΦϒδΣΫτͷIDΛฦ͢
JOTUBODF RubyObject RubyͷobjectͷࢀরΛද͢ɻϝϯόʔʹidΛ࣋ͭ
“where”, {“price”: 1000} ΦϒδΣΫτID RubyObject Mongoid::Criteria instance Python Ruby object
id, “asc”, “author” ΦϒδΣΫτID RubyObject Mongoid::Criteria instance Python Ruby Mongoid::Criteria instance RubyObject
PythonͱRubyͷରԠؔ __str__ __repr__ __eq__ __dir__ __iter__ __len__ __getattr__ __next__ to_s
inspect == public_methods each size method_missing next PythonͷRubyObjectΫϥεʹ͜ΕΒͷϝιουΛఆٛ͢Ε ͍͍ͩͨಈ༷͘ʹͳΔ
ଞʹ • MessagePackͷextension type Λ͏ • ࢀরͷΛ͑ͯϝϞϦϦʔΫ͠ͳ͍Α͏ʹ͢Δ • generatorରԠ ࣮࣭Python
130ߦ, Ruby 80ߦͷඇৗʹখ͞ͳϥΠϒϥϦʹ Python,RubyͱʹॊೈͰɺޓ͍ʹࣅͨݴޠ pipͳͲͰ؆୯ʹར༻Ͱ͖Δ༷ʹ͢Δͷ͕ࠓޙͷ՝
https://github.com/yohm/rb_call http://qiita.com/yohm/items/e4d6759e1783d382b61b
Thank you!