[libre-riscv-dev] benefits of rust

Jacob Lifshay programmerjake at gmail.com
Sun Mar 15 05:42:55 GMT 2020


On Sat, Mar 14, 2020, 22:18 Hendrik Boom <hendrik at topoi.pooq.com> wrote:

> The one drawback I see to Rust is that it doesn't have a
> garbage-collected scope or storage class.  There are programming
> techniques that involve complexly tangled data structure.  Rust is
> not good for such problems.
>

Rust has support for reference counted smart pointers in the standard
library (Arc (atomic) and Rc (non-atomic)), where those aren't sufficient,
there are libraries for arenas (what I'm using in Kazan for compiler
data-structures (see shader-compiler-ir in the git repo) -- also used in
the rust compiler itself) as well as experimental libraries for full
garbage collection:
see shifgrethor for one of the more interesting GC libraries written by a
core rust contributor:
https://internals.rust-lang.org/t/shifgrethor-garbage-collection-as-a-rust-library/8597

Incidentally, I am also writing a custom garbage collector in Rust for the
next version of my Minecraft-style game engine (Voxels) -- I'm using a 3D
variant of the hashlife algorithm (see wikipedia) which uses a garbage
collector except that the more garbage is kept around the faster it runs
(opposite of most GCs) since it is used to cache computations.

Jacob


More information about the libre-riscv-dev mailing list