Squeak-dev Digest, Vol 22, Issue 20

Blake blake at kingdomrpg.com
Sat Oct 16 05:49:11 UTC 2004


On Fri, 15 Oct 2004 16:57:54 -0400, Colin Putney <cputney at wiresong.ca>  
wrote:

> In many languages, there is a difference between compile-time and  
> run-time. In Smalltalk there is not. I'll say that again, because it's  
> really important to be clear about it: in Smalltalk, run-time is all the  
> time.

Yeah, but it's not true.<s>

Just because the VM is always running and you're developing in it doesn't  
mean there's no design-time for your code.

> Advocates of static typing always seem to talk about being notified of  
> errors earlier, and how this is desirable because of the cost of change  
> curve, etc. In Smalltalk, that simply doesn't apply. The fact that  
> executing a method necessarily occurs after it is compiled is irrelevant  
> because compilation time is negligible. In Smalltalk, you're running the  
> method before a static language has even finished compiling.

Ever used Delphi? It notifies you of errors as they occur, it notifies you  
again at compile time--which, in most cases, will occur far more quickly  
than you'll be able to test your Smalltalk method--and in many cases  
you'll be able to debug runtime as quickly, though not as flexibly.

> A compiler should only check for errors that would prevent correct  
> compilation. Other tools might check for other errors, though.

Difference of opinion; again, I look at static typing as self-defense and,  
dare I say it, self-documentation.

> Nor do I. Let me head back towards middle ground by making this  
> distinction: I don't think static type analysis is useless, I just don't  
> think it should be built into the language or done by the compiler. It's  
> a tool that can help us write, understand and debug our code - as is  
> unit testing. The more tools we have for that, the better.

Interesting: How would the user communicate the desired type, and how  
would the tool--well, this sounds like what I was saying when you raised  
this issue in the first place: I've followed the progress of Delphi from  
it's roots as a relatively pure Pascal environment (Turbo Pascal) to it's  
current state, with compiler directives (as part of the language) and  
design-time versus run-time packages.

The archetypal example that I can think of is the "published" directive.  
"Published" tells the compiler that you want this feature to be visible in  
the design-time environment--which is, after a fashion, it's own run-time.

And maybe that's where the answer lies. Maybe it is (or should be) all  
run-time, but not all run-times are equal.

> The problem with building typing into the language means that you're  
> stuck with it for ever afterwards. If you come up with a better type  
> system, you have to write a whole new language to take advantage of it.  
> When the analysis tool is optional - and hence cleanly separated from  
> the core language semantics - it can be replaced by a more advanced or  
> more appropriate system without breaking the existing code or tools.

Yeah, that's something to chew on. I still don't see how the programmer  
communicates what he wants. I don't see static typing as a passive thing  
one endures.

> Andreas, is this explanation helpful? II assume you joined this list and  
> this discussion because you're interested in Squeak, Smalltalk, or  
> dynamic languages in general. I'm replying to your post in the hopes of  
> helping you understand why otherwise rational programmers would discard  
> the safety of type-checking. If that's not something you find  
> interesting, say so.

No, that's why I'm here. I've been using Smalltalk since...whee-oo...'93,  
VisualAge Smalltalk. (One of the few jobs I've ever had passing regrest  
about not taking was an offer for IBM to work at the 1996 Olympics. But  
for some reason it involved moving to Colorado Springs.)

I've been following Squeak for years, just dabbling, unfortunately, but  
I'm faced with a couple of big issues: Teaching children, and a large-ish  
project that's currently being done in a (nightmarish) Access-like DBMS  
system that I =know= is going to need to be rewritten, and which I'm going  
to be called on to provide a list of viable options.

So, I'm very interested in all this stuff. I hope I'm not boring anyone.<s>




More information about the Squeak-dev mailing list