Re: The Case for Rust (in any system)

From: Paul Floyd <paulf2718_at_gmail.com>
Date: Fri, 13 Sep 2024 11:59:14 UTC

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