TL;DR: Learning Smalltalk
- Run Pharo http://pharo.org/
- Use Moose http://www.moosetechnology.org/
- Try SmaCC https://github.com/ThierryGoubier/SmaCC
Main sources:
- http://pharo.org/
- http://www.moosetechnology.org/
- http://www.refactoryworkers.com/SmaCC/Tutorial.html
Good resources:
- http://blog.fossasia.org/pharo-launcher-what-how-pharoinprogress/
- http://ceronio.net/2017/07/first-steps-with-pharo-smalltalk/
- PharoByExample
- http://files.pharo.org/media/pharoCheatSheet.pdf
- http://files.pharo.org/books-pdfs/booklet-Smacc/2017-05-05-Smacc-Spiral.pdf
- https://pharoweekly.wordpress.com
brew cask install pharo-launcher
# Chose Moose 6.0
# follow http://themoosebook.org/book/index.html#h1mooseinanutshell
Pharo6.0.app/Contents/MacOS/Pharo Pharo6.0.app/Contents/Resources/Pharo6.1.image
World (click) -> Playground
ProfStef go. (cmd+d to evaulate, using "Do It")
a := OrderedCollection new
add: 1;
add: 2;
add: 3;
yourself.
a. (cmd+p to print)
Number extend [
my_factorial [
(self < 2) ifTrue: [ ^1 ]
ifFalse: [ |c|
c := OrderedCollection new.
2 to: self do: [ :i | c add: i ].
^ (c fold: [ :a :b | a * b ] ) ]]].
7 factorial.
7 my_factorial.
a := OrderedCollection new
add: 1;
add: 2;
add: 3.
Transcript show: a.
Built-in tools and commands:
- Playground/workspace: "Do it", "Print it", "Insepct it"
- Transcript as
console.log
orSystem.out
- System Browser message or cmd+b
- Spotter - just Shift+Enter
#class
#implementor
Steps:
-
Extract the data, build model
wget .../jdt2famix-bin-1.0.3.zip unzip jdt2famix-bin-1.0.3.zip git clone --depth 1 [email protected]:rastaman/argouml-maven.git cd argouml-maven mvn dependency:copy-dependencies -DoutputDirectory=dependencies -DoverWriteSnapshots=true -DoverWriteReleases=false ../jdt2famix-1.0.3/jdt2famix.sh
-
Open Moose: World (click anywhere) -> Moose
-
Load the model: MSE (right corner) -> coose "argouml-maven.mse"
-
Select just loaded "argouml-maven" model
-
Select "All methods"
-
Visualize all/@Deprecated methods
view := RTMondrian new. view shape circle if: [ :each | each isAnnotatedWith: 'Deprecated' ] color: Color red. dep := (self, ( self flatCollect: #clientTypes ) ) asSet. view nodes: dep. view layout grid. view
Further reading:
- http://themoosebook.org/book/index.html
- https://moosequery.ferlicot.fr/userdocumentation.html
- http://agilevisualization.com/AgileVisualization/QuickStart/0101-QuickStart.html
-
World (click anywhere) -> Tools -> SmartCC Parser Generator
-
Simple grammar
<number> : [0-9]+; <whitespace> : \s+; Expression : Expression "+" Number | Number ; Number : <number> ;
-
add Scanner/parser names
- Options -> Scanner Class
- Options -> Parser Class
-
File -> Save
-
Test tab
3 + 4
- Validate: (Select text) -> Evaluate
- Inspect AST: (Select text) -> Inspect
http://exercism.io/ is awesome, but lacks any Smalltalks for now.
-
was a request, but un-maintained
-
new project \w Github https://github.com/dalehenrich/metacello-work/blob/master/docs/GettingStartedWithGitHub.md
-
Test + CI
- Code visualization https://wettel.github.io/codecity.html
- Code parsers https://github.com/ThierryGoubier/SmaCC (\w PetitParser, both are part of Moose)
- https://medium.com/smalltalk-talk/how-learning-smalltalk-can-improve-your-skills-as-a-programmer-fc5b2f56685
- https://medium.com/@richardeng/an-open-letter-to-all-universities-ad98af4a96b3
- https://medium.com/smalltalk-talk/in-praise-of-the-very-best-programming-language-eae36ae434af
+ image-based approach to programming (Docker/VirtualBox)
+ everything is an _object_ (blocks, control structures, etc) that sends _messages_
+ Less is more: No type declarations, no primitive objects,
no generic types, no modifiers, no operators, no inner classes,
no constructors, and no static methods
+ Awesome tooling: System Browser, Spotter
+ at least single VM tree: https://github.com/OpenSmalltalk/opensmalltalk-vm
+ Existing grammars in SmaCC: JS, Java, C/C#, etc
- fragmentation of the world: VisualWorks, Dolphine, Squeak, Pharo, GemTalk, ...
- external Pharo-launcher to manage VMs/Images that the OS app loads
- no propper default keybidings support for editors :/