Right now the compiler will not do anything fancy in terms of changing
allocations to static or not, but rust does provide some amount of
support for patterns like this.

There is a lint mode #[deny(heap_memory)] you can use to statically
ensure that there is no heap-allocated memory in your program. Rust
also allows you to control how all your local variables are allocated,
so the compiler will never magically make an allocation behind the
scenes that you aren't aware of.

Were those the kinds of static analysis that you were looking for?

On Wed, Nov 13, 2013 at 8:35 AM, Nicolas Boulay <[email protected]> wrote:
> Hello,
>
> I’m an hardware  scientist, working for a software compagny. I had follow
> some open cpu design like F-cpu, and the langage design of Lisaac. I’m an
> expert in C programming, and have some skills in ocaml, perl, c++, java.
>
>
> In synchrone langage (Lustre/Scade), there is no dynamic memory allocation.
> This kind of langage have the data inside function (or “block”), the
> opposite way of object langage with method beside the data. It’s like having
> “static” variable in the C sens, but a different one for each call site.
> There is no loops in Lustre, only high order function like map and fold
> operation, that duplicate the variable for each call. Having such feature,
> reduce the need a dynamic allocation and garbage collector.
>
>
> I think this looks new and strange, but Lustre are used since 10 years in
> real time safety critical software. This kind of (static, compile time)
> memory allocation could be a great help for long running, fast and
> responsive system. I know you target a 1.0 release but this could ease the
> write of software without any dynamic memory allocation.
>
>
> Do you think, this could be implemented in rust ?
>
>
> Regards,
>
> Nicolas Boulay
>
>
> _______________________________________________
> Rust-dev mailing list
> [email protected]
> https://mail.mozilla.org/listinfo/rust-dev
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to