[squeak-dev] Re: talk on Newspeak online

Florin Mateoc fmateoc at gmail.com
Fri May 9 06:04:00 UTC 2008


Vassili Bykov wrote:

...
> This snippet illustrates many Newspeak things at once: absense of
> global state, nested classes and classes-as-modules, read-only slots,
> and message privacy. The top-level class ExternalModule plays the role
> of a module. The argument 'platform' is a platform object the module
> user will provide at the time a module instance is created, for
> example as:
>
>   
One thing that I particularly like about Smalltalk is precisely the 
small number of features/concepts.
I don't think that more is always better, and all those "crappy" 
languages prove it again and again.

> Some other points.
>
> Regarding freedom vs restrictions and predefined mechanisms, you have
> to realize that very often abstraction design is like cutting a
> fractal border with a straight knife. No matter how you do it, by
> imposing regularities you leave something unnecessary and cut off
> something useful. This is why any example like "here is one case where
> X is clearly better than the alternatives" never proves anything by
> itself, being only an isolated case. It's all a matter of statistics
> and priorities.
>

Yes, you can always make a case that, as the developer of a piece of code, you want for example something to be read-only. In reality, if your code is to survive and to be shared with others, you will never be able to foresee the needs of all the developers coming after you that will (have to) maintain that code. Smalltalk is a blessing in this regard, because no matter how screwed up the legacy code is, one can always find a way to adapt it to new realities. In big part, this is because Smalltalk does not enforce almost anything, unlike languages that embrace the paradigm that the original developer always knows best (as if the original Java or C# developers always knew best when they built their first version of their class library. Or their second. Or their third...).

To give other examples of "order and discipline" concepts (or, as you 
call them, "imposing regularities") that proved much worse than what 
they gained: checked exceptions in Java, the non-override default for 
methods in C#, and of course, visibility rules in all of them (and now 
it seems in Newspeak).

Right now, at work, in a Java project, we cannot (easily) move to newer 
versions of SWT because, as we needed access to aspects that the 
original developers considered internal machinery (so they did not 
expose them as an API),  we had to add stuff to their packages. And now 
they sealed their packages. Because they can, and because they know 
better. Why do they even bother to distribute the sources?

Not all developers are the same, not even if we only consider the 
brilliant ones. Some are more paranoid than others, some are more 
over-engineerish than others, some are more frugal, some are more 
hackish. If you happen to find yourself downstream from a paranoid one, 
and the language supports his or her paranoia, you are out of luck

> Regarding constructors "implemented" in Smalltalk--it shows two things
> at once. 1) there if enough reflection in Smalltalk to implement
> something like this, and 2) there is not enough syntactic abstraction
> to hide the boilerplate and make it usable. There is a similar issue
> with providing list comprehensions within Smalltalk/Newspeak syntax.
> It's easy to do the work, but it's impossible to hide all the exposed
> wiring, avoid binding names more than once, etc. In the end, it's only
> a proof of concept and not a *usable* feature.
>
>   

And here I have to disagree again. I have worked on a large and 
successful Smalltalk project, where some such internal machinery was 
developed to add all kinds of semantics to the slots: default 
values/initializers, constraints (types/values), persistence, 
object-graph ownership relations, ... Yes, if you looked, you could see 
the wiring. So what! It worked very well and no language will ever come 
up with all the useful semantics that one may want to add.
At least Smalltalk lets you do it. Gilad with his pluggable type systems 
should know better

Cheers,

Florin



More information about the Squeak-dev mailing list