[squeak-dev] Re: Pragmas (Re: The Inbox: Morphic-phite.429.mcz)

Igor Stasenko siguctua at gmail.com
Mon Apr 26 20:56:53 UTC 2010


On 26 April 2010 23:41, Andreas Raab <andreas.raab at gmx.de> wrote:
> On 4/26/2010 1:14 PM, Igor Stasenko wrote:
>>
>> On 26 April 2010 22:05, Andreas Raab<andreas.raab at gmx.de>  wrote:
>>>
>>> On 4/26/2010 11:48 AM, Eliot Miranda wrote:
>>>>
>>>> OK, so Pragma is bad; its historical from "primitive pragma".  But
>>>> Annotation doesn't capture the potentially executable flavour of
>>>> pragmas.  How about MethodMetaMessage?  (mmm, yum :) )  We could talk
>>>> about meta-messages for short. "Add a meta-message that does ..." etc...
>>>
>>> But "primitive pragma" is every bit as wrong. A pragma is something that
>>> gives the compiler information about the code without being code itself.
>>> Primitives are't pragmas, primitives are *code* (if you don't believe me,
>>> just remove all of them and see how that goes).
>>>
>>> By definition, a "pragma" is an interface between the code and the
>>> compiler,
>>> something where the code conveys meta-information to the compiler. For
>>> example, this is a pragma (assuming the compiler understands it):
>>>
>>> foo
>>>        <inline: true>
>>>
>>> bar
>>>        <tailcut: true>
>>>
>>> The first one might instruct the compiler to generate the code for this
>>> method inline, the second one to eliminate tail recursion.
>>>
>>> None of these, however, are pragmas:
>>>
>>> foo
>>>        "Not a pragma since it's not for the compiler"
>>>        <preference: 'Foo Preference'
>>>          ...
>>>        >
>>>
>>> apiGetWindowFocus
>>>        "Not a pragma since it's code"
>>>        <apicall: ulong 'GetWindowFocus' (void)>
>>>
>>> etc. I should also add that before the introduction of the so-called
>>> "pragmas" there was only *code* used in the<>  syntax (primitives and FFI
>>> calls) and the change to allow non-code entities is something that,
>>> although
>>> useful, still worries me because of the conceptual issues associated with
>>> mixing code and non-code entities. We wouldn't even have that discussion
>>> if
>>> <>  just meant "code".
>>>
>>
>> Pragmas are not code, even in old and limited forms, they simply
>> contain a meta-information for compiler.
>
> That is *precisely* what I said in the beginning: "A pragma is something
> that gives the compiler information about the code without being code
> itself". Here, I was referring to "<> syntax" which used to be code, and now
> it no longer is. Calling it "pragma" however is just completely and utterly
> wrong in whichever way you look at it.
>
>> If pragmas would be the code, then i expect them to look like code i.e.:
>
> I never claimed that that "pragmas are code". In fact, I said *specifically*
> the opposite.
>

Ok, then i wonder, what is the subject of discussion?
If its only about terminology, then its not interesting. We may call
it pragma, method annotation or whatever.
I think that more improtant is how we handling it and what we can do with it.

> Cheers,
>  - Andreas
>
>



-- 
Best regards,
Igor Stasenko AKA sig.



More information about the Squeak-dev mailing list