![Page 1: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/1.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp to Ruby to Rubinius
ネットワーク応用通信研究所 楽天 技術研究所
Rubyアソシエーション@yukihiro_matz
Yukihiro "Matz" Matsumoto
![Page 2: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/2.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp1/59
![Page 3: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/3.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
one of the oldest
O-Partsout of place artifact
2/59
![Page 4: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/4.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
O-Parts of the language
oldest but newest
symbolic computation
garbage collection
objects
exceptions
3/59
![Page 5: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/5.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
S-expression
macros
everything object
meta-programming
4/59
![Page 6: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/6.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Dark side of Lisp
Parentheses
dangling language
there's no lisp language
CLOSpowerful but complex
5/59
![Page 7: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/7.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Ruby
Lispy, but
no S-expression
no macros
no CLOS
6/59
![Page 8: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/8.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Ruby
Algol-ish syntax
Smalltalk-ish OO
Language for ordinary programmers
7/59
![Page 9: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/9.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
(defun fact (n) (if (= n 1) 1 (* n (fact (1- n)))))(print (format "6!=~D" (fact 6))); => 6!=720
8/59
![Page 10: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/10.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
;; move parens(defun fact (n) (if (= n 1) 1 (* n (fact (1- n))) ))(print (format "6!=~D" (fact 6)))
9/59
![Page 11: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/11.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
;; operator syntax(defun fact (n) (if (n == 1) 1 (n * (fact (n - 1))) ))(print (format "6!=~D" (fact 6)))
10/59
![Page 12: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/12.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
;; move argument parens(defun fact (n) (if (n == 1) 1 (n * fact(n - 1)) ))print(format("6!=~D", fact(6)))
11/59
![Page 13: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/13.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
;; move argument parens(defun fact (n) (if (n == 1) 1 (n * fact(n - 1)) ))print(format("6!=~D", fact(6)))
12/59
![Page 14: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/14.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
# syntax structuresdefun fact (n) if (n == 1) 1 else (n * fact(n - 1)) endendprint(format("6!=~D", fact(6)))
13/59
![Page 15: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/15.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp
# reduce parensdefun fact (n) if n == 1 1 else n * fact(n - 1) endendprint(format("6!=~D", fact(6)))
14/59
![Page 16: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/16.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Ruby
def fact (n) if n == 0 1 else n * fact(n - 1) endendprintf "6!=%d", fact(6), "\n"# => 6!=720
15/59
![Page 17: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/17.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp vs Ruby
Syntax
Less parentheses
Many 'end's
special forms vs syntax structures
16/59
![Page 18: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/18.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp vs Ruby
Semantics
Quite similar
nearly one to one translation
auto conversion from fixnums to bignums
fact 200
17/59
![Page 19: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/19.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
MatzLisp
18/59
![Page 20: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/20.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
MatzLisp
not MacLisp
not FranzLisp
19/59
![Page 21: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/21.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Ruby
Lisp without S-expression
sprinkled with syntax sugar
with OO from Smalltalk
operators from C
strings/regexp from Perl
20/59
![Page 22: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/22.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Lisp without S-expr
Remember M-expression
21/59
![Page 23: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/23.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Ruby = Weak Lisp?
No S-expression
No Macro
Who cares.
22/59
![Page 24: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/24.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Language Power ≠ Programming Power
23/59
![Page 25: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/25.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Personal History
BASIC to Lisp
24/59
![Page 26: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/26.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
BASIC
25/59
![Page 27: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/27.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
BASIC
26/59
![Page 28: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/28.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Got tired of BASIC
No user defined functions
No user defined data types
27/59
![Page 29: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/29.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Aristocracy
Language Designers
Implementers
−−−−−−−−−−−−−−−−−−−−−−−−
Programmers
28/59
![Page 30: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/30.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
I met Lisp
in an AI book
Lisp made my eyes open
users can do everything
29/59
![Page 31: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/31.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Users can do Everything
define functions
define data types
enhance the language
30/59
![Page 32: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/32.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Democracy
no discrimination
users can be language implementers
31/59
![Page 33: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/33.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
But, wait
Unlike politics (or like politics)
freedom comes with responsibility
ordinary people hate (too much) responsibility
or too much power
32/59
![Page 34: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/34.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Too much power
smart people love power
smart people underestimate ordinarity of ordinary people
33/59
![Page 35: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/35.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
中庸Happy Medium
34/59
![Page 36: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/36.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Happy Medium
There should be somewhere in between language
aristocracy and democracy, where ordinary people can live happily, without feeling
fear.
35/59
![Page 37: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/37.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Balance
It's quite easy to pursue extreme, but seeking
'something in-between' is far more difficult.
36/59
![Page 38: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/38.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Ruby37/59
![Page 39: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/39.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Ruby
My answer to the ultimate question.
38/59
![Page 40: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/40.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Result
39/59
![Page 41: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/41.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Self-sustaining languages
C
Lisp
MFTL
Ruby
40/59
![Page 42: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/42.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
My Favorite Toy Language
n. Describes a language about which the developers are passionate but no one else cares about.
--Jargon File
41/59
![Page 43: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/43.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
My Favorite Toy Language
The first great goal in the mind of the designer of an MFTL is usually to write a compiler for it
--Jargon File
42/59
![Page 44: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/44.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
I am not a fan of meta-circular implementation
43/59
![Page 45: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/45.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Switching the brain
C → Core mode
Ruby → App mode
44/59
![Page 46: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/46.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Self-sustaining systems
C
Compiler written in C
Compiled code does not rely on the language
45/59
![Page 47: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/47.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Self-sustaining systems
Squeak
Bootstrap
Core written in Slangsubset of Smalltalk
compiles to C
libraries in Smalltalk
46/59
![Page 48: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/48.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Rubinius
Ruby implementation influenced by Smalltalk
47/59
![Page 49: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/49.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Rubinius
small VM in C++
libraries written in Ruby
48/59
![Page 50: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/50.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Bootstrap
VM1.
alpha2.
bootstrap3.
platform4.
common5.
delta6. 49/59
![Page 51: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/51.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
VM
The virtual machine is able to load and execute bytecode, send messages (i.e. look up
and execute methods), and all primitive functions are
available, but not yet hooked up as Ruby methods.
50/59
![Page 52: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/52.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
VM
At this point there is enough defined behavior to begin to
load up the rest of the runtime kernel which is all
defined in ruby. This has to be done in several passes as the
language grows.
51/59
![Page 53: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/53.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
alpha
This starts the loading of Ruby code. The ability to open classes and modules and
define methods exists. Also, it is possible to raise exceptions
and cause the running process to exit. This stage lays the foundation for the
next two stages.52/59
![Page 54: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/54.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
bootstrap
This stage continues to add the minimum functionality to support loading platform and
common. The primitive functions are added for most
of the kernel classes.
53/59
![Page 55: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/55.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
platform
The FFI system is implemented and Ruby
method interfaces to platform-specific functions are
created. Once this is set up, platform specific things such
as file access, math, and POSIX commands are
attached.54/59
![Page 56: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/56.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
common
The vast majority of the Ruby core library classes are
implemented. The Ruby core classes are kept as
implementation-neutral as possible.
55/59
![Page 57: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/57.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
delta
Implementation-specific versions of methods that
override the versions provided in common are added.
56/59
![Page 58: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/58.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Problems
performance
open class
57/59
![Page 59: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/59.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
(Possible) Solution
JIT (LLVM)
selector namespace / classbox
58/59
![Page 60: Lisp to Ruby to Rubinius - Hasso Plattner Institute · Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4 ... Lisp without S-expression sprinkled with syntax sugar with OO from Smalltalk](https://reader036.vdocuments.site/reader036/viewer/2022062917/5ecdc78c25ce6f13d4334704/html5/thumbnails/60.jpg)
Lisp to Ruby to Rubinius Powered by Rabbit 0.6.4
Thank you!
59/59