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
330
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
360
Friendly-rivalry strategies for general n-person public goods game
yohm
1
260
Deep Learning Exploration of Agent-Based Social Network Model Parameters
yohm
0
280
Five rules for friendly rivalry in direct reciprocity
yohm
0
110
Automata representation of successful strategies for social dilemmas
yohm
0
53
Structural transition in social networks: the role of homophily
yohm
0
160
OACIS hands-on tutorial
yohm
2
450
Conservation of population size is required for self-organized criticality in evolution models
yohm
0
80
Successful Strategies in the Tragedy of the Commons
yohm
0
630
Other Decks in Programming
See All in Programming
ECS Service Connectのこれまでのアップデートと今後のRoadmapを見てみる
tkikuc
2
250
ペアーズにおけるAmazon Bedrockを⽤いた障害対応⽀援 ⽣成AIツールの導⼊事例 @ 20241115配信AWSウェビナー登壇
fukubaka0825
6
2k
Nurturing OpenJDK distribution: Eclipse Temurin Success History and plan
ivargrimstad
0
990
Kaigi on Rails 2024 〜運営の裏側〜
krpk1900
1
240
TypeScript Graph でコードレビューの心理的障壁を乗り越える
ysk8hori
3
1.2k
型付き API リクエストを実現するいくつかの手法とその選択 / Typed API Request
euxn23
8
2.3k
React への依存を最小にするフロントエンド設計
takonda
6
1.4k
Amazon Qを使ってIaCを触ろう!
maruto
0
420
Streams APIとTCPフロー制御 / Web Streams API and TCP flow control
tasshi
2
350
Ethereum_.pdf
nekomatu
0
470
「今のプロジェクトいろいろ大変なんですよ、app/services とかもあって……」/After Kaigi on Rails 2024 LT Night
junk0612
5
2.2k
Micro Frontends Unmasked Opportunities, Challenges, Alternatives
manfredsteyer
PRO
0
110
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
243
12k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
329
21k
Save Time (by Creating Custom Rails Generators)
garrettdimon
PRO
27
840
How to train your dragon (web standard)
notwaldorf
88
5.7k
Fashionably flexible responsive web design (full day workshop)
malarkey
405
65k
Adopting Sorbet at Scale
ufuk
73
9.1k
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
A Tale of Four Properties
chriscoyier
156
23k
Into the Great Unknown - MozCon
thekraken
32
1.5k
Large-scale JavaScript Application Architecture
addyosmani
510
110k
How To Stay Up To Date on Web Technology
chriscoyier
788
250k
Designing Experiences People Love
moore
138
23k
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!