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 of rb_call
Search
Yohsuke Murase
January 17, 2017
Programming
0
280
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
Successful social norms with ternary reputation for indirect reciprocity
yohm
0
280
Friendly-rivalry strategies for general n-person public goods game
yohm
1
200
Deep Learning Exploration of Agent-Based Social Network Model Parameters
yohm
0
220
Five rules for friendly rivalry in direct reciprocity
yohm
0
88
Automata representation of successful strategies for social dilemmas
yohm
0
42
Structural transition in social networks: the role of homophily
yohm
0
130
OACIS hands-on tutorial
yohm
2
400
Conservation of population size is required for self-organized criticality in evolution models
yohm
0
65
Successful Strategies in the Tragedy of the Commons
yohm
0
520
Other Decks in Programming
See All in Programming
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
370
FigmaとPHPで作る1ミリたりとも表示崩れしない最強の帳票印刷ソリューション
ttskch
43
19k
新宿ダンジョンを可視化してみた
satoshi7190
2
250
MetricKitで予期せぬ終了を検知する話 / Detect unexpected termination with MetricKit
nekowen
1
180
⼤規模⾔語モデルの拡張(RAG)が 終わったかも知れない件について
nearme_tech
23
15k
Ruby Pattern Matching
bkuhlmann
0
930
Azure OpenAI Serviceのプロンプトエンジニアリング入門
tomokusaba
3
690
Git Lint
bkuhlmann
4
750
障害対応を起点としたもっといい開発と運用のサイクル作りのためにできること / Hatena Enginner Seminar #29
polamjag
0
120
Micro Frontends for Java Microservices - Devnexus 2024
mraible
PRO
0
490
try!Swift Tokyo 2024 参加報告 LT
akidon0000
1
220
ONE WEDGE_company_guide
1wedge_one
0
470
Featured
See All Featured
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
The Pragmatic Product Professional
lauravandoore
25
5.8k
Embracing the Ebb and Flow
colly
80
4.1k
What the flash - Photography Introduction
edds
64
11k
Six Lessons from altMBA
skipperchong
21
3k
Teambox: Starting and Learning
jrom
128
8.4k
Code Review Best Practice
trishagee
55
15k
Design by the Numbers
sachag
274
18k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
116
18k
Ruby is Unlike a Banana
tanoku
96
10k
Building Applications with DynamoDB
mza
88
5.6k
GitHub's CSS Performance
jonrohan
1025
450k
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!