Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Smalltalk On Rubinius
Search
Konstantin Haase
September 17, 2011
Technology
55
1
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Smalltalk On Rubinius
Konstantin Haase
September 17, 2011
More Decks by Konstantin Haase
See All by Konstantin Haase
RubyConf Philippines 2017: Magenta is a Lie
rkh
0
250
How We Replaced Salary Negotiations with a Sinatra App
rkh
17
4.3k
HTTP (RubyMonsters Edition)
rkh
5
1.2k
GCRC 2015: Abstract Thoughts on Abstract Things
rkh
1
410
Frozen Rails: Magenta - The Art Of Abstraction
rkh
3
360
RedDotRubyConf 2014: Magenta is a Lie - and other tales of abstraction
rkh
0
1k
Ancient City Ruby: Hack me, if you can!
rkh
2
480
Boston I/O: Continuous Integration
rkh
3
350
Steel City Ruby: Architecting Chaos
rkh
4
1k
Other Decks in Technology
See All in Technology
形式手法を使って仕様をコーディングしよう
mikanichinose
0
190
分析の民主化を支えるメタデータ整備の実践
kakehashi
PRO
2
910
全PRの83%が AIレビューだけでマージできるようになった開発組織は その後どうなったか @2026/10
athug
0
120
全人類(ほぼ)AWS Organizations の上でAWSを利用している、その世界を知る話
htan
0
120
FOSS4Gを活用した自治体業務DXの試み
470715
0
120
実体験から学ぶ分析エージェントの開発と運⽤
recruitengineers
PRO
4
1.1k
Oracle Base Database Service 技術詳細
oracle4engineer
PRO
17
120k
AI時代に必要な脅威モデリング― 変化の速度に負けない理解とリスク判断
masakane55
5
1.2k
カンファレンスに参加した後の浮遊感とセルフケア
pauli
0
310
20260930_Gemma4_Hands-on
tsho
0
230
「Docker Desktop不要の時代」は 来たのか?
ueponx
0
180
1万名の社員が使う認証基盤で どう信頼性を担保するか?
kairim0
0
210
Featured
See All Featured
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
23k
Breaking role norms: Why Content Design is so much more than writing copy - Taylor Woolridge
uxyall
1
450
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
400
End of SEO as We Know It (SMX Advanced Version)
ipullrank
3
4.4k
From π to Pie charts
rasagy
1
390
Typedesign – Prime Four
hannesfritz
42
3.2k
Docker and Python
trallard
47
4.2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
52
6.1k
Reflections from 52 weeks, 52 projects
jeffersonlam
356
21k
Learning to Love Humans: Emotional Interface Design
aarron
275
41k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
2
300
Into the Great Unknown - MozCon
thekraken
41
2.8k
Transcript
Smalltalk On Rubinius Konstantin Haase
None
None
None
None
None
None
None
None
Why implement Smalltalk on Rubinius?
Why create a programming language?
Why create?
"When you don't create things, you become defined by your
tastes rather than ability. Your tastes only narrow and exclude people. So create." why the lucky stiff
Why a programming language?
About programming languages: "I don’t like any of them, and
I don’t think any of them are suitable for the real programming problems of today, whether for systems or for end-users" Alan Kay
Problem Oriented Programming Languages Cairo (~120k SLOC in C) rewritten
in less than 400 lines
Why Smalltalk?
Why Rubinius?
None
1 + 1 1 + 1
this is it this.is.it
GoGaRuCo rock: #hard GoGaRuCo.rock :hard
doc convertFrom: #xml to: #yaml doc.convert(:xml, :ruby)
doc convertFrom: #xml to: #yaml doc.convert from: :xml, to: :ruby
[ 42 ] proc { 42 }
anArray do: [ :each | each doSomething ] an_array.each do
|element| element.do_something end
Textmate version = 2 ifTrue: [ 'no way' ] ifFalse:
[ 'thought so' ] if Textmate.version == 2 "no way" else "thought so" end
Storage current store: #foo; store: #bar storage = Storage.current storage.store
:foo storage.store :bar
Smalltalk claims to look like: 'English'. Judge yourself. Does it.
Ruby.claims.to.look. like "English" Judge.yourself; Does.it?
Reak github.com/rkh/Reak Like Squeak but with R File based (as
opposed to image based)
None
The Rubinius Compiler Pure Ruby Modular and Flexible lib/compiler
None
Parsing with KPeg github.com/evanphx/kpeg
" from Reak.AST.Self " grammar: g [ ^ g str:
'self' ] # from Reak::AST::Return def bootstrap_grammar(g) g.seq "^", :sp, g.t(:expression) end
Rubinius Bytecode
$ rbx compile -B -e 'puts "Hello World"' 0000: push_self
0001: push_literal "Hello World" 0003: allow_private 0004: send_stack :puts, 1
$ rbx compile -B -e 'puts "Hello World"' 0000: push_self
0001: push_literal "Hello World" 0003: allow_private 0004: send_stack :puts, 1
$ rbx compile -B -e 'puts "Hello World"' 0000: push_self
0001: push_literal "Hello World" 0003: allow_private 0004: send_stack :puts, 1
$ rbx compile -B -e 'puts "Hello World"' 0000: push_self
0001: push_literal "Hello World" 0003: allow_private 0004: send_stack :puts, 1
$ rbx compile -B -e 'puts "Hello World"' 0000: push_self
0001: push_literal "Hello World" 0003: allow_private 0004: send_stack :puts, 1
class Object dynamic_method(:display) do |g| g.push_self g.push_local(0) # first argument
g.send(:puts, 1, true) g.ret end end display "Hello World"
Reusing the Rubinius tool chain
None
class Reak::Compiler < Rubinius::Compiler class Parser < Stage stage :parser
next_stage Generator end end
class CustomNode < Reak::AST::Base def self.bootstrap_grammar(g) # grammar definition end
def bytecode(g) # bytecode definition end end
class ConstantAccess < Rubinius::AST::ConstantAccess include Reak::AST::Node Reak::AST::Primary.push self def self.bootstrap_grammar(g)
g.t /[A-Z][a-zA-Z0-9_]*/ end # no bytecode definition necessary end
Rubinius.AST.TrueLiteral subclass: #TrueLiteral [ Reak.AST.Primary push: self. self include: Reak.AST.Node.
self class >> grammar: g [ ^ g str: 'true' ]. ]
" Remember cascades? " g pushSelf; pushLocal: 0; send: #puts
args: 1 private: true; ret.
Reak.AST.Base subclass: #Cascade [ Reak.AST.Expression push: self. bytecode: g [
g pushSelf. cascadedSends do: [:send | g dup. send bytecode: g. g pop ]. lastSend bytecode: g. ] ]
Thanks! github.com / rkh / presentations