From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?utf-8?Q?Gerd_M=C3=B6llmann?= Newsgroups: gmane.emacs.devel Subject: Re: Introducing 'safety' compilation parameter Date: Thu, 09 May 2024 11:19:04 +0200 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="26395"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: emacs-devel@gnu.org, Eli Zaretskii , 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 11:19:58 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 1s4zwU-0006bW-ND for ged-emacs-devel@m.gmane-mx.org; Thu, 09 May 2024 11:19:58 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1s4zvp-0003FU-48; Thu, 09 May 2024 05:19:17 -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 1s4zvn-0003F9-QR for emacs-devel@gnu.org; Thu, 09 May 2024 05:19:15 -0400 Original-Received: from mail-lj1-x232.google.com ([2a00:1450:4864:20::232]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1s4zvg-0006oe-H0; Thu, 09 May 2024 05:19:13 -0400 Original-Received: by mail-lj1-x232.google.com with SMTP id 38308e7fff4ca-2e271acb015so8593361fa.1; Thu, 09 May 2024 02:19:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1715246346; x=1715851146; darn=gnu.org; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=jAlF16Eciho8GJBo/U8YdAMER0JreiRvkF2FoL68/Kg=; b=bm2MI27ORhI1EWsmSgLwO8KqF48DBT3AXJvZyOQxpIWZz2M/zlRRGzgX5lHvgURI+v r713OdYoGtqFrd4GN2j3ehhpbEQTB5p8rVQ7COz7k6O8tnmDpK1HknJDkRU8sY4Vjrs4 DpiZUw1WOeDeTkVwXK75MolSCM65R7pDyDOQkSkcT/fHiVjDOOJFzFOILrTaTrvtRSGu +WSXi6H54ti+UAGL1viWpgURhxnQ3X0Y5vPuqQoujEVjDi35LgYa+qD8XSNTeuiUMGsq JhGnYXatFh453ELIlP+UZbo9parmW3A2GCv7yqosVGRi/3uzXmFxO13mZbXm5HzjU3bC X7Eg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1715246346; x=1715851146; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=jAlF16Eciho8GJBo/U8YdAMER0JreiRvkF2FoL68/Kg=; b=QuTq7kg2aQezD4MvVBggSXI4jF4SryEXB2u0CfMpS7lqMssSNV9dALog0MQWltXEp+ s2TMpaeH7VwPadO7kvi3UtyyAlS9ev6h7UzZZCgwhD5vHhP+shHRBHNaX/eYZiL6Mn1o bvRh1IaZrgyzvKiwjBkMI8FT7nT7HjlRe+eLZRsqDi8j4Ek2roLmuCHEUlZwqHSk8+t+ etY0R9v++aGonRPwnigpwrxPBs+mDgn26ADcKZwCD6C7cPZ6Mpan+glQRZ49jbqLWiM8 LsI/JrU312wa75t79Ey06bjX7vX4CAwNMP23NTfIM8WhsOA0Yaq9gmyMPiAoTHJegxxN w2IQ== X-Forwarded-Encrypted: i=1; AJvYcCX7AxtqmvVP2vzTGlVdaQos0dqpTkReT39B5Ycdf/ajOHvmiNCNIpsrrpdenSOVI7nFEdduMFQ90AkTKSc= X-Gm-Message-State: AOJu0YxrSv5Y/RdU258KtWYzzfrJu+Ov02fLkTS4PGqGYSlNTH0ejQW7 IM5oFtBuSnEac7jzmsEj4c6+DEqnxGWCzPrsHyOzuh8vvL0+NE3cuN6GCg== X-Google-Smtp-Source: AGHT+IEvRVj/c96+ng/vCbPUZ/1mh5WZs1cxkZRFthasktzDgbYQqcFpHUZAGc+wcKYSSScoziL+tQ== X-Received: by 2002:a05:6512:3e18:b0:519:5e81:276d with SMTP id 2adb3069b0e04-5217c56d95cmr4111988e87.31.1715246345443; Thu, 09 May 2024 02:19:05 -0700 (PDT) Original-Received: from pro2.fritz.box (pd9e36021.dip0.t-ipconnect.de. [217.227.96.33]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-41fa9dbab53sm36261775e9.13.2024.05.09.02.19.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 09 May 2024 02:19:05 -0700 (PDT) In-Reply-To: (Andrea Corallo's message of "Tue, 07 May 2024 06:37:50 -0400") Received-SPF: pass client-ip=2a00:1450:4864:20::232; envelope-from=gerd.moellmann@gmail.com; helo=mail-lj1-x232.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, T_SPF_TEMPERROR=0.01 autolearn=ham autolearn_force=no X-Spam_action: no action 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:319057 Archived-At: Andrea Corallo 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.