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
350
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
83
Successful social norms with ternary reputation for indirect reciprocity
yohm
0
380
Friendly-rivalry strategies for general n-person public goods game
yohm
1
280
Deep Learning Exploration of Agent-Based Social Network Model Parameters
yohm
0
300
Five rules for friendly rivalry in direct reciprocity
yohm
0
120
Automata representation of successful strategies for social dilemmas
yohm
0
56
Structural transition in social networks: the role of homophily
yohm
0
170
OACIS hands-on tutorial
yohm
2
480
Conservation of population size is required for self-organized criticality in evolution models
yohm
0
89
Other Decks in Programming
See All in Programming
技術を根付かせる / How to make technology take root
kubode
1
250
時計仕掛けのCompose
mkeeda
1
310
SwiftUI Viewの責務分離
elmetal
PRO
2
250
PHP ステートレス VS ステートフル 状態管理と並行性 / php-stateless-stateful
ytake
0
110
第3回関東Kaggler会_AtCoderはKaggleの役に立つ
chettub
3
1.1k
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
200
GoとPHPのインターフェイスの違い
shimabox
2
200
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
DRFを少しずつ オニオンアーキテクチャに寄せていく DjangoCongress JP 2025
nealle
2
170
プログラミング言語学習のススメ / why-do-i-learn-programming-language
yashi8484
0
140
Serverless Rust: Your Low-Risk Entry Point to Rust in Production (and the benefits are huge)
lmammino
1
140
楽しく向き合う例外対応
okutsu
0
430
Featured
See All Featured
StorybookのUI Testing Handbookを読んだ
zakiyama
28
5.5k
Designing for humans not robots
tammielis
250
25k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
45
9.4k
Measuring & Analyzing Core Web Vitals
bluesmoon
6
250
Into the Great Unknown - MozCon
thekraken
35
1.6k
Navigating Team Friction
lara
183
15k
The Power of CSS Pseudo Elements
geoffreycrofte
75
5.5k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
100
18k
How to train your dragon (web standard)
notwaldorf
91
5.8k
GitHub's CSS Performance
jonrohan
1030
460k
Music & Morning Musume
bryan
46
6.4k
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!