Slide 1

Slide 1 text

No content

Slide 2

Slide 2 text

高見 龍 です

Slide 3

Slide 3 text

高 見龍 です @eddiekao

Slide 4

Slide 4 text

Code Reading Chimpr Learning more about Ruby by Reading Ruby Source Code

Slide 5

Slide 5 text

I come from Taiwan photo by Fishtail@Taipei

Slide 6

Slide 6 text

photo by J o n a G r a p h Y 

Slide 7

Slide 7 text

photo by HeyNix

Slide 8

Slide 8 text

photo by randomwire

Slide 9

Slide 9 text

No content

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

I’m a Python guy (≈ 2 years) I’m a iOS app guy (≈ 2 years) I’m a Flash guy (≈ 8 years) I’m a Ruby guy (≈ 4 years)

Slide 12

Slide 12 text

But not a C guy, yet!

Slide 13

Slide 13 text

Ruby > Rails

Slide 14

Slide 14 text

“I’m a SHOW OFF person”

Slide 15

Slide 15 text

“Experience Sharing is fun”

Slide 16

Slide 16 text

Current Status 80% iOS app, 20% Ruby/Rails

Slide 17

Slide 17 text

100% Ruby Lover!

Slide 18

Slide 18 text

No content

Slide 19

Slide 19 text

Web Development Conference in Taiwan

Slide 20

Slide 20 text

No content

Slide 21

Slide 21 text

2 days, 3 tracks session

Slide 22

Slide 22 text

750+ attendees

Slide 23

Slide 23 text

all tickets sold out in 4 mins

Slide 24

Slide 24 text

WebConf Taiwan 2014

Slide 25

Slide 25 text

Will be held on Jan 2014

Slide 26

Slide 26 text

850+ attendees in 2014, hopefully.

Slide 27

Slide 27 text

All about web development

Slide 28

Slide 28 text

楽しい

Slide 29

Slide 29 text

http://webconf.tw

Slide 30

Slide 30 text

Code Reading

Slide 31

Slide 31 text

Why read source code? How to start? What I learned? Anything interesting?

Slide 32

Slide 32 text

Why read source code ?

Slide 33

Slide 33 text

Ian Ruotsala

Slide 34

Slide 34 text

http://blog.rubybestpractices.com/posts/gregory/005-code-reading-stdlib.html “once you start digging around in someone else’s code base, you’ll learn a lot about your own strengths and weaknesses” - Ruby Best Practice

Slide 35

Slide 35 text

See how the Core Team write Ruby

Slide 36

Slide 36 text

photo by chaines106 Read the source, Luke!

Slide 37

Slide 37 text

source http://kyaraben.seesaa.net/article/168967765.html source code は友達

Slide 38

Slide 38 text

Contribution!

Slide 39

Slide 39 text

Committer in my dream!

Slide 40

Slide 40 text

FUN! :)

Slide 41

Slide 41 text

Requirement ?

Slide 42

Slide 42 text

C language

Slide 43

Slide 43 text

“What if I don’t have any skill of C?”

Slide 44

Slide 44 text

“Just Learn It!”

Slide 45

Slide 45 text

Curiosity and Passion

Slide 46

Slide 46 text

Where to Start ?

Slide 47

Slide 47 text

get source files!

Slide 48

Slide 48 text

download from Ruby website, or clone from github

Slide 49

Slide 49 text

Ruby 1.9.2 p290

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

Quick browsing.. :)

Slide 52

Slide 52 text

* .c + * .h * .rb (stdlib)

Slide 53

Slide 53 text

Let’s have some fun!

Slide 54

Slide 54 text

Object Class String Array Hash

Slide 55

Slide 55 text

“ruby.h”

Slide 56

Slide 56 text

Object => RObject Class => RClass String => RString Array => RArray Hash => RHash

Slide 57

Slide 57 text

“object.c”

Slide 58

Slide 58 text

Init_XXXX( )

Slide 59

Slide 59 text

“all Class’s class is a Class”

Slide 60

Slide 60 text

“new”

Slide 61

Slide 61 text

class A def initialize puts "hello" end end a = A.new

Slide 62

Slide 62 text

Proc

Slide 63

Slide 63 text

How to execute a Proc?

Slide 64

Slide 64 text

proc.call proc[ ] proc.yield proc === 123

Slide 65

Slide 65 text

attributes

Slide 66

Slide 66 text

push v.s. <<

Slide 67

Slide 67 text

Object ID

Slide 68

Slide 68 text

What else?

Slide 69

Slide 69 text

Haskell-like syntax :)

Slide 70

Slide 70 text

head (x:_) = x tail (_:xs) = xs

Slide 71

Slide 71 text

people = { "Eddie" => ["green", "[email protected]"], "Joanne" => ["yellow", "[email protected]"] } people.map { |name, (color, email)| puts [name, email] }

Slide 72

Slide 72 text

parse.y#8277-8299 shadowing_lvar_gen( ) people = { "Eddie" => ["green", "[email protected]"], "Joanne" => ["yellow", "[email protected]"] } people.map { |name, (_, email)| puts [name, email] }

Slide 73

Slide 73 text

Method missing

Slide 74

Slide 74 text

Anything interesting ?

Slide 75

Slide 75 text

Interesting naming.. XD

Slide 76

Slide 76 text

Conclusion

Slide 77

Slide 77 text

“from basic structure”

Slide 78

Slide 78 text

“don’t be afraid of source code”

Slide 79

Slide 79 text

source http://kyaraben.seesaa.net/article/168967765.html source code は友達

Slide 80

Slide 80 text

References

Slide 81

Slide 81 text

http://i.loveruby.net/ja/rhg/book/ “Rubyソースコード完全解説” (RHG) by 青木峰郎

Slide 82

Slide 82 text

http://patshaughnessy.net/ruby-under-a-microscope “Ruby Under a Microscope” by Pat Shaughnessy

Slide 83

Slide 83 text

Chimpr Hope we all can become Jedi Master someday :)

Slide 84

Slide 84 text

高見 龍 です

Slide 85

Slide 85 text

以上です。 ご清聴ありがとうございました thanks for your listening :)

Slide 86

Slide 86 text

高見龍 Contacts photo by Eddie Website Blog Plurk Facebook Google Plus Twitter 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://twitter.com/#!/eddiekao [email protected] +886-928-617-687