News for hackers. Stuff that matters.
Re:Show HN: Molecule – Streaming, zero-allocation protobuf d... by kitd on Sunday March 29, 2020 @05:38PM (#22722995)
Giving different views and projections on underlying memory is really the key tactic to processing data without allocations. A slice (ie a view onto an array) is a pointer to underlying memory (or another slice), along with the length (+ capacity in Go, but that's not often needed). Underneath the bytes don't move. You simply pass around the views (or views of views) of what you want your code to actually see.

Don't know about Rust, but Go has slices built into the language, and C++ has it in the standard library. Learning idiomatic slice-handling makes working with data sans allocation much, much easier.

Re:Show HN: Molecule – Streaming, zero-allocation protobuf d... by monocasa on Sunday March 29, 2020 @06:13PM (#22723251)
> Don't know about Rust, but Go has slices built into the language, and C++ has it in the standard library.

Rust also is very big into slices as well.