One of the things I was most impressed with when digging into Pharo was that the Finder could do find-by-example. I'd previously only seen this in languages like Haskell, where it's possible to know for certain that a function has no side effects. How does Pharo manage to implement this in a way that is safe, performant, and side-effect free?
Asked
Active
Viewed 1,548 times
1 Answers
17
Magic :)
Actually... although I've been dreaming about creating the list from the tests automatically, the reality is that we manually maintain a list of safe messages (obviously error-prone; I seriously doubt it's 100% accurate). See MethodFinder>>#initialize
.
So a trick, but not exactly magic ;)

Sean DeNigris
- 6,306
- 1
- 31
- 37
-
6Thanks! BTW, I'm using this capability to melt faces over here:http://devblog.avdi.org/2015/05/11/in-which-i-make-you-hate-ruby-in-7-minutes/ – Avdi May 11 '15 at 21:46
-
10It's worth noting that Pharo inherited this capability from Squeak Smalltalk. The Method Finder (by Ted Kaehler) is more than 15 years old now). – codefrau May 12 '15 at 08:03
-
4Squeak was is and will be awesome, Pharo is based on it and owes so much to the hard work of people that made Squeak possible. Thanks guys. – Kilon May 12 '15 at 10:44
-
5@BertFreudenberg let's also add that Kaehler's goal was to provide "programming by example" capabilities. The finder was a very nice step in that direction. The finder could also be related to implementing transactions (as GemStone does) or, more ambitiously, undo. – Leandro Caniglia May 12 '15 at 15:01