No garbage collector, no free
- The problem
- A garbage collector pauses your program at moments you do not choose. Freeing memory by hand hands you the bugs.
- An example
- A service that must answer in a steady time, without a pause while a collector runs, and without a use-after-free.
- What Nikaia checks
- Nikaia has no garbage collector and no
free. Memory is released at a point you can see in the code, so there are no collector pauses. The compiler works out which data needs protecting and when memory can be freed. - The limit
- Nikaia turns your program into a Rust crate, and Rust’s compiler checks memory safety again. So release follows Rust’s rules underneath, and an error from that last step is reported against your
.nikaline.
Go deeper
More under Very fast: 1BRC study: the Nikaia compiler vs. human vs. AIOne core or all of themChecks that are proved are dropped