From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail From: "Dmitry A. Kazakov" Newsgroups: comp.lang.ada Subject: Re: Dimensional Analysis Date: Sat, 5 Apr 2025 10:20:14 +0200 Organization: A noiseless patient Spider Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Date: Sat, 05 Apr 2025 10:20:15 +0200 (CEST) Injection-Info: dont-email.me; posting-host="8680b03d41551e2fc04d8cd8c12ee83a"; logging-data="1875977"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX19TD/fNIKSPl4otcU5NnnmQAgyW+teggsg=" User-Agent: Mozilla Thunderbird Cancel-Lock: sha1:kxyIpQeg0g8YCYa9Z34rLexRhMQ= Content-Language: en-US In-Reply-To: Xref: news.eternal-september.org comp.lang.ada:66543 List-Id: On 2025-04-05 09:17, Lawrence D'Oliveiro wrote: > So what do you think of this idea? Is it already in use in a > significant way in any Ada code? I figured if any language would be > looking at new ways of writing safer code, it would be the Ada crowd. > ;) Static dimensionality checks are implemented by the GNAT compiler, see https://gcc.gnu.org/onlinedocs/gnat_ugn/Performing-Dimensionality-Analysis-in-GNAT.html For engineering purposes static checks are worthless. So in practice constrained types and dynamic checks are used instead. See https://www.dmitry-kazakov.de/ada/units.htm -- Regards, Dmitry A. Kazakov http://www.dmitry-kazakov.de