Hi Hernan,
What do you mean exactly? I don't have clear recollection of whether they were in Squeak in 08 or if I ported then, but at that time CompiledMethod had a properties object, and pragmas were merged into this. What I did do was save a lot of space getting rid if the properties object unless a method needed it. And IIRC I changed the implementing class from MethodProperties to AdditionalMethodState. So there was no additional level of representation. a) the syntax was already there fir primitives and b) the state was already there in methods.
No it can't. Common sends are executable and we don't want pragmas executed when the method is run, we want the pragma executed when the method is added, or analysed. That was what was ugly about the use of plain sends in e.f. VMMaker, that there had to be lots of empty implementations of the messages used for metadata.
So using normal sends
- prevents the metadata from being directly executed because executing them when the method is run is wrong
- confuses meta level and normal level, putting them at the same level, and hence...
- confusing for the programmer because its not obvious what's metadata and what's a normal send
- makes analysis harder for the same reason
I disagree. I want to see the pragma. It has essential information that shouldn't be hidden. I want to edit it easily. And how can you in the one hand say it can be implemented as a normal message send a d at the same time want it hidden? Be consistent :-)
Not for pragmas that are just labels. And what's destination? In the menu building example above the destination"is the menu but the receiver is the menu builder. So I think that what the receiver is depends on usage.
I don't understand this. Can you expand?
I don't get the example, because of the confusion of meta layers.
<eventRegistration>
says "this is metadata"
| eventRegistration |
says "this is a bug in the method because the variable isn't used, and eg Opal will remove it so it won't be there".
{ eventRegistration }.
I guess you mean { #eventRegistration }. If so this is the same. An optimizing compiler will delete it.
self eventRegistration.
says "send myself eventRegustration". Which /isn't/ what's wanted.
So for me only the pragma implies "this method is to be registered with the event system". The middle two say "I am a bug, or syntax error". The last one says "I am a normal send".
I'm finding this whole conversation exhausting.
By putting a break point in its implementations.
No. But you can out a conditional breakpoint in CompiledMethod>>pragmaAt: or in the pragma's implementation.
By reading the broader system or adding break pints as just described.
Using "implementors" and "senders" you can find out where it may be used. One if the problems of late-bound systems is figuring out what binds to what. Pragmas are more difficult to figure out unless pragmas have clearly commented implementations.
That's a mischaracterisation. Most of their uses are for pluggable GUIs. And if this is so onerous why weren't you protesting <primitive: 123>?
The cons are that for years, and at length, one has to defend a good idea ;-). Pragmas were a new idea and here in thus conversation we see how resistant we are to new ideas. I've seen nothing against the need for per-method metadata and a lot on how it can be done with other mechanisms. But the existing mechanisms don't do one of two things
- separate normal from meta levels
- obviously associate metadata with methods.
So what I'm missing in this conversation is addressing the issues:
- how in a componentised loadable system do we decouple component loads where components collide in areas like global menu definitions, inspectors, etc?
- how do we associate metadata with methods so that
- the metadata is of a form that fits well with the host system?
- the metadata is clearly associated with the method it is data of?
- the bookkeeping is managed?
You could add good questions here. But these are the questions I was thinking of when we added pragmas to VW.