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
84
Successful social norms with ternary reputation for indirect reciprocity
yohm
0
390
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
310
Five rules for friendly rivalry in direct reciprocity
yohm
0
120
Automata representation of successful strategies for social dilemmas
yohm
0
57
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
15分で学ぶDuckDBの可愛い使い方 DuckDBの最近の更新
notrogue
1
220
2025.2.14_Developers Summit 2025_登壇資料
0101unite
0
130
『GO』アプリ データ基盤のログ収集システムコスト削減
mot_techtalk
0
130
Datadog DBMでなにができる? JDDUG Meetup#7
nealle
0
120
Pulsar2 を雰囲気で使ってみよう
anoken
0
250
Amazon ECS とマイクロサービスから考えるシステム構成
hiyanger
2
580
SwiftUI Viewの責務分離
elmetal
PRO
2
260
XStateを用いた堅牢なReact Components設計~複雑なClient Stateをシンプルに~ @React Tokyo ミートアップ #2
kfurusho
1
950
Unity Android XR入門
sakutama_11
0
170
もう僕は OpenAPI を書きたくない
sgash708
5
1.8k
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
230
Code smarter, not harder - How AI Coding Tools Boost Your Productivity | Angular Meetup Berlin
danielsogl
0
100
Featured
See All Featured
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
420
Thoughts on Productivity
jonyablonski
69
4.5k
Facilitating Awesome Meetings
lara
52
6.2k
Optimising Largest Contentful Paint
csswizardry
34
3.1k
Speed Design
sergeychernyshev
27
800
It's Worth the Effort
3n
184
28k
Building a Scalable Design System with Sketch
lauravandoore
461
33k
GraphQLの誤解/rethinking-graphql
sonatard
68
10k
Fireside Chat
paigeccino
34
3.2k
Mobile First: as difficult as doing things right
swwweet
223
9.4k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
30
2.2k
Visualization
eitanlees
146
15k
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!