[squeak-dev] Re: talk on Newspeak online

Klaus D. Witzel klaus.witzel at cobss.com
Thu May 8 11:33:04 UTC 2008


On Thu, 08 May 2008 12:30:54 +0200, Igor Stasenko wrote:

> 2008/5/8 Klaus D. Witzel <klaus.witzel at cobss.com>:
>> On Thu, 08 May 2008 00:17:07 +0200, Vassili Bykov wrote:
>>
>>
>> > I have considerable experience programming in both Smalltalk and
>> > Newspeak, and (despite my email address) I'll say that Newspeak is an
>> > improvement in a number of aspects. That includes constructors.
>> >
>> > The knee-jerk reaction of "X is crap because $(language_name) which
>> > has X is crap" can prevent you from seeing the nature of the issue.
>> >
>>
>>  Vassili, this is squeak-dev list here, in which nobody would ever call  
>> a
>> language which based on Smalltalk (and Self) as being *crap*.
>>
>
> C++ is crap, Java is crap, anyone wants to argue?

This I what I thought but, you wrote it in your words ;)

> And borrowing crappy concept from crappy language produces crap.
> Crap, despite how good it looks like outside (syntax sugar) still
> stays crap inside. ;)

We'll see what *crap* you will produce (when Newspeak is released) when  
you're asked to then show solutions (in then existing Newspeak code) for

o every class can be mixed in [modulo slot name collision]
o modules are containers with high degree of isolation
o no extra code to make *something* a module
o subclassing guarantees proper initialized subinstances

Can we stick with "redundant" instead of "crap" for the moment? ;)

> More about this at the end of message.
>
>>  We [yes, I think: we] all admire the tremedous work you folks are doing
>> with developing Newspeak on the Squeak platform. I know many of us who  
>> can't
>> wait to get a full copy of Newspeak on their notebook, same for myself  
>> (if
>> only to browse for the first time in life a *very*high*modular*
>> messaged-based Smalltalk-rooted system ;-)
>>
>
> I'm looking forward to see Newspeak on my box.
> But my primary concern is not language problems (and what tricks
> authors made to get around them), but paths taken to meet goals of:
> - modularity
> - locality
> - security
> - reflectivity
> - flexibility of kernel/libraries.
>
>
>>  AFAICT Igor is concerned about reduncancy and stiffness with particular
>> language design decisions, on Newspeak constituents which he is used to
>> implement himself in Smalltalk, on the fly and in such a way that it  
>> befits
>> his actual project and not the language designer.
>>
>
> Right. One more point: What about metaprogramming?

I once read that Newspeak has sort of (anObject reflect) the mirror  
approch of Self (that is, no #class message).

> Does anyone finds following pattern as bad style of programming? :

Yes, me ;) I dislike your constants (strings and class names as well). I  
know you can do better ;) Also, you must change your method once you have  
one more platform (or after one is renamed to Microhoo ;) I prefer  
production systems that can be changed without compiling existing methods  
(for example, when foo is temporarily not supported but Mac can do part of  
its job for a while).

> MyExternalModule>>new
>    Smalltalk platformName = 'Windoze' ifTrue: [ ^ MyWin32ExternalModule  
> new ].
>    Smalltalk platformName = 'Mac' ifTrue: [ ^ MyMacExternalModule new ].
>    Smalltalk platformName = 'foo' ifTrue: [ ^ MyfooExternalModule new ].
> self error: 'Unsupported platform'.

MyExternalModule>>#newFor: platName
  (Symbol hasInterned: platName ifTrue: [:sym | sel := sym])
    ifFalse: [self error: '*unknown* platform name'].
  subclass := self platsSupported at: sel ifAbsent: [self error:  
'*unsupported* platform name'].
  ^ subclass new

> The users of class does not care about subclasses and calling uniform
> MyExternalModule>>new which returning a proper instance for working on
> current platform.
> Interesting, how above looks in Newspeak?

Preferable the way I rewrote it above (not only because that way it can be  
done in Newspeak ;)

> Also, how about creating anonymous instance factories (also known as
> classes) on the fly?
>
> AnonClassFactory>> x: aX y: aY
>   | newClass |
> newClass := ClassBuilder new
> 		newSubclassOf: self
> 		type: self typeOfClass
> 		instanceVariables: ''
> 		from: nil.
> ^ newClass new x: aX y: aY

This one addresses my concern: just put (... newSubclassOf: anArgument  
...) into the above and then begin to wonder about what's the constructor  
message selector's name :|

> And finally, who told that, ultimately, only classes can create  
> instances?
> Its interesting, in what way something like Prototype package can be
> implemented in NewSpeak?
>
> Personally, i see that constructors putting flaws in message-oriented
> principles of NewSpeak.

Do you think that it cannot be circumvented by the developer one way or  
the other in Newspeak?

If yes, why not?

> They shifting responsibility of message handling from developer's
> hands to compiler's hands and introducing unnecessary constrains
> forcing future developers to invent schemes how to avoid/sidestep
> them.
>




More information about the Squeak-dev mailing list