On 16 February 2011 22:00, Stéphane Ducasse <stephane.ducasse@inria.fr> wrote:
Ok this is my last mail on that topic.
apparently not ;)
yes now do not think that I'm implying that you are not able to implement a decompiler. Now we have something else to do that dealing with the optimisation of a stupid method. This is all my point. Let us focus on the real problems. eliot is crying for caseOf: but we have 3 users.
Did you know that there are several uses of caseOf: in the Opal compiler?
(selector := aMessageNode selector) Â Â Â Â Â Â Â Â caseOf: Â Â Â Â Â Â Â Â Â Â Â Â {([ #ifNil: ] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -> [ self isValueTranslator ifTrue: [ methodBuilder pushDup ] ]). Â Â Â Â Â Â Â Â Â Â Â Â ([ #ifNil:ifNotNil: ] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -> [ args last arguments ifNotEmpty: [ args last arguments first binding emitStore: methodBuilder ] ]). Â Â Â Â Â Â Â Â Â Â Â Â ([ #ifNotNil: ] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -> [ args first arguments ifNotEmpty: [ args first arguments first binding emitStore: methodBuilder ] ]). Â Â Â Â Â Â Â Â Â Â Â Â ([ #ifNotNilDo: ] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -> [ args first arguments ifNotEmpty: [ args first arguments first binding emitStore: methodBuilder ] ]). Â Â Â Â Â Â Â Â Â Â Â Â ([ #ifNotNil:ifNil: ] Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â Â -> [ args first arguments ifNotEmpty: [ args first arguments first binding emitStore: methodBuilder ] ])}.
yikes... so Opal already polluted (as being non-pure) by premature optimizations :) You see the tendency: one premature optimization drags other after itself. I would suggest to make full & working compiler suite which doing no any optimizations/inlining, and only then, when everything works, add a code with inlining optimizations as a plugin. So, people will know, that this is _optional_ not mandatory and not hardwired into smalltalk compiler. This is the message a good compiler should pass to developers: optimizations are useful but not essential. But i am not analyzed Opal code deeply, maybe its already like that.
 Do you have such an encyclopaedic knowledge of all the packages ever written in Pharo and Squeak that you know* you have only 3 users?  Of course you don't.  You are being ridiculous.
Now when opal will arrive people should be prepared that probably caseOf: will not be inlined.
Stef
-- Best regards, Igor Stasenko AKA sig.