From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: Introducing 'safety' compilation parameter Date: Thu, 09 May 2024 11:40:55 +0300 Message-ID: <86a5kz74yw.fsf@gnu.org> References: Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="13249"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org, monnier@iro.umontreal.ca, mattias.engdegard@gmail.com, stefankangas@gmail.com To: Andrea Corallo Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu May 09 10:41:50 2024 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1s4zLa-00034l-F0 for ged-emacs-devel@m.gmane-mx.org; Thu, 09 May 2024 10:41:50 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4zKu-0003Ma-MV; Thu, 09 May 2024 04:41:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4zKr-0003MJ-Mg for emacs-devel@gnu.org; Thu, 09 May 2024 04:41:06 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1s4zKq-000294-Mx; Thu, 09 May 2024 04:41:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=EVM+uGHRn1r6QeEq4tUzYtksMUKU779y5lq27LVnwSI=; b=PGepau8IfAtd k0JE4omBHEoDu7xHHHVaDJJ+QXIgdGSPvfmLSow/lICCH/LEnLbmDbXtBC4kZJwChQSGEGMws0fwP exUfYvi56yUCMT0u1Q652lf4CcoMpVYz4hBS8nWXNhciOQzDXjclD0g2hrdpebZvTjaKxR6yzOFj7 zEUXsEnekDjA4Fm7zATEjYrba9Wegz6d9nmQC3vMG3Hs73fnf3oePzShzZrHeohrUY6uFCaeSSlLs xbLJzjXWxgfTBCjwlBT6lBNHhwt3JP7tCFwy4HO06jP53IBYPmBMauW3HfB40N6SYpE8zvvY6vH+P 6OdwXVgG/CRHt2Jek1tv/w==; In-Reply-To: (message from Andrea Corallo on Tue, 07 May 2024 06:37:50 -0400) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:319055 Archived-At: > From: Andrea Corallo > Cc: Eli Zaretskii , monnier@iro.umontreal.ca, > mattias.engdegard@gmail.com, stefankangas@gmail.com > Date: Tue, 07 May 2024 06:37:50 -0400 > > 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. Is this for Emacs 30 or Emacs 31? If the former, we should conclude this discussion soon enough. I don't have an opinion about the utility of this for Emacs Lisp, but this part of the documentation: > +Possible values are: > + > +0 Emitted code can misbehave or crash Emacs if function declarations are > +not correct and the function is native compiled (@pxref{Native > +Compilation}). > + > +1 Emitted code is generated in a safe matter even if function are > +miss-declared." should be formatted as a @table. > 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? Yes, I think so.