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
Yohsuke Murase
January 17, 2017
Programming
0
400
call Ruby methods from Python - An introduction of rb_call
Yohsuke Murase
January 17, 2017
Tweet
Share
More Decks by Yohsuke Murase
See All by Yohsuke Murase
mathematics of indirect reciprocity
yohm
1
340
Successful social norms with ternary reputation for indirect reciprocity
yohm
0
480
Friendly-rivalry strategies for general n-person public goods game
yohm
1
350
Deep Learning Exploration of Agent-Based Social Network Model Parameters
yohm
0
370
Five rules for friendly rivalry in direct reciprocity
yohm
0
140
Automata representation of successful strategies for social dilemmas
yohm
0
98
Structural transition in social networks: the role of homophily
yohm
0
220
OACIS hands-on tutorial
yohm
2
550
Conservation of population size is required for self-organized criticality in evolution models
yohm
0
140
Other Decks in Programming
See All in Programming
野球解説AI Agentを開発してみた - 2026/02/27 LayerX社内LT会資料
shinyorke
PRO
0
370
Everything Claude Code OSS詳細 — 5層構造の中身と導入方法
targe
0
160
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
270
OTP を自動で入力する裏技
megabitsenmzq
0
130
守る「だけ」の優しいEMを抜けて、 事業とチームを両方見る視点を身につけた話
maroon8021
3
1.5k
Strategy for Finding a Problem for OSS: With Real Examples
kibitan
0
120
Mastering Event Sourcing: Your Parents Holidayed in Yugoslavia
super_marek
0
130
Tamach-sre-3_ANDPAD-shimaison93
mane12yurks38
0
160
Linux Kernelの1文字のミスで 権限昇格ができた話
rqda
0
2.2k
AI活用のコスパを最大化する方法
ochtum
0
340
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
260
What Spring Developers Should Know About Jakarta EE
ivargrimstad
0
730
Featured
See All Featured
Are puppies a ranking factor?
jonoalderson
1
3.2k
Code Reviewing Like a Champion
maltzj
528
40k
Organizational Design Perspectives: An Ontology of Organizational Design Elements
kimpetersen
PRO
1
650
Building Experiences: Design Systems, User Experience, and Full Site Editing
marktimemedia
0
460
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
47
8k
We Have a Design System, Now What?
morganepeng
55
8k
WCS-LA-2024
lcolladotor
0
500
30 Presentation Tips
portentint
PRO
1
260
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
55
3.3k
Building Applications with DynamoDB
mza
96
7k
エンジニアに許された特別な時間の終わり
watany
106
240k
Why Mistakes Are the Best Teachers: Turning Failure into a Pathway for Growth
auna
0
100
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!