[pro] Default safety level and specialized arrays

Pascal J. Bourguignon pjb at informatimago.com
Thu Mar 12 12:14:41 UTC 2015


> On 11 Mar 2015, at 21:25, Svante v. Erichsen <Svante.v.Erichsen at web.de> wrote:
> 
> This begs the question: how do I get a speed optimized library then?  Do I need
> to make a local fork just to insert declarations?  Is there a way to tell


This is not up to the library writer to decde on this.  This is up to the library final user.

Declarations are global.  When you are developping/debugging, you will set them to
(optimize (speed 0) (space 0) (debug 3) (safety 3)).

When generating the end-user executable, you will set them to
(optimize (speed 3) (space 3) (debug 0) (safety 3)), 
if you follow Bertrand Meyer's advice.


> e. g. ASDF to use certain declamations?  Is making the declarations in the
> library dependent on documented entries to *features* the way to go?  Where
> would I push the desired settings into *features*?

Even if you set them in ASDF, you will have to have a way to tell it when you are debugging code (always), and when you are generating a end-user application (once in a blue moon, and in a different, explicitely controlled process).

And yes, since asdf doesn't cache the compiled files in separate directories for the various optimization settings (or the various *features* list), since that would be very unwiedly, you have to clear the cache when you switch between generating the end-user application, and normal developping work.  rm -rf ~/.cache/common-lisp/ is found in all application generation makefiles.

Optimize declaimations and declarations in libraries is the curse of the CL application developper.

-- 
__Pascal J. Bourguignon__



-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/pro/attachments/20150312/f2df00de/attachment.html>


More information about the pro mailing list