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
390
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
310
Successful social norms with ternary reputation for indirect reciprocity
yohm
0
470
Friendly-rivalry strategies for general n-person public goods game
yohm
1
340
Deep Learning Exploration of Agent-Based Social Network Model Parameters
yohm
0
360
Five rules for friendly rivalry in direct reciprocity
yohm
0
140
Automata representation of successful strategies for social dilemmas
yohm
0
92
Structural transition in social networks: the role of homophily
yohm
0
220
OACIS hands-on tutorial
yohm
2
540
Conservation of population size is required for self-organized criticality in evolution models
yohm
0
130
Other Decks in Programming
See All in Programming
MUSUBIXとは
nahisaho
0
130
Patterns of Patterns
denyspoltorak
0
1.4k
ノイジーネイバー問題を解決する 公平なキューイング
occhi
0
100
登壇資料を作る時に意識していること #登壇資料_findy
konifar
4
1.2k
Best-Practices-for-Cortex-Analyst-and-AI-Agent
ryotaroikeda
1
110
CSC307 Lecture 06
javiergs
PRO
0
690
副作用をどこに置くか問題:オブジェクト指向で整理する設計判断ツリー
koxya
1
610
Rust 製のコードエディタ “Zed” を使ってみた
nearme_tech
PRO
0
180
CSC307 Lecture 07
javiergs
PRO
0
550
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
570
今こそ知るべき耐量子計算機暗号(PQC)入門 / PQC: What You Need to Know Now
mackey0225
3
380
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
580
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
5
35k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
3.9k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
0
1.1k
Primal Persuasion: How to Engage the Brain for Learning That Lasts
tmiket
0
250
Statistics for Hackers
jakevdp
799
230k
[SF Ruby Conf 2025] Rails X
palkan
1
750
Visualization
eitanlees
150
17k
Building a Modern Day E-commerce SEO Strategy
aleyda
45
8.7k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
260
世界の人気アプリ100個を分析して見えたペイウォール設計の心得
akihiro_kokubo
PRO
66
37k
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Designing for Performance
lara
610
70k
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!