[squeak-dev] Pragma support in Squeak/Pharo/Cuis

Juan Vuletich juan at jvuletich.org
Fri Jan 28 14:27:39 UTC 2011


Igor Stasenko wrote:
> On 28 January 2011 13:59, Juan Vuletich <juan at jvuletich.org> wrote:
>   
>> Torsten Bergmann wrote:
>>     
>>> Hi,
>>>
>>> I would like to port the recent changes made to HelpSystem
>>> (for instance to be able to mark a method with a pragma
>>>  like <wikiStyleHelp: 'My Book'>)
>>> This would allow to define and load help contents without any dependency
>>>       
>
>   
>>> on the help system.
>>>
>>> Unfortunately Squeak now differs (a little bit?) from Pharo regarding the
>>> Pragma support. There is no PragmaCollector class, ...
>>> Dont know if there are more differences, any ideas/experiences?
>>> What about Cuis?
>>>
>>> Would'nt it make sense to use a similar implementation in all worlds?
>>> Comments appreciated.
>>> Thx
>>> T.
>>>       
>> Hi Torsten,
>>
>> You mean "method annotations" right? ('Pragma' has a completely different
>> meaning in the language / compilers that use them, and is a very bad name
>>     
>
>   
>> for this).
>>
>>     
> Is this sarcasm? yeah?
>   

Not at all.

> This naming used for years, and now it became not simple bad, but
> _very_ bad name :)
>   

A pragma is a directive to the compiler to control some detail of the 
code generation. Method annotations are not pragmas. Calling them 
'pragmas' is misleading. This has already been discussed here. I believe 
the outcome of that discussion was that "method annotations" was the 
correct name.

>> Cuis doesn't currently support method annotations.
>>
>>     
>
> huh... how then you specifying a primitive(s) in method? and FFI?
> or in same way you can say.. yeah this is not pragma , its a primitive..
> but it doesn't makes any difference.
>
> You may call it  'a method's meta-data' or any other way you like it,
> i _dont_ care!
> As long as the idea behind is will remain same.
>   

I was wrong, apologies. Cuis does support method annotations, I just 
forgot I had integrated that code.

Side note: Squeak and ST-80 had primitives using the <primitive: nn> 
syntax long before anyone thought about adding "pragmas" "method 
annotations" or whatever. Besides, primitive and ffi calls are neither 
pragmas nor method annotations nor meta-data. They are a syntax for the 
compiler to generate executable code, i.e. they are source code. Calling 
them 'pragmas' or 'meta-data' is mixing two different concepts.

Unfortunately, the code calls it 'pragma' everywhere. It seems the name 
'pragma' is here to stay. So, when someone comes from another 
programming language we'll have to explain "The word 'pragma' sometimes 
means a kind of procedure call (primitives, ffi), and sometimes it means 
'method annotation' or 'method metadata'; but it never means 'compiler 
directive' to us" ...sigh...

Cheers,
Juan Vuletich



More information about the Squeak-dev mailing list