[Newcompiler] Does the new compiler work for Tweak?

Marcus Denker denker at iam.unibe.ch
Wed Dec 3 19:26:49 UTC 2008


On 03.12.2008, at 19:49, Ken G. Brown wrote:

> Would it make sense to add the appropriate modifications to the new  
> compiler so that Tweak could be used?

I don't know. The Tweak Properties clash with the new properties  
introduced in 3.9:

Something lie <ticking: 50> would directly result in  a property, key  
#ticking, value 50 in Tweak. We decided
that properties and Annotations are two different things, so <ticking:  
50> does result in a Pragma in Squeak,
not a property. The pragmas/properties we added to Squeak are useful  
for many things, whereas Tweak propertes are
only for the use in Tweak. For example, contrary to Tweaks properties,  
we can destinguish source-visible annotations and
sourse-non-visible properties. This means, among other things, that we  
can actually decompile correctly without
having to use random gussing ("hey, the property "ticking" is there  
because there was an annotation (not sure, but what
else can I do), but there is no syntax for "foo", so that one has to  
be non-source visible for sure").

There are other design-decisions we did differently, e.g. we wanted to  
be able to have multiple annotations with the
same key.

Another thing is that the active variables in Tweak are just for  
Tweak. There is no meta-object protocol to make your own
kind of active variables. For me, this alwasy looked like a hack.

In general, the question is if Tweak makes sense outside of Croquet  
these days...

	Marcus

>
>
> At 7:23 PM +0100 12/3/08, Marcus Denker apparently wrote:
>> On 03.12.2008, at 19:20, Ken G. Brown wrote:
>>
>>> On the croquet-dev list, John Dougan mentions that "Tweak uses a  
>>> modified compiler".
>>> Does the new compiler work for Tweak?
>>>
>>
>> No, they hacked the old compiler.
>>
>> 	Marcus
>>
>>> Ken G. Brown
>>>
>>> At 6:00 AM -0500 12/3/08, croquet-dev-request at duke.edu apparently  
>>> wrote:
>>>> Date: Wed, 3 Dec 2008 01:41:29 -0800
>>>> From: "John Dougan" <jdougan at acm.org>
>>>> Subject: Re: [croquet-dev] Hard to find instance variables in  
>>>> Croquet.
>>>>
>>>> They're almost certainly not instance vars, but "fields".    
>>>> Fields are
>>>> something like instance vars but they are represented in the  
>>>> myProperties
>>>> dict in the CObject. If a field is not used it won't take up  
>>>> storage in the
>>>> dict.  Tweak uses a modified compiler that translates variable  
>>>> reference
>>>> syntax into accessor message sends and creates accessors  
>>>> automatically so
>>>> that the vars are never actually accessed directly.
>>>> So in Tweak: (assuming that foo is not a method temporary var)
>>>> foo := self bar: 4 + 5.
>>>> self foo: (self bar: 4 + 5).
>>>> do pretty much the same thing in the bytecode. This is useful as  
>>>> it means
>>>> that it's hard to accidentally bypass the event mechanisms in  
>>>> Tweak.
>>>>
>>>> If you browse a subclass of CObject and right click on one of the  
>>>> instance
>>>> vars you'll see a pop up giving you the options for the var.  The
>>>> color/emphasis of the var name tells you what kind of var it is.
>>>>
>>>> Some description of the fields is at
>>>> http://tweakproject.org/TECHNOLOGY/Tutorials/BankAccountTutorial/  
>>>> and at
>>>> http://tweakproject.org/tweak/tutorials/Tweak-Introduction.pdf
>>>>
>>>> Cheers,
>>>> -- John
>>>>
>>>> On Tue, Dec 2, 2008 at 23:46, askoh <askoh at askoh.com> wrote:
>>>>
>>>>>
>>>>> There seem to be many instance variables in the class CPlayer  
>>>>> that are not
>>>>> showing up in the debugger and 'show hierarchy'. Why? Is this a  
>>>>> known bug
>>>>> or
>>>>> something special?
>>>>>
>>>>> Aik-Siong Koh
>>>>> --
>>>>> View this message in context:
>>>>>
>>>> http://www.nabble.com/Hard-to-find-instance-variables-in-Croquet.-tp20808243p20
>>>> 808243.html
>>>>> Sent from the Croquet - Dev mailing list archive at Nabble.com.
>>>>>
>>>>
>>>>
>>>> --
>>>> John Dougan
>>>> jdougan at acm.org
>>
>> --
>> Marcus Denker  --  denker at iam.unibe.ch
>> http://www.iam.unibe.ch/~denker
>

--
Marcus Denker  --  denker at iam.unibe.ch
http://www.iam.unibe.ch/~denker



More information about the Newcompiler mailing list