[Pharo-project] IS Smalltalk Source also an object?
bschwab at anest.ufl.edu
Tue Oct 18 15:11:29 EDT 2011
Maybe I've played too much football without a helmet or did too much C programming, but I see two questions popping out of this: (1) is source an object in Smalltalk; (2) in which languages/systems is source an object?
This is an interesting debate.
From: pharo-project-bounces at lists.gforge.inria.fr [pharo-project-bounces at lists.gforge.inria.fr] On Behalf Of Eliot Miranda [eliot.miranda at gmail.com]
Sent: Tuesday, October 18, 2011 1:43 PM
To: Pharo-project at lists.gforge.inria.fr
Subject: Re: [Pharo-project] IS Smalltalk Source also an object?
On Mon, Oct 17, 2011 at 1:35 AM, Marcus Denker <marcus.denker at inria.fr<mailto:marcus.denker at inria.fr>> wrote:
On Oct 17, 2011, at 10:25 AM, Guido Stepken wrote:
> Hi, there!
> I had a nice conversation about Smalltalk among software architects:
> I claim smalltalk to be the only programming system, where source is an object too, with all advantages and disadvantages!
> Am i right?
No, source is ascii text in Smalltak, and it's on the disk even.
Hang on. While I agree that the ideas in sub-method reflection really do make source an interesting object it is still the case that method sources and class comments /are/ objects, albeit only strings, even if implemented in an odd way with storage outside the image (but a really useful way since it provides for crash recovery). There are few other systems in which, in the running program, one can access the source of a method, bit in Smalltalk I can say thisContext method getSource, and that is I think Guido's point.
The only thing that is objects are classes and methods. Below of a full method, the reflective model stops.
(you can ask the compiler to make an AST from the dead code on disk, but that model is not causally connected
and thus not reflective, and it's only there when you create it. This you can do in any language, though).
Of course it is interesting what happes when one fixes that...
Marcus Denker -- http://marcusdenker.de
More information about the Pharo-dev