TL;DR: Learning Smalltalk
- Run Pharo http://pharo.org/
- Use Moose http://www.moosetechnology.org/
- Try SmaCC https://github.com/ThierryGoubier/SmaCC
Main links:
- http://pharo.org/
- http://www.moosetechnology.org/
- http://blog.fossasia.org/pharo-launcher-what-how-pharoinprogress/
- http://ceronio.net/2017/07/first-steps-with-pharo-smalltalk/
- PharoByExample
- https://github.com/SquareBracketAssociates/UpdatedPharoByExample
- https://ci.inria.fr/pharo-contribution/job/UpdatedPharoByExample/lastSuccessfulBuild/artifact/book-result/PharoTour/PharoTour.html
- 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
- Code visualization https://wettel.github.io/codecity.html
- Code parsers https://github.com/ThierryGoubier/SmaCC (\w PetitParser, both are part of Moose)
-[x] 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
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 printNl.
a := OrderedCollection new
add: 1;
add: 2;
add: 3.
Transcript show: a.
Playground/workspace: "Do it", "Print it", "Insepct it", "Do it and go" (for visualizations)
Transcript as console.log or System.out
System Browser message or cmd+b
Spotter - just Shift+Enter
#class#implementor
-
Extract the data, build model
wget .../jdt2famix-bin-1.0.3.zip unzip jdt2famix-bin-1.0.3.zip git clone --depth 1 git@github.com: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
- 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
Validate: (Select text) -> Evaluate Inspect AST: (Select text) -> Inspect3 + 4
-
was a request, but un-maintained exercism/discussions#143 https://github.com/exercism/trackler/commit/a3649436fa532e9c5f80b893a95206273a3110e4
-
new project \w Github https://github.com/dalehenrich/metacello-work/blob/master/docs/GettingStartedWithGitHub.md
-
Test + CI https://docs.travis-ci.com/user/languages/smalltalk/ https://ci.inria.fr/pharo-contribution/job/UpdatedPharoByExample/lastSuccessfulBuild/artifact/book-result/SUnit/SUnit.html https://github.com/hpi-swa/smalltalkCI#how-to-travis
- 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 :/