Weitere ähnliche Inhalte
Ähnlich wie Smalltalk in a .NET World (20)
Kürzlich hochgeladen (20)
Smalltalk in a .NET World
- 1. Smalltalk in a .NET World How to write a Smalltalk compiler without writing a VM John Brant [email_address]
- 7. Smalltalk vs. .NET ? become:, change classes Non-resumable exceptions Resumable Exceptions Delegates Blocks Primitive integer types Tagged integers Strong, static typing Strong, dynamic typing .NET Smalltalk
- 8. Smalltalk vs. .NET II Structs & Enums ? Add classes/methods (can’t remove or recompile) Add/remove classes & methods Static, virtual, & non-virtual methods All methods are virtual .NET Smalltalk
- 16. Primitive Example identityHash ^Compiler primitive: [:codeGenerator | codeGenerator call: (System.Object getMethod: 'GetHashCode'); constructNewObject: codeGenerator smalltalk smallIntegerClass initializedConstructor] evaluate: self
- 22. Console Example System.Console write: anObject (anObject isKindOf: SmallInteger) ifTrue: [System.Console write: anObject integer] ifFalse: [(anObject isKindOf: Character) ifTrue: [System.Console write: anObject character] ifFalse: [(anObject isKindOf: String) ifTrue: [System.Console write: anObject string] ifFalse: [System.Console write: anObject]]]
- 27. Benchmarks 28.65 70.59 856.50 49.36 36.65 sorting strings 21.14 216.11 48.63 13.25 20.19 forming sets 18.27 179.71 128.79 27.09 98.44 generating strings * 181.13 140.38 43.15 42.22 generating primes 7.20 115.22 87.21 33.55 15.77 generating fractonaccis 2.17 42.67 61.88 30.91 6.80 evaluate blocks 8.07 161.35 37.65 16.12 28.96 perform selectors 14.11 74.77 74.77 37.35 29.91 copy objects 7.16 90.91 30.30 90.82 20.20 create objects 36.28 108.84 54.42 54.37 19.10 access strings 11.45 39.08 2266.67 75.48 64.76 add floats 14.07 576.97 576.97 2.62 36.06 add integers Squeak VW VA #Smalltalk Dolphin