Proposal for Extensible Primitives (was: FFI)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
24 messages Options
12
Reply | Threaded
Open this post in threaded view
|

Proposal for Extensible Primitives (was: FFI)

Lukas Renggli
I propose the following changes:

Problem: FFI is hardcoded into the Squeak parser and uses a special
parsing method. While parsing pragmas the implementation has to check
for special conditions (Parser>>pragmaStatement) to trigger special
handling of FFI functions (Parser>>externalFunctionDeclaration). This
adds unnecessary code requirements to the base image and violates the
extensibility of the system.

Current State: Squeak primitives in 3.9 are already parsed using the
pragma parser, they fully comply the new syntax. As a post operation
the parser checks for these primitive pragmas and modifies the
compiled method to call the primitive instead of the fallback code.
FFI primitives have a slightly different syntax than the pragmas
therefor are handled differently.

Solution: Unify parsing of pragmas and FFI primitives. Make the
primitive parsing extensible using pragmas.

Proceeding: As a first step I would remove all the hardcoded code to
parse Squeak and FFI primitives. Then I would tag the already
implemented methods #primitive: and #primitive:module: using the newly
introduced pragma #primitive, so that the parser is able to
automatically detect these methods and postprocess the compiled method
after the parsing.

Proceeding FFI: The FFI package would add two extension methods to the
parser, in the example below these would be #cdecel:module: and
#apicall:module:. The implementation would look similar as the current
implementation in #externalFunctionDeclaration, the parsing however
(except for the C declaration) would have been done by the pragma
parser already. The syntax of FFI primitives would need to be changed
from

        XSetBackground: xDisplay with: xGC with: bg
                <cdecl: void 'XSetBackground' (X11Display* X11GC long) module: 'X11'>
                ^self externalCallFailed

to something like

        XSetBackground: xDisplay with: xGC with: bg
                <cdecl: 'void XSetBackground(X11Display* X11GC long)' module: 'X11'>
                ^self externalCallFailed

As a free goodie, we could now look for all FFI calls by simply
looking at the senders of #cdecel:module: and #apicall:module:.

I can do the proposed changes. We can also discuss about the
implementation, though I won't go into any discussion if pragmas are
good or evil ;-)

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Andreas.Raab
Hi Lukas -

What problem exactly are you trying to solve? The way I understand it
the problem we have is a dependency problem - how can the FFI cleanly
interact with the parser. To do this, I would simply add a class
variable that points to some FFI support class handling the parsing
requests. If the FFI is loaded it registers the appropriate entry point
and it unregisters it when unloading. As far as I can see, no further
changes are needed, in particular none that break compatibility.

Cheers,
   - Andreas

Lukas Renggli wrote:

> I propose the following changes:
>
> Problem: FFI is hardcoded into the Squeak parser and uses a special
> parsing method. While parsing pragmas the implementation has to check
> for special conditions (Parser>>pragmaStatement) to trigger special
> handling of FFI functions (Parser>>externalFunctionDeclaration). This
> adds unnecessary code requirements to the base image and violates the
> extensibility of the system.
>
> Current State: Squeak primitives in 3.9 are already parsed using the
> pragma parser, they fully comply the new syntax. As a post operation
> the parser checks for these primitive pragmas and modifies the
> compiled method to call the primitive instead of the fallback code.
> FFI primitives have a slightly different syntax than the pragmas
> therefor are handled differently.
>
> Solution: Unify parsing of pragmas and FFI primitives. Make the
> primitive parsing extensible using pragmas.
>
> Proceeding: As a first step I would remove all the hardcoded code to
> parse Squeak and FFI primitives. Then I would tag the already
> implemented methods #primitive: and #primitive:module: using the newly
> introduced pragma #primitive, so that the parser is able to
> automatically detect these methods and postprocess the compiled method
> after the parsing.
>
> Proceeding FFI: The FFI package would add two extension methods to the
> parser, in the example below these would be #cdecel:module: and
> #apicall:module:. The implementation would look similar as the current
> implementation in #externalFunctionDeclaration, the parsing however
> (except for the C declaration) would have been done by the pragma
> parser already. The syntax of FFI primitives would need to be changed
> from
>
>     XSetBackground: xDisplay with: xGC with: bg
>         <cdecl: void 'XSetBackground' (X11Display* X11GC long) module:
> 'X11'>
>         ^self externalCallFailed
>
> to something like
>
>     XSetBackground: xDisplay with: xGC with: bg
>         <cdecl: 'void XSetBackground(X11Display* X11GC long)' module:
> 'X11'>
>         ^self externalCallFailed
>
> As a free goodie, we could now look for all FFI calls by simply
> looking at the senders of #cdecel:module: and #apicall:module:.
>
> I can do the proposed changes. We can also discuss about the
> implementation, though I won't go into any discussion if pragmas are
> good or evil ;-)
>
> Cheers,
> Lukas
>


Reply | Threaded
Open this post in threaded view
|

RE: Proposal for Extensible Primitives (was: FFI)

Ron Teitelbaum
+1  (in particular none that break compatibility.)

Ron

> -----Original Message-----
> From: [hidden email] [mailto:squeak-dev-
> [hidden email]] On Behalf Of Andreas Raab
> Sent: Monday, August 14, 2006 8:04 PM
> To: The general-purpose Squeak developers list
> Subject: Re: Proposal for Extensible Primitives (was: FFI)
>
> Hi Lukas -
>
> What problem exactly are you trying to solve? The way I understand it
> the problem we have is a dependency problem - how can the FFI cleanly
> interact with the parser. To do this, I would simply add a class
> variable that points to some FFI support class handling the parsing
> requests. If the FFI is loaded it registers the appropriate entry point
> and it unregisters it when unloading. As far as I can see, no further
> changes are needed, in particular none that break compatibility.
>
> Cheers,
>    - Andreas
>
> Lukas Renggli wrote:
> > I propose the following changes:
> >
> > Problem: FFI is hardcoded into the Squeak parser and uses a special
> > parsing method. While parsing pragmas the implementation has to check
> > for special conditions (Parser>>pragmaStatement) to trigger special
> > handling of FFI functions (Parser>>externalFunctionDeclaration). This
> > adds unnecessary code requirements to the base image and violates the
> > extensibility of the system.
> >
> > Current State: Squeak primitives in 3.9 are already parsed using the
> > pragma parser, they fully comply the new syntax. As a post operation
> > the parser checks for these primitive pragmas and modifies the
> > compiled method to call the primitive instead of the fallback code.
> > FFI primitives have a slightly different syntax than the pragmas
> > therefor are handled differently.
> >
> > Solution: Unify parsing of pragmas and FFI primitives. Make the
> > primitive parsing extensible using pragmas.
> >
> > Proceeding: As a first step I would remove all the hardcoded code to
> > parse Squeak and FFI primitives. Then I would tag the already
> > implemented methods #primitive: and #primitive:module: using the newly
> > introduced pragma #primitive, so that the parser is able to
> > automatically detect these methods and postprocess the compiled method
> > after the parsing.
> >
> > Proceeding FFI: The FFI package would add two extension methods to the
> > parser, in the example below these would be #cdecel:module: and
> > #apicall:module:. The implementation would look similar as the current
> > implementation in #externalFunctionDeclaration, the parsing however
> > (except for the C declaration) would have been done by the pragma
> > parser already. The syntax of FFI primitives would need to be changed
> > from
> >
> >     XSetBackground: xDisplay with: xGC with: bg
> >         <cdecl: void 'XSetBackground' (X11Display* X11GC long) module:
> > 'X11'>
> >         ^self externalCallFailed
> >
> > to something like
> >
> >     XSetBackground: xDisplay with: xGC with: bg
> >         <cdecl: 'void XSetBackground(X11Display* X11GC long)' module:
> > 'X11'>
> >         ^self externalCallFailed
> >
> > As a free goodie, we could now look for all FFI calls by simply
> > looking at the senders of #cdecel:module: and #apicall:module:.
> >
> > I can do the proposed changes. We can also discuss about the
> > implementation, though I won't go into any discussion if pragmas are
> > good or evil ;-)
> >
> > Cheers,
> > Lukas
> >
>



Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

stéphane ducasse-2
In reply to this post by Andreas.Raab
It seems to me that the parser is patched to deal with ffi while it  
could be made modular and in addition
the pragmas would be consistent, but I will wait for lukas answer's.

For the non breaking point we can have both approaches coexisting for  
a while.


On 15 août 06, at 02:04, Andreas Raab wrote:

> Hi Lukas -
>
> What problem exactly are you trying to solve? The way I understand  
> it the problem we have is a dependency problem - how can the FFI  
> cleanly interact with the parser. To do this, I would simply add a  
> class variable that points to some FFI support class handling the  
> parsing requests. If the FFI is loaded it registers the appropriate  
> entry point and it unregisters it when unloading. As far as I can  
> see, no further changes are needed, in particular none that break  
> compatibility.
>
> Cheers,
>   - Andreas
>
> Lukas Renggli wrote:
>> I propose the following changes:
>> Problem: FFI is hardcoded into the Squeak parser and uses a special
>> parsing method. While parsing pragmas the implementation has to check
>> for special conditions (Parser>>pragmaStatement) to trigger special
>> handling of FFI functions (Parser>>externalFunctionDeclaration). This
>> adds unnecessary code requirements to the base image and violates the
>> extensibility of the system.
>> Current State: Squeak primitives in 3.9 are already parsed using the
>> pragma parser, they fully comply the new syntax. As a post operation
>> the parser checks for these primitive pragmas and modifies the
>> compiled method to call the primitive instead of the fallback code.
>> FFI primitives have a slightly different syntax than the pragmas
>> therefor are handled differently.
>> Solution: Unify parsing of pragmas and FFI primitives. Make the
>> primitive parsing extensible using pragmas.
>> Proceeding: As a first step I would remove all the hardcoded code to
>> parse Squeak and FFI primitives. Then I would tag the already
>> implemented methods #primitive: and #primitive:module: using the  
>> newly
>> introduced pragma #primitive, so that the parser is able to
>> automatically detect these methods and postprocess the compiled  
>> method
>> after the parsing.
>> Proceeding FFI: The FFI package would add two extension methods to  
>> the
>> parser, in the example below these would be #cdecel:module: and
>> #apicall:module:. The implementation would look similar as the  
>> current
>> implementation in #externalFunctionDeclaration, the parsing however
>> (except for the C declaration) would have been done by the pragma
>> parser already. The syntax of FFI primitives would need to be changed
>> from
>>     XSetBackground: xDisplay with: xGC with: bg
>>         <cdecl: void 'XSetBackground' (X11Display* X11GC long)  
>> module: 'X11'>
>>         ^self externalCallFailed
>> to something like
>>     XSetBackground: xDisplay with: xGC with: bg
>>         <cdecl: 'void XSetBackground(X11Display* X11GC long)'  
>> module: 'X11'>
>>         ^self externalCallFailed
>> As a free goodie, we could now look for all FFI calls by simply
>> looking at the senders of #cdecel:module: and #apicall:module:.
>> I can do the proposed changes. We can also discuss about the
>> implementation, though I won't go into any discussion if pragmas are
>> good or evil ;-)
>> Cheers,
>> Lukas
>
>


Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal for Extensible Primitives (was: FFI)

Lukas Renggli
In reply to this post by Andreas.Raab
> What problem exactly are you trying to solve? The way I understand it
> the problem we have is a dependency problem - how can the FFI cleanly
> interact with the parser. To do this, I would simply add a class
> variable that points to some FFI support class handling the parsing
> requests. If the FFI is loaded it registers the appropriate entry point
> and it unregisters it when unloading. As far as I can see, no further
> changes are needed, in particular none that break compatibility.

No changes are required per se, but the suggested modifications would
make the system simpler, smaller and more clean in my opinion.
Primitives would have a consistent syntax and would work searchable
such as senders and implementors of a method. Moreover no code would
be left over in the compiler package, namely the function
Parser>>#externalFunctionDeclaration could be part of the FFI package.

Of course I am wasting my time with minor details ;-)

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Andreas.Raab
Lukas Renggli wrote:
> No changes are required per se, but the suggested modifications would
> make the system simpler, smaller and more clean in my opinion.

In this case my proposal would be to solve the problem we have, not the
one we don't have ;-) I don't mind some discussion about ways in which
to change the FFI but they should be weighed relative to the fact that
the FFI is an already deployed subsystem and changing its syntax means
that every single line that was ever written in it will break instantly
(or worse, it won't even load).

To come back to the problem we have -the dependency problem- I would
again suggest the solution that I mentioned before: A class variable
that, if installed, handles the requests such that the FFI can hook
itself up to the parser by providing the appropriate entry point.

Cheers,
   - Andreas

> Primitives would have a consistent syntax and would work searchable
> such as senders and implementors of a method. Moreover no code would
> be left over in the compiler package, namely the function
> Parser>>#externalFunctionDeclaration could be part of the FFI package.
>
> Of course I am wasting my time with minor details ;-)
>
> Cheers,
> Lukas
>


Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Damien Cassou-3
Andreas Raab wrote:
> In this case my proposal would be to solve the problem we have, not the
> one we don't have ;-) I don't mind some discussion about ways in which
> to change the FFI but they should be weighed relative to the fact that
> the FFI is an already deployed subsystem and changing its syntax means
> that every single line that was ever written in it will break instantly
> (or worse, it won't even load).

Don't you think that the sooner refactoring is done the easier it is ?
If refactoring is not done, in the future we will have this problem and
it will be bigger than it is now and maybe nobody will find time to
refactor. Today, Lukas wants to do it. If the compatibility is kept and
the current method is set to 'deprecated' it will be cool in my opinion.

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Andreas.Raab
Damien Cassou wrote:
> Andreas Raab wrote:
>> In this case my proposal would be to solve the problem we have, not
>> the one we don't have ;-) I don't mind some discussion about ways in
>> which to change the FFI but they should be weighed relative to the
>> fact that the FFI is an already deployed subsystem and changing its
>> syntax means that every single line that was ever written in it will
>> break instantly (or worse, it won't even load).
>
> Don't you think that the sooner refactoring is done the easier it is?

I'm cool with refactoring. The more the merrier. And do you know what
the term refactoring means? http://en.wikipedia.org/wiki/Refactoring :

        "Refactoring is the process of rewriting a computer program or other
material to improve its structure or readability, while explicitly
preserving its meaning or behavior"

Let's repeat the last part: "while explicitly preserving its meaning or
behavior". Not to break things. I'm perfectly cool with that.

Cheers,
   - Andreas


Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal for Extensible Primitives (was: FFI)

Lukas Renggli
> Let's repeat the last part: "while explicitly preserving its meaning or
> behavior". Not to break things. I'm perfectly cool with that.

Unfortunately my suggestion is no refactoring from your point of view,
it breaks backward compatibility.

I am not in favor of keeping backward compatibility, in most cases it
makes things worse and there are already plenty of bad examples in
Squeak.

The following presentation of Gilad Bracha might be interesting to
read, especially the end of the presentation where it says: "Rotting
Bits for a better World -- A model which expects incompatibility as a
matter of course is better than denying change."

        http://www.bracha.org/oopsla05-dls-talk.pdf

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Andreas.Raab
Lukas Renggli wrote:
>> Let's repeat the last part: "while explicitly preserving its meaning or
>> behavior". Not to break things. I'm perfectly cool with that.
>
> Unfortunately my suggestion is no refactoring from your point of view,
> it breaks backward compatibility.

It's not "from my point of view", but rather "by definition" of what
refactoring means. I have really come to dislike how the term
"refactoring" is abused on this list to mean "explicitly breaking code"
instead of what it means, namely explicitly NOT breaking code.

So, let's be clear: You are not talking about a refactoring. If you
were, I'd be cool. You are talking about a fundamental and incompatible
change to the FFI. And I'm not cool with that.

> I am not in favor of keeping backward compatibility, in most cases it
> makes things worse and there are already plenty of bad examples in
> Squeak.

Sure. Depending on the circumstances, e.g., how big your investment in
Squeak has been and how reliant you are on a specific subsystem, that
may be a fine option for you. Not all users of Squeak are that way. And
while I'm not against change in general, I will insist that changes that
introduce fundamental incompatibilities must be carefully weighed
against the benefits they bring.

Otherwise, hey, I'm willing to "refactor" Squeak to use proper static
typing, which will make the code "more extensible", "cleaner" or
whatever attributes of choice you've been recently using. And all you
need to do is to rewrite every single method declaration which seems a
fair deal since you're requesting the same from the FFI users. See what
I mean? ;-)

> The following presentation of Gilad Bracha might be interesting to
> read, especially the end of the presentation where it says: "Rotting
> Bits for a better World -- A model which expects incompatibility as a
> matter of course is better than denying change."
>
>     http://www.bracha.org/oopsla05-dls-talk.pdf

As usual, a thought-provoking presentation from Gilad. He is certainly
right that being prepared for change instead of denying it is the better
strategy - whether that means to entirely drop having any negotiated
interfaces however, stands very much to reason. Personally, I find that
a necessary requirement to be able to deal with change.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Re: Proposal for Extensible Primitives (was: FFI)

Lukas Renggli
> Otherwise, hey, I'm willing to "refactor" Squeak to use proper static
> typing, which will make the code "more extensible", "cleaner" or
> whatever attributes of choice you've been recently using. And all you
> need to do is to rewrite every single method declaration which seems a
> fair deal since you're requesting the same from the FFI users. See what
> I mean? ;-)

Sure, that's perfectly fine with me! Just do it! Though I will
continue to work with the Squeak version before you applied your
changes. Maybe later on I will start new projects with your system,
maybe I will port existing projects to your system. However I first
want to see how it performs :-)

Cheers,
Lukas

--
Lukas Renggli
http://www.lukas-renggli.ch

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

stéphane ducasse-2
In reply to this post by Andreas.Raab
Guys!!!
would not be possible to have a plan for a smooth transition even  
with the two approaches happily living side by side?

Stef

On 16 août 06, at 09:41, Andreas Raab wrote:

> Lukas Renggli wrote:
>>> Let's repeat the last part: "while explicitly preserving its  
>>> meaning or
>>> behavior". Not to break things. I'm perfectly cool with that.
>> Unfortunately my suggestion is no refactoring from your point of  
>> view,
>> it breaks backward compatibility.
>
> It's not "from my point of view", but rather "by definition" of  
> what refactoring means. I have really come to dislike how the term  
> "refactoring" is abused on this list to mean "explicitly breaking  
> code" instead of what it means, namely explicitly NOT breaking code.
>
> So, let's be clear: You are not talking about a refactoring. If you  
> were, I'd be cool. You are talking about a fundamental and  
> incompatible change to the FFI. And I'm not cool with that.
>
>> I am not in favor of keeping backward compatibility, in most cases it
>> makes things worse and there are already plenty of bad examples in
>> Squeak.
>
> Sure. Depending on the circumstances, e.g., how big your investment  
> in Squeak has been and how reliant you are on a specific subsystem,  
> that may be a fine option for you. Not all users of Squeak are that  
> way. And while I'm not against change in general, I will insist  
> that changes that introduce fundamental incompatibilities must be  
> carefully weighed against the benefits they bring.
>
> Otherwise, hey, I'm willing to "refactor" Squeak to use proper  
> static typing, which will make the code "more extensible",  
> "cleaner" or whatever attributes of choice you've been recently  
> using. And all you need to do is to rewrite every single method  
> declaration which seems a fair deal since you're requesting the  
> same from the FFI users. See what I mean? ;-)
>
>> The following presentation of Gilad Bracha might be interesting to
>> read, especially the end of the presentation where it says: "Rotting
>> Bits for a better World -- A model which expects incompatibility as a
>> matter of course is better than denying change."
>>     http://www.bracha.org/oopsla05-dls-talk.pdf
>
> As usual, a thought-provoking presentation from Gilad. He is  
> certainly right that being prepared for change instead of denying  
> it is the better strategy - whether that means to entirely drop  
> having any negotiated interfaces however, stands very much to  
> reason. Personally, I find that a necessary requirement to be able  
> to deal with change.
>
> Cheers,
>   - Andreas
>


Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Klaus D. Witzel
In reply to this post by Andreas.Raab
On Wed, 16 Aug 2006 09:41:08 +0200, Andreas Raab wrote:
> Lukas Renggli wrote:
>> The following presentation of Gilad Bracha might be interesting to
>> read, especially the end of the presentation where it says: "Rotting
>> Bits for a better World -- A model which expects incompatibility as a
>> matter of course is better than denying change."
>>      http://www.bracha.org/oopsla05-dls-talk.pdf

Lukas, can't you see the contradiction here: a change, if it is worth the  
name, always breaks compatibility. Else it would be an enhancement  
(exactly the same interface but "performs" "better") or a new feature (new  
in the sense of "never used that interface before").

If it's not a new feature and not an enhancement, the implication is that  
it *must* break compatibility ;-)

So I have to judge Andreas' suggestion on how to interface FFI as an  
enhancement and your suggestion as an incompatibility (of course a  
resolution would be to have old+new interfaces in parallel for a while).

> As usual, a thought-provoking presentation from Gilad. He is certainly  
> right that being prepared for change instead of denying it is the better  
> strategy - whether that means to entirely drop having any negotiated  
> interfaces however, stands very much to reason. Personally, I find that  
> a necessary requirement to be able to deal with change.

[OT] I wouldn't say that to be prepared for change has something to do  
with thought-provoking. Just with a reminder.

/Klaus

> Cheers,
>    - Andreas
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Andreas.Raab
In reply to this post by stéphane ducasse-2
stéphane ducasse wrote:
> would not be possible to have a plan for a smooth transition even with
> the two approaches happily living side by side?

A transition implies that the proposed change is desirable or necessary.
This is not the case. The idea to change the syntax of the FFI is a
classic "fresh from the ivory tower" idea, neglecting the realities of
an already deployed, perfectly working and functioning system.

Sorry but changing FFI syntax ain't gonna happen on my watch.

Cheers,
  - Andreas

>
> Stef
>
> On 16 août 06, at 09:41, Andreas Raab wrote:
>
>> Lukas Renggli wrote:
>>>> Let's repeat the last part: "while explicitly preserving its meaning or
>>>> behavior". Not to break things. I'm perfectly cool with that.
>>> Unfortunately my suggestion is no refactoring from your point of view,
>>> it breaks backward compatibility.
>>
>> It's not "from my point of view", but rather "by definition" of what
>> refactoring means. I have really come to dislike how the term
>> "refactoring" is abused on this list to mean "explicitly breaking
>> code" instead of what it means, namely explicitly NOT breaking code.
>>
>> So, let's be clear: You are not talking about a refactoring. If you
>> were, I'd be cool. You are talking about a fundamental and
>> incompatible change to the FFI. And I'm not cool with that.
>>
>>> I am not in favor of keeping backward compatibility, in most cases it
>>> makes things worse and there are already plenty of bad examples in
>>> Squeak.
>>
>> Sure. Depending on the circumstances, e.g., how big your investment in
>> Squeak has been and how reliant you are on a specific subsystem, that
>> may be a fine option for you. Not all users of Squeak are that way.
>> And while I'm not against change in general, I will insist that
>> changes that introduce fundamental incompatibilities must be carefully
>> weighed against the benefits they bring.
>>
>> Otherwise, hey, I'm willing to "refactor" Squeak to use proper static
>> typing, which will make the code "more extensible", "cleaner" or
>> whatever attributes of choice you've been recently using. And all you
>> need to do is to rewrite every single method declaration which seems a
>> fair deal since you're requesting the same from the FFI users. See
>> what I mean? ;-)
>>
>>> The following presentation of Gilad Bracha might be interesting to
>>> read, especially the end of the presentation where it says: "Rotting
>>> Bits for a better World -- A model which expects incompatibility as a
>>> matter of course is better than denying change."
>>>     http://www.bracha.org/oopsla05-dls-talk.pdf
>>
>> As usual, a thought-provoking presentation from Gilad. He is certainly
>> right that being prepared for change instead of denying it is the
>> better strategy - whether that means to entirely drop having any
>> negotiated interfaces however, stands very much to reason. Personally,
>> I find that a necessary requirement to be able to deal with change.
>>
>> Cheers,
>>   - Andreas
>>
>
>
>


Reply | Threaded
Open this post in threaded view
|

RE: Proposal for Extensible Primitives (was: FFI)

Ron Teitelbaum
+1

The arguments presented are not sufficient in my opinion to warrant the
change.  

In general the amount of difference in the interface that is suggested is
trivial when compared to the amount of learning necessary to use FFI.
Consistency does not appear to me to be a valid argument.

Considering the alternatives presented by Andreas that allows this minor
difference in syntax while satisfying requirements for isolation, I would
say it's better to leave current systems working and the current syntax as
is even if it is slightly different than pragmas.  Isolation of code and
removing of unnecessary code when FFI is unloaded does not appear to be a
valid argument considering alternatives discussed.

I understand the original stated goal is to unify the parser and clean up
the parsing code, but in general that doesn't seem to be enough of an
argument to change the interface of working systems.  Can the two parsers be
combined without changing the FFI syntax?  

Ron Teitelbaum

> -----Original Message-----
> From: [hidden email] [mailto:squeak-dev-
> [hidden email]] On Behalf Of Andreas Raab
> Sent: Wednesday, August 16, 2006 11:36 AM
> To: The general-purpose Squeak developers list
> Subject: Re: Proposal for Extensible Primitives (was: FFI)
>
> stéphane ducasse wrote:
> > would not be possible to have a plan for a smooth transition even with
> > the two approaches happily living side by side?
>
> A transition implies that the proposed change is desirable or necessary.
> This is not the case. The idea to change the syntax of the FFI is a
> classic "fresh from the ivory tower" idea, neglecting the realities of
> an already deployed, perfectly working and functioning system.
>
> Sorry but changing FFI syntax ain't gonna happen on my watch.
>
> Cheers,
>   - Andreas
>
> >
> > Stef
> >
> > On 16 août 06, at 09:41, Andreas Raab wrote:
> >
> >> Lukas Renggli wrote:
> >>>> Let's repeat the last part: "while explicitly preserving its meaning
> or
> >>>> behavior". Not to break things. I'm perfectly cool with that.
> >>> Unfortunately my suggestion is no refactoring from your point of view,
> >>> it breaks backward compatibility.
> >>
> >> It's not "from my point of view", but rather "by definition" of what
> >> refactoring means. I have really come to dislike how the term
> >> "refactoring" is abused on this list to mean "explicitly breaking
> >> code" instead of what it means, namely explicitly NOT breaking code.
> >>
> >> So, let's be clear: You are not talking about a refactoring. If you
> >> were, I'd be cool. You are talking about a fundamental and
> >> incompatible change to the FFI. And I'm not cool with that.
> >>
> >>> I am not in favor of keeping backward compatibility, in most cases it
> >>> makes things worse and there are already plenty of bad examples in
> >>> Squeak.
> >>
> >> Sure. Depending on the circumstances, e.g., how big your investment in
> >> Squeak has been and how reliant you are on a specific subsystem, that
> >> may be a fine option for you. Not all users of Squeak are that way.
> >> And while I'm not against change in general, I will insist that
> >> changes that introduce fundamental incompatibilities must be carefully
> >> weighed against the benefits they bring.
> >>
> >> Otherwise, hey, I'm willing to "refactor" Squeak to use proper static
> >> typing, which will make the code "more extensible", "cleaner" or
> >> whatever attributes of choice you've been recently using. And all you
> >> need to do is to rewrite every single method declaration which seems a
> >> fair deal since you're requesting the same from the FFI users. See
> >> what I mean? ;-)
> >>
> >>> The following presentation of Gilad Bracha might be interesting to
> >>> read, especially the end of the presentation where it says: "Rotting
> >>> Bits for a better World -- A model which expects incompatibility as a
> >>> matter of course is better than denying change."
> >>>     http://www.bracha.org/oopsla05-dls-talk.pdf
> >>
> >> As usual, a thought-provoking presentation from Gilad. He is certainly
> >> right that being prepared for change instead of denying it is the
> >> better strategy - whether that means to entirely drop having any
> >> negotiated interfaces however, stands very much to reason. Personally,
> >> I find that a necessary requirement to be able to deal with change.
> >>
> >> Cheers,
> >>   - Andreas
> >>
> >
> >
> >
>



Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

stéphane ducasse-2
In reply to this post by Andreas.Raab

On 16 août 06, at 17:36, Andreas Raab wrote:

> A transition implies that the proposed change is desirable or  
> necessary. This is not the case. The idea to change the syntax of  
> the FFI is a classic "fresh from the ivory tower" idea, neglecting  
> the realities of an already deployed, perfectly working and  
> functioning system.

Andreas just says that lukas is an idiot. This is more direct. Do not  
tell me that having a migration period would not work. And do not  
tell us that the hacks introduced in the compiler are nice. What  
lukas was proposing was a really nice way to integrate FFI with  
pragmas without having these compiler hacks. You know like me that  
lukas is quite good and often right so at least respect him.

Stef

PS: we all know that we are random refactorers (thanks for this nice  
formula this is the best insult I ever got
and the more I think about it the better I like it).



Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

stéphane ducasse-2
In reply to this post by Ron Teitelbaum
Ron

do not be naive. I asked explicitly to lukas to show his approach to  
get a MUCH cleaner system and we were sure that andreas
would react that way because we are idiots. So let us be idiots!

Now I think that taking advantage of pragmas (because you know that  
lukas did all the implementation of pragmas even arguing
with andreas that he was wrong on certain comments of this  
implementation - this was offline but his happened and lukas was
right and the implementation of lukas is much better than the one of  
andreas in tweak) would be something to have and discussing how a  
***smooth transition*** plan could have been prepared. We are not  
saying that everything should change, but preparing to change
is sometimes really important. Else we would all be programming in  
assembly because it worked.

But what lukas said is bullshit of course!

Stef


On 16 août 06, at 18:18, Ron Teitelbaum wrote:

> +1
>
> The arguments presented are not sufficient in my opinion to warrant  
> the
> change.
>
> In general the amount of difference in the interface that is  
> suggested is
> trivial when compared to the amount of learning necessary to use FFI.
> Consistency does not appear to me to be a valid argument.
>
> Considering the alternatives presented by Andreas that allows this  
> minor
> difference in syntax while satisfying requirements for isolation, I  
> would
> say it's better to leave current systems working and the current  
> syntax as
> is even if it is slightly different than pragmas.  Isolation of  
> code and
> removing of unnecessary code when FFI is unloaded does not appear  
> to be a
> valid argument considering alternatives discussed.
>
> I understand the original stated goal is to unify the parser and  
> clean up
> the parsing code, but in general that doesn't seem to be enough of an
> argument to change the interface of working systems.  Can the two  
> parsers be
> combined without changing the FFI syntax?
>
> Ron Teitelbaum
>
>> -----Original Message-----
>> From: [hidden email] [mailto:squeak-
>> dev-
>> [hidden email]] On Behalf Of Andreas Raab
>> Sent: Wednesday, August 16, 2006 11:36 AM
>> To: The general-purpose Squeak developers list
>> Subject: Re: Proposal for Extensible Primitives (was: FFI)
>>
>> stéphane ducasse wrote:
>>> would not be possible to have a plan for a smooth transition even  
>>> with
>>> the two approaches happily living side by side?
>>
>> A transition implies that the proposed change is desirable or  
>> necessary.
>> This is not the case. The idea to change the syntax of the FFI is a
>> classic "fresh from the ivory tower" idea, neglecting the  
>> realities of
>> an already deployed, perfectly working and functioning system.
>>
>> Sorry but changing FFI syntax ain't gonna happen on my watch.
>>
>> Cheers,
>>   - Andreas
>>
>>>
>>> Stef
>>>
>>> On 16 août 06, at 09:41, Andreas Raab wrote:
>>>
>>>> Lukas Renggli wrote:
>>>>>> Let's repeat the last part: "while explicitly preserving its  
>>>>>> meaning
>> or
>>>>>> behavior". Not to break things. I'm perfectly cool with that.
>>>>> Unfortunately my suggestion is no refactoring from your point  
>>>>> of view,
>>>>> it breaks backward compatibility.
>>>>
>>>> It's not "from my point of view", but rather "by definition" of  
>>>> what
>>>> refactoring means. I have really come to dislike how the term
>>>> "refactoring" is abused on this list to mean "explicitly breaking
>>>> code" instead of what it means, namely explicitly NOT breaking  
>>>> code.
>>>>
>>>> So, let's be clear: You are not talking about a refactoring. If you
>>>> were, I'd be cool. You are talking about a fundamental and
>>>> incompatible change to the FFI. And I'm not cool with that.
>>>>
>>>>> I am not in favor of keeping backward compatibility, in most  
>>>>> cases it
>>>>> makes things worse and there are already plenty of bad examples in
>>>>> Squeak.
>>>>
>>>> Sure. Depending on the circumstances, e.g., how big your  
>>>> investment in
>>>> Squeak has been and how reliant you are on a specific subsystem,  
>>>> that
>>>> may be a fine option for you. Not all users of Squeak are that way.
>>>> And while I'm not against change in general, I will insist that
>>>> changes that introduce fundamental incompatibilities must be  
>>>> carefully
>>>> weighed against the benefits they bring.
>>>>
>>>> Otherwise, hey, I'm willing to "refactor" Squeak to use proper  
>>>> static
>>>> typing, which will make the code "more extensible", "cleaner" or
>>>> whatever attributes of choice you've been recently using. And  
>>>> all you
>>>> need to do is to rewrite every single method declaration which  
>>>> seems a
>>>> fair deal since you're requesting the same from the FFI users. See
>>>> what I mean? ;-)
>>>>
>>>>> The following presentation of Gilad Bracha might be interesting to
>>>>> read, especially the end of the presentation where it says:  
>>>>> "Rotting
>>>>> Bits for a better World -- A model which expects  
>>>>> incompatibility as a
>>>>> matter of course is better than denying change."
>>>>>     http://www.bracha.org/oopsla05-dls-talk.pdf
>>>>
>>>> As usual, a thought-provoking presentation from Gilad. He is  
>>>> certainly
>>>> right that being prepared for change instead of denying it is the
>>>> better strategy - whether that means to entirely drop having any
>>>> negotiated interfaces however, stands very much to reason.  
>>>> Personally,
>>>> I find that a necessary requirement to be able to deal with change.
>>>>
>>>> Cheers,
>>>>   - Andreas
>>>>
>>>
>>>
>>>
>>
>
>
>
>


Reply | Threaded
Open this post in threaded view
|

RE: Proposal for Extensible Primitives (was: FFI)

Ron Teitelbaum
Stef,

To be sure it is possible that my reactions to the arguments are the result
of naivety.  I am not aware of much of the past history and I have not
reviewed the relative parser implementations.  I will back off and let
Andreas and Lukas discuss the details.  

>From my perspective, as limited as it is, there have not been enough
arguments about the benefits of the change itself.  I'm sure the pragma
implantation is quite good based on your judgement but what does that have
to do with FFI.  Using the pragmas implementation for FFI doesn't add or
remove anything from pragmas.  What I can say is that FFI on windows works
well and that the differences suggested for the api are minor but the
compatibility issues are major.  

For me there would have to be a really good reason to want to change the api
for FFI and the arguments I've heard are just not good enough.  IF we could
consolidate the implementation without changing the api I would have no
opinion about this issue accept to point out that FFI as far as I know
belongs currently to Andreas.  

Lukas should aggressively pursue his line of argument so that we can fully
understand the benefits of what he is proposing.  Lukas and Andreas are both
very talented and we would be very foolish not to listen to either of them.


Let's leave politics behind; argument and discussion that leads to a
solution is good for the community and for Squeak.  We don't all have to
agree, we don't need consensus, we need to make sure everyone is heard, make
a decision and then move on.  Like I said the decisions should come from
Andreas and Lukas.

Ron

> From: stéphane ducasse
> Sent: Wednesday, August 16, 2006 4:53 PM
> Ron
>
> do not be naive. I asked explicitly to lukas to show his approach to
> get a MUCH cleaner system and we were sure that andreas
> would react that way because we are idiots. So let us be idiots!
>
> Now I think that taking advantage of pragmas (because you know that
> lukas did all the implementation of pragmas even arguing
> with andreas that he was wrong on certain comments of this
> implementation - this was offline but his happened and lukas was
> right and the implementation of lukas is much better than the one of
> andreas in tweak) would be something to have and discussing how a
> ***smooth transition*** plan could have been prepared. We are not
> saying that everything should change, but preparing to change
> is sometimes really important. Else we would all be programming in
> assembly because it worked.
>
> But what lukas said is bullshit of course!
>
> Stef
>
>
> On 16 août 06, at 18:18, Ron Teitelbaum wrote:
>
> > +1
> >
> > The arguments presented are not sufficient in my opinion to warrant
> > the
> > change.
> >
> > In general the amount of difference in the interface that is
> > suggested is
> > trivial when compared to the amount of learning necessary to use FFI.
> > Consistency does not appear to me to be a valid argument.
> >
> > Considering the alternatives presented by Andreas that allows this
> > minor
> > difference in syntax while satisfying requirements for isolation, I
> > would
> > say it's better to leave current systems working and the current
> > syntax as
> > is even if it is slightly different than pragmas.  Isolation of
> > code and
> > removing of unnecessary code when FFI is unloaded does not appear
> > to be a
> > valid argument considering alternatives discussed.
> >
> > I understand the original stated goal is to unify the parser and
> > clean up
> > the parsing code, but in general that doesn't seem to be enough of an
> > argument to change the interface of working systems.  Can the two
> > parsers be
> > combined without changing the FFI syntax?
> >
> > Ron Teitelbaum
> >
> >> -----Original Message-----
> >> From: [hidden email] [mailto:squeak-
> >> dev-
> >> [hidden email]] On Behalf Of Andreas Raab
> >> Sent: Wednesday, August 16, 2006 11:36 AM
> >> To: The general-purpose Squeak developers list
> >> Subject: Re: Proposal for Extensible Primitives (was: FFI)
> >>
> >> stéphane ducasse wrote:
> >>> would not be possible to have a plan for a smooth transition even
> >>> with
> >>> the two approaches happily living side by side?
> >>
> >> A transition implies that the proposed change is desirable or
> >> necessary.
> >> This is not the case. The idea to change the syntax of the FFI is a
> >> classic "fresh from the ivory tower" idea, neglecting the
> >> realities of
> >> an already deployed, perfectly working and functioning system.
> >>
> >> Sorry but changing FFI syntax ain't gonna happen on my watch.
> >>
> >> Cheers,
> >>   - Andreas
> >>
> >>>
> >>> Stef
> >>>
> >>> On 16 août 06, at 09:41, Andreas Raab wrote:
> >>>
> >>>> Lukas Renggli wrote:
> >>>>>> Let's repeat the last part: "while explicitly preserving its
> >>>>>> meaning
> >> or
> >>>>>> behavior". Not to break things. I'm perfectly cool with that.
> >>>>> Unfortunately my suggestion is no refactoring from your point
> >>>>> of view,
> >>>>> it breaks backward compatibility.
> >>>>
> >>>> It's not "from my point of view", but rather "by definition" of
> >>>> what
> >>>> refactoring means. I have really come to dislike how the term
> >>>> "refactoring" is abused on this list to mean "explicitly breaking
> >>>> code" instead of what it means, namely explicitly NOT breaking
> >>>> code.
> >>>>
> >>>> So, let's be clear: You are not talking about a refactoring. If you
> >>>> were, I'd be cool. You are talking about a fundamental and
> >>>> incompatible change to the FFI. And I'm not cool with that.
> >>>>
> >>>>> I am not in favor of keeping backward compatibility, in most
> >>>>> cases it
> >>>>> makes things worse and there are already plenty of bad examples in
> >>>>> Squeak.
> >>>>
> >>>> Sure. Depending on the circumstances, e.g., how big your
> >>>> investment in
> >>>> Squeak has been and how reliant you are on a specific subsystem,
> >>>> that
> >>>> may be a fine option for you. Not all users of Squeak are that way.
> >>>> And while I'm not against change in general, I will insist that
> >>>> changes that introduce fundamental incompatibilities must be
> >>>> carefully
> >>>> weighed against the benefits they bring.
> >>>>
> >>>> Otherwise, hey, I'm willing to "refactor" Squeak to use proper
> >>>> static
> >>>> typing, which will make the code "more extensible", "cleaner" or
> >>>> whatever attributes of choice you've been recently using. And
> >>>> all you
> >>>> need to do is to rewrite every single method declaration which
> >>>> seems a
> >>>> fair deal since you're requesting the same from the FFI users. See
> >>>> what I mean? ;-)
> >>>>
> >>>>> The following presentation of Gilad Bracha might be interesting to
> >>>>> read, especially the end of the presentation where it says:
> >>>>> "Rotting
> >>>>> Bits for a better World -- A model which expects
> >>>>> incompatibility as a
> >>>>> matter of course is better than denying change."
> >>>>>     http://www.bracha.org/oopsla05-dls-talk.pdf
> >>>>
> >>>> As usual, a thought-provoking presentation from Gilad. He is
> >>>> certainly
> >>>> right that being prepared for change instead of denying it is the
> >>>> better strategy - whether that means to entirely drop having any
> >>>> negotiated interfaces however, stands very much to reason.
> >>>> Personally,
> >>>> I find that a necessary requirement to be able to deal with change.
> >>>>
> >>>> Cheers,
> >>>>   - Andreas
> >>>>
> >>>
> >>>
> >>>
> >>
> >
> >
> >
> >
>
>



Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Andreas.Raab
In reply to this post by stéphane ducasse-2
stéphane ducasse wrote:
> Andreas just says that lukas is an idiot. This is more direct.

No, I said that the value of that change doesn't outweigh the value of
the existing investments. And, I am now saying that I would appreciate
it a *lot* if you weren't constantly putting words into my mouth. I'm
quite capable of saying what I mean, thanks.

But to come back to the topic, if this were day 1 of the FFI I'd
probably even go for the change in syntax. But as it stands I have to
consider the investments of the people who are using the FFI. This is
why I am the maintainer.

And as an advocate of my users I will tell you: Unless you provide some
real tangible benefit for the users of the FFI, that change is not going
to happen.

> Do not tell me that having a migration period would not work.

I said something entirely different, namely that a migration only makes
sense if a change were either desirable or necessary. The change that
has been proposed is neither desirable (since its adds no value for the
FFI users) nor necessary. Therefore no migration period is necessary
since there is no good reason for a change to begin with.

> And do not tell us that the hacks introduced in the compiler are nice.

I haven't said that anywhere. However, regardless of their nicety, hacks
are often useful if you deal with the reality outside of your personal
view of what the world should be like. And in this case I wouldn't even
consider it a hack - why do you call it that? The FFI has been present
in the parser *far* longer than the pragma implementation. Given that
this is the case you can hardly call it a "hack" - it is simply an
extension to the parser added at (what at that time seemed to be) the
right place.

I will admit that some of the code (in particular what Marcus' stumbled
across) is a little questionable since it tries to avoid dealing with
the dependency issues. And I have by now *twice* offered to discuss ways
to deal with the problem, both times ignored.

It is certainly striking how you keep coming back to a no-value
proposition and entirely avoid discussing what is an actual issue that
should be addressed. That's what I mean by "ivory tower" behavior.

> What lukas was
> proposing was a really nice way to integrate FFI with pragmas without
> having these compiler hacks.

Sure. And it was a proposal that completely ignored any realities of the
FFI. The FFI is there, it is used and people have invested in it. If you
want to break all code anyone has ever written using the FFI I, both
personally as well as a maintainer watching out for the interests of my
users, want a reason for it. A Real Good Reason.

Cheers,
   - Andreas

Reply | Threaded
Open this post in threaded view
|

Re: Proposal for Extensible Primitives (was: FFI)

Andreas.Raab
In reply to this post by Ron Teitelbaum
Ron Teitelbaum wrote:
> To be sure it is possible that my reactions to the arguments are the result
> of naivety.  I am not aware of much of the past history and I have not
> reviewed the relative parser implementations.  I will back off and let
> Andreas and Lukas discuss the details.  

Please don't. We have too little user perspective in this discussion. As
a maintainer, I will be perfectly happy to change things if there are
FFI users requesting changes (and if they are within my abilities to
change). So rather than listening to Stefane's insults I'd like to get
more feedback from FFI users, in particular with respect to the
following questions:

If you are an FFI user and like the proposed changes:
a) Where do you see the advantage of it for your work? How would you
describe the value added? How would you argue to convince someone else
that their code should be changed to the new model?
b) Since there is room for ambiguity in supporting the current FFI spec
and the proposed changes, do you think both styles should be supported
for an intermediate period?
    b1) If yes, for how long?
    b2) If no, how do you propose to deal with migration?
c) Given the choice, would you rather have an "inplace" change or
perhaps an alternative version of the foreign function interface, aptly
called FFII (pronounce as FF-2)?

Cheers,
   - Andreas

12