<p dir="ltr">On Sep 23, 2016 12:25 PM, "Robert Goldman" <<a href="mailto:rpgoldman@sift.net">rpgoldman@sift.net</a>> wrote:<br>
><br>
> On 9/23/16 Sep 23 -9:52 AM, Faré wrote:<br>
> > 1- The requirement to always use make-operation currently only applies<br>
> > to code within ASDF itself and well-behaved extensions. Before you<br>
> > enforce it more widely, you have to make sure no one in Quicklisp does<br>
> > it. You could have shared initialize check that: a) no instance of that<br>
> > class with given initargs exists yet in *operations* and hopefully b)<br>
> > there initargs are always null (goodbye, make-build!)<br>
><br>
> Your docs clearly say that these MUST be built this way.  If you want to<br>
> say "must" then I will enforce "must."  If you want "may," we can have<br>
> "may" as in "For more efficient functioning, please use MAKE-OPERATION<br>
> to create all operation instances."<br>
><br>
Well, at this moment it's only a performance optimization. The goal of enforcing the invariant would be to eventually support operations with meaningful initargs. So the question is: where are you going and/or what options do you want to leave open? Enabling initargs? Forbidding them? Either way, make-operation can help you enforce the invariant. And either way requires more work. But using make-operation makes the code more future-proof.</p>
<p dir="ltr">> Please articulate why you say "All operation instances MUST be created<br>
> through this function"?  I like the idea of having a clean API, but I<br>
> also note that there is code that effectively interns the results of<br>
> MAKE-OPERATION. What is the design rationale for this?  Do you wish to<br>
> be able to EQ-compare them?  If not, why do you intern these objects in<br>
> the *OPERATIONS* table?  Is it really so expensive to create an<br>
> OPERATION that we need to memoize?  Or is it because we simply create so<br>
> many, and this improves GC behavior?<br>
><br>
Better GC is nice, but yes, having tables indexed by a pair of operation and component would be much better than having hacks like node-for... and it requires everyone using make-operation.</p>
<p dir="ltr">> WRT Quicklisp:  I do NOT accept that I have to check all of Quicklisp<br>
> for ANYTHING. I am willing to be INFORMED by results of such checks, but<br>
> I do NOT have time to make such checks.<br>
><br>
> I don't expect other people to test my SIFT code, and I don't have time<br>
> to check arbitrary CL libraries, much less arbitrary CL libraries on<br>
> arbitrary implementations and operating systems.<br>
><br>
> So, no.  If someone else wants to test other things.<br>
><br>
You surprise me. Historically, you've always been a strong voice for backward compatibility and being extra cautious about not breaking other people's code, especially not so without extra warnings and heads up, even more so if we're reversing something the manual used to advertise.</p>
<p dir="ltr">I wouldn't consult Quicklisp when implementing a big fix or making a backward compatible change. But when proposing a backward incompatible change, I make sure to warn all users that I can find.<br></p>
<p dir="ltr">> > 2- No, there was never a requirement that defsystem should only be used<br>
> > within a .asd. Actually, the test system relies heavily on the opposite.<br>
> > The requirement is that .asd files be loaded in the correct context, by<br>
> > load-asd -- notably, the correct *package* must be bound, the correct<br>
> > readtable, etc.<br>
><br>
> Unfortunately, DEFSYSTEM is the only entry point we can check.  So if<br>
> LOAD-ASD is important, that's the only place I can check it. What else<br>
> would you have me do?  Check *load-truename* for "asd"?<br>
><br>
> Look, if you want to push this, then you can't object to my enforcing<br>
> it.  If you don't want to push this, then we should make sure DEFSYSTEM<br>
> works outside the context.  But I don't want to field bug reports where<br>
> someone says "I tried to define this system and it didn't work," and<br>
><br>
> In the olden days, we relied on programmers to make sure that the<br>
> context for DEFSYSTEM reading was appropriate.  That was a pain for them<br>
> sometimes, but it was clear, and it kept ASDF simple.<br>
><br>
> At some point, ASDF decided to take on the burden of establishing the<br>
> context for DEFSYSTEM reading.  OK, not my choice, but a reasonable<br>
> decision.  But I flatly refuse to maintain *both* the DWIMing in<br>
> LOAD-ASD *and* DEFSYSTEM execution in arbitrary contexts.  And as a<br>
> programmer, I don't want ASDF to let me evaluate a DEFSYSTEM form only<br>
> to beat me up because some invisible context, only apparent through<br>
> reading the code, means that it doesn't work.<br>
><br>
> Pick one, DWIMing, or freestanding execution, but you get only one.<br>
><br>
There too I don't understand your reasoning. Who are you helping, and who are you harming?</p>
<p dir="ltr">There always was a constraint on loading a .asd, and never was one on using defsystem. We can assume that all software that works fits those constraints, but might not fit tighter ones. Why make it harder to use defsystem? What would you check exactly?</p>
<p dir="ltr">To me, setting the syntax context is an essential service to provide to whoever writes a .asd file. The .asd maintainer cannot assume anything about the syntax context used by the user, who may not control the syntax context from the end-user. If you can't even trust the package or readtable, or character encoding, you can't even write code that has any guaranteed meaning. Note that it's called .asd rather than .lisp for a good reason: it's Lisp code, but supposed to run in a specific context. </p>
<p dir="ltr">I don't see who is served, or what feature is enabled, by introducing this backward incompatibility.</p>
<p dir="ltr">> > On Fri, Sep 23, 2016, 09:49 Robert Goldman <<a href="mailto:rpgoldman@sift.net">rpgoldman@sift.net</a><br>
> > <mailto:<a href="mailto:rpgoldman@sift.net">rpgoldman@sift.net</a>>> wrote:<br>
> ><br>
> >     I have been working on enforcing assumptions recently added to the ASDF<br>
> >     docs.  Specifically, that OPERATION instances only be created by<br>
> >     MAKE-OPERATION and SYSTEMs only be parsed inside LOAD-ASD.<br>
> ><br>
> >     I should have a merge request up for review soon, but find that it's<br>
> >     more tricky than I expected, because we don't even play by the rules<br>
> >     ourselves!  Specifically, there are calls to MAKE-INSTANCE on OPERATIONs<br>
> >     in the ASDF codebase itself.<br>
> ><br>
> >     Cheers,<br>
> >     r<br>
> ><br>
></p>