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
May the source be with you
Search
高見龍
December 08, 2012
Programming
10
1k
May the source be with you
Learn more about Ruby through reading Ruby source code.
高見龍
December 08, 2012
Tweet
Share
More Decks by 高見龍
See All by 高見龍
為你自己學 Python
eddie
0
560
Generative AI 年會小聚 - AI 教我寫程式
eddie
0
61
讓數據說話:用 Python、Prometheus 和 Grafana 講故事
eddie
0
530
AI 時代的程式語言學習法
eddie
0
100
前端模組解放運動 - importmap
eddie
0
1.3k
Git 和 DevOps - 在混亂的流星群開發流程中找到小確幸
eddie
1
1.1k
模組化前端開發:從亂七八糟到組織有序
eddie
0
1.5k
被 Vue 框架耽誤的建置工具
eddie
2
980
開開心心寫測試,你的程式碼也會微笑
eddie
1
1.2k
Other Decks in Programming
See All in Programming
ARA Ansible for the teams
kksat
0
150
Writing documentation can be fun with plugin system
okuramasafumi
0
120
Boost Performance and Developer Productivity with Jakarta EE 11
ivargrimstad
0
220
密集、ドキュメントのコロケーション with AWS Lambda
satoshi256kbyte
0
190
ファインディの テックブログ爆誕までの軌跡
starfish719
2
1.1k
データベースのオペレーターであるCloudNativePGがStatefulSetを使わない理由に迫る
nnaka2992
0
140
Introduction to kotlinx.rpc
arawn
0
690
自分ひとりから始められる生産性向上の取り組み #でぃーぷらすオオサカ
irof
8
2.8k
JavaScriptツール群「UnJS」を5分で一気に駆け巡る!
k1tikurisu
9
1.8k
Bedrock Agentsレスポンス解析によるAgentのOps
licux
3
840
[Fin-JAWS 第38回 ~re:Invent 2024 金融re:Cap~]FaultInjectionServiceアップデート@pre:Invent2024
shintaro_fukatsu
0
410
個人アプリを2年ぶりにアプデしたから褒めて / I just updated my personal app, praise me!
lovee
0
340
Featured
See All Featured
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
The Web Performance Landscape in 2024 [PerfNow 2024]
tammyeverts
4
410
Learning to Love Humans: Emotional Interface Design
aarron
273
40k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
28
9.3k
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
226
22k
Scaling GitHub
holman
459
140k
Done Done
chrislema
182
16k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
129
19k
Six Lessons from altMBA
skipperchong
27
3.6k
What's in a price? How to price your products and services
michaelherold
244
12k
Principles of Awesome APIs and How to Build Them.
keavy
126
17k
Transcript
May the Source Be with You Chimpr Learning Ruby by
Reading Ruby Source Code 12年12月8日星期六
12年12月8日星期六
I’m a Flash guy ≈ 8 years 12年12月8日星期六
also a Ruby guy ≈ 4 years 12年12月8日星期六
but not a C guy, yet! 12年12月8日星期六
Ruby > Rails 12年12月8日星期六
share Ruby learning experiences in OpenFoundry and some developer party.
12年12月8日星期六
a SHOW-OFF person! 12年12月8日星期六
Learning Ruby by Reading Ruby Source Code 12年12月8日星期六
- why read source code? - how o sart? -
anything ineresting? - wrie a simple Ruby Exension with C. 12年12月8日星期六
Why read source code? 12年12月8日星期六
see how the Ruby Core Team wrie Ruby 12年12月8日星期六
fun :) 12年12月8日星期六
"once you sart digging around in someone else’s code base,
you’ll learn a lot about your own strengths and weaknesses" - Ruby Best Practice http://blog.rubybestpractices.com/posts/gregory/005-code-reading-stdlib.html 12年12月8日星期六
pre-requirement? 12年12月8日星期六
C language 12年12月8日星期六
curiosity and enthusiasm 12年12月8日星期六
What if I don’t have any skill of C? 12年12月8日星期六
Just learn it :) 12年12月8日星期六
How o Sart? 12年12月8日星期六
get Ruby source code download from Ruby websie: http://www.ruby-lang.org/en/ or
from github: https://github.com/ruby/ruby 12年12月8日星期六
Ruby Source Code: - *.c + *.h - *.rb (Sdlib)
12年12月8日星期六
Tools - Vim 12年12月8日星期六
Ruby 1.9.2 p290 12年12月8日星期六
Quick Browsing.. :) 12年12月8日星期六
what's a Ruby object? 12年12月8日星期六
sart from basic structure, like Object, Class, String, Array, Hash,
Basic... 12年12月8日星期六
Object = RObject, Class = RClass, String = RString, Array
= RArray, Hash = RHash, Basic = RBasic 12年12月8日星期六
“ruby.h” 12年12月8日星期六
“object.c” 12年12月8日星期六
Init_XXXX 12年12月8日星期六
class.c#350-354 all Class’s class is Class! 12年12月8日星期六
class.c#556 rb_define_module() 12年12月8日星期六
class.c#1170 rb_define_method() 12年12月8日星期六
Object.c#2556~2560 Integer(), Float(), String(), Array() are all global methods 12年12月8日星期六
= rb_define_module_method on kernel = rb_define_private_method on kernel + rb_define_singleton_method
on kernel class.c#1332 rb_define_global_function() 12年12月8日星期六
“new” 12年12月8日星期六
class A def initialize puts "hello" end end a =
A.new 12年12月8日星期六
object.c#2624 new -> rb_class_new_instance -> rb_obj_alloc -> rb_obj_call_init 12年12月8日星期六
o_s v.s o_str 12年12月8日星期六
String.c#7488 rb_define_method(rb_cString, "to_s", rb_str_to_s, 0); rb_define_method(rb_cString, "to_str", rb_str_to_s, 0); 12年12月8日星期六
Array.c#4504 rb_define_alias(rb_cArray, "to_s", "inspect"); but no `to_str` 12年12月8日星期六
proc.c#2105 how to execute a Proc? - proc.call - proc[]
- proc === 123 - proc.yield 12年12月8日星期六
object.c#2592 - attr - attr_reader - attr_writer - attr_accessor 12年12月8日星期六
push v.s << 12年12月8日星期六
array.c#709 (<<) VALUE rb_ary_push(VALUE ary, VALUE item){ rb_ary_modify(ary); return rb_ary_push_1(ary,
item); } 12年12月8日星期六
array.c#742 (push) static VALUE rb_ary_push_m(int argc, VALUE *argv, VALUE ary)
{ rb_ary_modify(ary); while (argc--) { rb_ary_push_1(ary, *argv++); } return ary; } 12年12月8日星期六
gc.c#3214-3215 Object’s ID 12年12月8日星期六
gc.c#2865-2867 How Symbol works? 12年12月8日星期六
people = { "Eddie" => ["green", "
[email protected]
"], "Joanne" => ["yellow",
"
[email protected]
"] } people.map { |name, (color, email)| puts [name, email] } 12年12月8日星期六
people = { "Eddie" => ["green", "
[email protected]
"], "Joanne" => ["yellow",
"
[email protected]
"] } people.map { |name, (_, email)| puts [name, email] } parse.y#8277-8299 shadowing_lvar_gen() 12年12月8日星期六
vm_eval.c#224 method_missing 12年12月8日星期六
ineresting naming :) 12年12月8日星期六
ext/ripper/ripper.c#15890 rb_intern, rb_intern2, rb_intern3 12年12月8日星期六
array.c#325 rb_ary_new, rb_ary_new2, ary_new, rb_ary_new3, rb_ary_new4 12年12月8日星期六
Simple Ruby Exension from Scrach 12年12月8日星期六
Conclusion 12年12月8日星期六
from basic structure 12年12月8日星期六
and don’t be afraid 12年12月8日星期六
References 12年12月8日星期六
Rubyソースコード完全解説 by 青木峰郎 http://i.loveruby.net/ja/rhg/book/ 12年12月8日星期六
Ruby Under a Microscope by Pat Shaughnessy http://patshaughnessy.net/ruby-under-a-microscope 12年12月8日星期六
still not finish.. 12年12月8日星期六
Ian Ruotsala 12年12月8日星期六
Chimpr Hope can become a Jedi Master someday :) 12年12月8日星期六
おわり thank you all :) 12年12月8日星期六
any question? 12年12月8日星期六
高見見龍龍 Conacts photo by Eddie Websie Blog Plurk Facebook Google
Plus Twiter Email Mobile http://www.eddie.com.tw http://blog.eddie.com.tw http://www.plurk.com/aquarianboy http://www.facebook.com/eddiekao http://www.eddie.com.tw/+ https://twiter.com/#!/eddiekao
[email protected]
+886-928-617-687 12年12月8日星期六