Slide 1

Slide 1 text

Konstantin Haase Beyond Ruby

Slide 2

Slide 2 text

@konstantinhaase github.com/rkh Everybody, please stand up! ΈΜͳ͕ɺ্ཱ͕ͪͬͯ ͍ͩ͘͞ʂ

Slide 3

Slide 3 text

@konstantinhaase github.com/rkh ͋ͳͨ͸Rubyϓϩάϥ ϜΛॻ͍ͨ͜ͱ͕ͳ͍৔ ߹͸ɺ࠲Δɻ

Slide 4

Slide 4 text

@konstantinhaase github.com/rkh ͋ͳͨ͸Smalltalkϓ ϩάϥϜΛॻ͍ͨ͜ͱ͕ ͳ͍৔߹͸ɺ࠲Δɻ

Slide 5

Slide 5 text

@konstantinhaase github.com/rkh ͋ͳͨ͸Lispϓϩάϥ ϜΛॻ͍ͨ͜ͱ͕ͳ͍৔ ߹͸ɺ࠲Δɻ

Slide 6

Slide 6 text

@konstantinhaase github.com/rkh ͋ͳͨ͸Prologϓϩά ϥϜΛॻ͍ͨ͜ͱ͕ͳ͍ ৔߹͸ɺ࠲Δɻ

Slide 7

Slide 7 text

@konstantinhaase github.com/rkh ͋ͳͨ͸VHDLϓϩά ϥϜΛॻ͍ͨ͜ͱ͕ͳ͍ ৔߹͸ɺ࠲Δɻ

Slide 8

Slide 8 text

@konstantinhaase github.com/rkh ͋ͳͨ͸Newspeak ϓϩάϥϜΛॻ͍ͨ͜ͱ ͕ͳ͍৔߹͸ɺ࠲Δɻ

Slide 9

Slide 9 text

@konstantinhaase github.com/rkh Konstantin Haase Open Source Developer

Slide 10

Slide 10 text

No content

Slide 11

Slide 11 text

@konstantinhaase github.com/rkh

Slide 12

Slide 12 text

@konstantinhaase github.com/rkh “Second to K&R, the most lagom technical book I’ve read.” Peter Cooper (Ruby Inside) Discount Code: AUTHD 50% off ebook ($6.50) 40% off print

Slide 13

Slide 13 text

@konstantinhaase github.com/rkh

Slide 14

Slide 14 text

@konstantinhaase github.com/rkh

Slide 15

Slide 15 text

@konstantinhaase github.com/rkh

Slide 16

Slide 16 text

@konstantinhaase github.com/rkh Language

Slide 17

Slide 17 text

@konstantinhaase github.com/rkh

Slide 18

Slide 18 text

@konstantinhaase github.com/rkh

Slide 19

Slide 19 text

@konstantinhaase github.com/rkh

Slide 20

Slide 20 text

@konstantinhaase github.com/rkh Ruby

Slide 21

Slide 21 text

@konstantinhaase github.com/rkh Questions? Shugo Maeda

Slide 22

Slide 22 text

@konstantinhaase github.com/rkh Yukihiro "Mad Matz" Matsumoto

Slide 23

Slide 23 text

@konstantinhaase github.com/rkh Can you say it in Ruby?

Slide 24

Slide 24 text

@konstantinhaase github.com/rkh me Ruby

Slide 25

Slide 25 text

@konstantinhaase github.com/rkh A Programming Language is just a Tool

Slide 26

Slide 26 text

@konstantinhaase github.com/rkh Tell you something new

Slide 27

Slide 27 text

@konstantinhaase github.com/rkh

Slide 28

Slide 28 text

@konstantinhaase github.com/rkh No Node.js

Slide 29

Slide 29 text

@konstantinhaase github.com/rkh No Node.js No Erlang

Slide 30

Slide 30 text

@konstantinhaase github.com/rkh No Node.js No Erlang No Go

Slide 31

Slide 31 text

@konstantinhaase github.com/rkh Full Object Orientation

Slide 32

Slide 32 text

@konstantinhaase github.com/rkh Doesn’t Ruby already have that?

Slide 33

Slide 33 text

@konstantinhaase github.com/rkh OOP ≠ OOP

Slide 34

Slide 34 text

@konstantinhaase github.com/rkh “Objects are data and functionality” Your High School Teacher

Slide 35

Slide 35 text

@konstantinhaase github.com/rkh

Slide 36

Slide 36 text

@konstantinhaase github.com/rkh “I made up the term object-oriented, and I can tell you, I did not have C++ in mind.” Alan Kay

Slide 37

Slide 37 text

@konstantinhaase github.com/rkh “ OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things.” Alan Kay

Slide 38

Slide 38 text

@konstantinhaase github.com/rkh Smalltalk

Slide 39

Slide 39 text

@konstantinhaase github.com/rkh if response == 42 "correct!" else "wrong" end

Slide 40

Slide 40 text

@konstantinhaase github.com/rkh response = 42 ifTrue: [ 'correct!' ] ifFalse: [ 'wrong' ]

Slide 41

Slide 41 text

@konstantinhaase github.com/rkh def true.if_true yield end def false.if_true end

Slide 42

Slide 42 text

@konstantinhaase github.com/rkh TrueClass. define_method(:if_true){ yield } FalseClass. define_method(:if_true) { }

Slide 43

Slide 43 text

@konstantinhaase github.com/rkh class Falsy def if_true; end end

Slide 44

Slide 44 text

@konstantinhaase github.com/rkh x = Delegator.new({}) x.is_a? Hash # => true case x when Hash then ... else fail end

Slide 45

Slide 45 text

@konstantinhaase github.com/rkh Do not treat Objects like Data Structures!

Slide 46

Slide 46 text

@konstantinhaase github.com/rkh my_instance. properties[:foo][1,4] == "blah" my_instance.foo? "blah"

Slide 47

Slide 47 text

@konstantinhaase github.com/rkh Is Smalltalk Object Oriented?

Slide 48

Slide 48 text

@konstantinhaase github.com/rkh

Slide 49

Slide 49 text

@konstantinhaase github.com/rkh variable/constant access is no method send

Slide 50

Slide 50 text

@konstantinhaase github.com/rkh variable/constant access is no method send keywords like self and super are no method sends

Slide 51

Slide 51 text

@konstantinhaase github.com/rkh

Slide 52

Slide 52 text

@konstantinhaase github.com/rkh no implementation treats ifTrue: and ifFalse: as method sends

Slide 53

Slide 53 text

@konstantinhaase github.com/rkh no implementation treats ifTrue: and ifFalse: as method sends constants are not late bound

Slide 54

Slide 54 text

@konstantinhaase github.com/rkh Newspeak

Slide 55

Slide 55 text

@konstantinhaase github.com/rkh

Slide 56

Slide 56 text

@konstantinhaase github.com/rkh there are only method sends

Slide 57

Slide 57 text

@konstantinhaase github.com/rkh there are only method sends there is no global state

Slide 58

Slide 58 text

@konstantinhaase github.com/rkh But I want lexical scope!

Slide 59

Slide 59 text

@konstantinhaase github.com/rkh Foo = 42 class Bar def foo(x) Foo + x end end

Slide 60

Slide 60 text

@konstantinhaase github.com/rkh Outer = 23 module Wrapper Inner = 42 class Nested def result Outer + Inner end end end

Slide 61

Slide 61 text

@konstantinhaase github.com/rkh Solution: Clever, Bi- Directional Dispatch

Slide 62

Slide 62 text

@konstantinhaase github.com/rkh

Slide 63

Slide 63 text

@konstantinhaase github.com/rkh Hi usingPlatform: platform = ( platform Transcript open show: 'Hello!'. )

Slide 64

Slide 64 text

@konstantinhaase github.com/rkh

Slide 65

Slide 65 text

@konstantinhaase github.com/rkh

Slide 66

Slide 66 text

@konstantinhaase github.com/rkh Homoiconic Languages

Slide 67

Slide 67 text

@konstantinhaase github.com/rkh "In computer programming, homoiconicity is a property of some programming languages, in which the primary representation of programs is also a data structure in a primitive type of the language itself, from the Greek words homo meaning the same and icon meaning representation. This makes metaprogramming easier than in a language without this property." Wikipedia

Slide 68

Slide 68 text

@konstantinhaase github.com/rkh

Slide 69

Slide 69 text

@konstantinhaase github.com/rkh Lisp, Logix, Io

Slide 70

Slide 70 text

@konstantinhaase github.com/rkh Lisp, Logix, Io Prolog, Snobol, Ioke

Slide 71

Slide 71 text

@konstantinhaase github.com/rkh

Slide 72

Slide 72 text

@konstantinhaase github.com/rkh '(1 2 3)

Slide 73

Slide 73 text

@konstantinhaase github.com/rkh (+ 1 2) ; 3

Slide 74

Slide 74 text

@konstantinhaase github.com/rkh (car '(1 2)) ; 1 (cdr '(1 2)) ; '(2)

Slide 75

Slide 75 text

@konstantinhaase github.com/rkh (car (cdr '(1 2))) ; 2

Slide 76

Slide 76 text

@konstantinhaase github.com/rkh (setf b 23) (+ b 19) ; 42

Slide 77

Slide 77 text

@konstantinhaase github.com/rkh (setf a '(setf b 23)) (eval a) (+ b 19) ; 42

Slide 78

Slide 78 text

@konstantinhaase github.com/rkh (setf a '(setf b 23)) (setf (car (cdr (cdr a))) 42) (eval a) ; 42

Slide 79

Slide 79 text

@konstantinhaase github.com/rkh

Slide 80

Slide 80 text

@konstantinhaase github.com/rkh How’s that useful?

Slide 81

Slide 81 text

@konstantinhaase github.com/rkh

Slide 82

Slide 82 text

@konstantinhaase github.com/rkh Macros and Partial Evaluation

Slide 83

Slide 83 text

@konstantinhaase github.com/rkh Macros and Partial Evaluation Language Extensions from within

Slide 84

Slide 84 text

@konstantinhaase github.com/rkh Declarative Programming

Slide 85

Slide 85 text

@konstantinhaase github.com/rkh

Slide 86

Slide 86 text

@konstantinhaase github.com/rkh SQL, XSLT, SPARQL, Pig

Slide 87

Slide 87 text

@konstantinhaase github.com/rkh SQL, XSLT, SPARQL, Pig Prolog, Erlang

Slide 88

Slide 88 text

@konstantinhaase github.com/rkh

Slide 89

Slide 89 text

@konstantinhaase github.com/rkh

Slide 90

Slide 90 text

@konstantinhaase github.com/rkh

Slide 91

Slide 91 text

@konstantinhaase github.com/rkh

Slide 92

Slide 92 text

@konstantinhaase github.com/rkh ruby_core(tenderlove). ?- ruby_core(tenderlove). Yes ?- ruby_core(X). X = tenderlove

Slide 93

Slide 93 text

@konstantinhaase github.com/rkh ruby_core(tenderlove). rails_core(tenderlove). ubercore(X) :- ruby_core(X), rails_core(X). ?- ubercore(X). X = tenderlove

Slide 94

Slide 94 text

@konstantinhaase github.com/rkh car([H|_], H). cdr([_|T], T). ?- car([1, 2, 3], X). X = 1 ?- cdr([1, 2, 3], X). X = [2, 3]

Slide 95

Slide 95 text

@konstantinhaase github.com/rkh sorted([]). sorted([_]). sorted([X,Y|T]) :- X =< Y, sorted([Y|T]). sort(X,Y) :- perm(X,Y), sorted(Y).

Slide 96

Slide 96 text

@konstantinhaase github.com/rkh ?- sort([1, 3, 2], X). X = [1, 2, 3] ?- sort(X, [1, 2, 3]). X = [1, 2, 3] Continue? [Y/n]

Slide 97

Slide 97 text

@konstantinhaase github.com/rkh Hardware Programming

Slide 98

Slide 98 text

@konstantinhaase github.com/rkh VHDL Very-high-speed integrated circuits Hardware Description Language

Slide 99

Slide 99 text

@konstantinhaase github.com/rkh FOO <= '1'; BAR <= '0'; BAZ <= FOO and BAR;

Slide 100

Slide 100 text

@konstantinhaase github.com/rkh FOO <= '1'; BAR <= '0'; BAZ <= FOO and BAR;

Slide 101

Slide 101 text

@konstantinhaase github.com/rkh

Slide 102

Slide 102 text

@konstantinhaase github.com/rkh http://www.ht-lab.com/

Slide 103

Slide 103 text

@konstantinhaase github.com/rkh github.com/a-team/Pong

Slide 104

Slide 104 text

@konstantinhaase github.com/rkh ਧ͖ඈ͹͞ؾ

Slide 105

Slide 105 text

@konstantinhaase github.com/rkh Thank you! ͋Γ͕ͱ͏ʂ