emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Introducing 'safety' compilation parameter


From: Gerd Möllmann
Subject: Re: Introducing 'safety' compilation parameter
Date: Thu, 09 May 2024 11:19:04 +0200
User-agent: Gnus/5.13 (Gnus v5.13)

Andrea Corallo <acorallo@gnu.org> writes:

> I've put in scratch/comp-safety a branch wich introduces 'safety' as
> compilation parameter.
>
> 'safety' can be used similarly to 'native-comp-speed' both as a global
> variable to influence compilation both as a function declaration.
>
> 'safety' justification of existence is ATM being able to control the
> undefined behaviour being created when function type declaration added
> by the user is not correct.
>
> ATM we can have two values:
>
> 1 Emitted code is generated in a safe matter even if function types are
> miss-declared.
> 0 Emitted code can misbehave or crash Emacs if function declarations are
> not correct and the function is native compiled (@pxref{Native
> Compilation}).
>
> 1 is ATM the default.
>
> I didn't want to give safety a prefix (byte- or comp-) as I believe we
> should extend safety in the future with a value to have the byte
> compiler generates runtime type checks to verify the declred types.
> OTOH this is creating a warning for a missing prefix, not sure what's
> the best way to fix this (give it a prefix or silence the compiler if
> possible).
>
> Also I added some doc for the declaration, but didn't kwnow where in the
> manual the documention for the variable should go as now it has effect
> only for the native compiler.  Should I document it under
> "Native-Compilation Variables" for now?

Hi Andrea,

I don't know if something like this has been discussed before... CMUCL
and SBCL treat declarations differently depending on the speed settings.
If speed is below some threshold, declarations work like assertions,
with high speed settings declarations are treated as promises.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]