5 ms·
This may not be immediately apparent, but I discovered that Smalltalk did not fit into the 'programming language' concepts in my head. I think of a typical byte
by shalabhc 9y ago
This may not be immediately apparent, but I discovered that Smalltalk did not fit into the 'programming language' concepts in my head. I think of a typical bytecode VM language as
[source code] -> [interpreter] -> [running program]
Instead Smalltalk is more like
[running program] + [auto persistence] + [editing tools]
So you don't modify large gobs of source code files, you modify the running program from within - aka live editing. The running program consists of a network of interconnected objects. You use the textual syntax also - but only to modify parts of the already live program (e.g. you could 'install' a new method on an existing class object). You inspect the running program using graphical browsers (typically also part of the same program) - and everything you modify is live immediately.
The syntax of Smalltlak is interesting (can be seen here https://en.wikipedia.org/wiki/Smalltalk#Syntax https://en.wikipedia.org/wiki/Smalltalk#Syntax). But the more interesting aspects of the experience are the live editing, working with network of objects, hybrid text/non-text ways of modifying these objects, etc.
- vvdcect 9y ago> [running program] + [auto persistence] + [editing tools] How do you use TDD when coding like this?
- stcredzero 9y agoHow do you use TDD when coding like this? There were some utilities that let you run the tests at the push of a button.
- bertfreudenberg 9y agoKent Beck invented TDD while programming in Smalltalk. You first extend the environment with tests, then add the code to make them green. All without ever having to restart the "program".
- e12e 9y agoI admit the question made me smile, but it's a great question. I found these short videos, that are maybe the shortest possible answer (less than 3 minutes, I just watched them w/o sound, auto-captioned): Pharo: https://youtu.be/ymITEeAOtEA https://youtu.be/ymITEeAOtEA Cinecom Smalltalk: https://youtu.be/mXoxfmcDDJM https://youtu.be/mXoxfmcDDJM
- shalabhc 9y agoOthers have answered but interestingly, TDD was 'built-in' to the Pharo tutorial I did a while back. Basically you write a test first, say it calls an undefined method `x.somemethod()`. You push a button to run the test, as soon as the method call fails, the environment shows you a popup which lets you define the method right then and there, while you have all the details of the suspended execution. You can write the method and the 'resume' the execution from where it excepted.
- igouy 9y agoSee "Chapter 9 SUnit" in [pdf] "Pharo by Example" http://files.pharo.org/books-pdfs/updated-pharo-by-example/2017-01-14-UpdatedPharoByExample.pdf http://files.pharo.org/books-pdfs/updated-pharo-by-example/2... There are pictures :-)
- ben-coman 9y agoHere is a nice Pharo TDD video (thx Avi) from an author of several Ruby books, when he was trying Pharo... http://www.virtuouscode.com/2015/05/11/in-which-i-make-you-hate-ruby-in-7-minutes/ http://www.virtuouscode.com/2015/05/11/in-which-i-make-you-h...
- spc476 9y agoSo, how do you distribute the program you've just written? That's the issue I have with image based languages.
- shalabhc 9y agoYou distribute the image + interpreter. I presume you could strip the image, but haven't tried it.
- dragonwriter 9y agoImage + VM is the short answer. Slightly longer discussion here: https://pharo.fogbugz.com/default.asp?W78 https://pharo.fogbugz.com/default.asp?W78 Really, not much different than any interpreted language, where you do source + runtime; the image just replaces the source.
- igouy 9y agoIt varies from one Smalltalk language implementation to another. For MS Windows based Dolphin Smalltalk -- "The Lagoon Deployment Wizard strips out redundant components from your image and shrinks your code down to a tight, single click EXE file. Alternatively, you can choose to additively compose your application by building it up from the raw Dolphin boot image."
- vanderZwan 9y agoWell, Pharo seems to have quite a few contributors, so they probably figured something out. Let me have a look.. So, based on these slides about Pharo 6[0], it seems that they use multiple things. First, they have a tool called Epicea, which is a more modern way of tracking changes to an image[1]. Then, for git integration, they have a bunch of tools at pharo-vcs, specifically Iceberg[2]. [0] https://www.slideshare.net/pharoproject/pharo-6 https://www.slideshare.net/pharoproject/pharo-6 [1] http://smalltalkhub.com/#!/~MartinDias/Epicea http://smalltalkhub.com/#!/~MartinDias/Epicea [2] https://github.com/pharo-vcs https://github.com/pharo-vcs, https://github.com/pharo-vcs/iceberg https://github.com/pharo-vcs/iceberg
- igouy 9y ago