Date: Fri, 13 Sep 2024 11:59:14 +0000 From: Paul Floyd <paulf2718@gmail.com> To: freebsd-hackers@freebsd.org Subject: Re: The Case for Rust (in any system) Message-ID: <9924d197-1b3f-4781-9fe0-20579c8e9066@gmail.com> In-Reply-To: <CAGBxaX=N_%2BvtF1HpM9OqUN-6O3AFTPj65UA04d8h74D=Y6Kf2g@mail.gmail.com> References: <CAOzHqcJ0rOR4CoL84WgZQNcgY2G9vuiHccE4XT_otJ2R51KJ3Q@mail.gmail.com> <2EE309BF-CE1D-48AD-9C53-D4C87998B4A0@freebsd.org> <CAOzHqcJs2Ls9rG-X9%2Bjsc=Z2XHvh_eo=5jyFSaTDc6kUMK8vPg@mail.gmail.com> <2D0F93DC-36DA-4FB9-BFD2-D7678EC03CD7@FreeBSD.org> <CAGBxaX=N_%2BvtF1HpM9OqUN-6O3AFTPj65UA04d8h74D=Y6Kf2g@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 13-09-24 11:40, Aryeh Friedman wrote: > > 1. Fixed allocations are *ALWAYS* safer and more predictable then > dynamic ones (dynamic ones are undecidable in there nature and > effects). > > 2. Combining fixed allocation with dynamic (under the hood and > unrequested) allocation is a very bad idea. > > 3. It is possible to do all the above safely with arrays and not > pointers IF the arrays are static but not dynamic. > > This implies that if and when you grow/shrink the physical array you > need to have really tight control on timing and Rust does not provide > that by putting it all under the hood. You aren't being very clear with your vocabulary. In C there are 4 main kinds of storage. Global, static and automatic. These are all of constant fixed size (except for automatic which can use VLAs since C99 which is of variable fixed size). Dynamic, as managed by malloc and family. Can be constant sized or variable sized. Which of these is your array that can grow or shrink? A+ Paul
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?9924d197-1b3f-4781-9fe0-20579c8e9066>