Comment

Comment by tialaramex

> you'll be copying and re-allocating almost the whole thing on every loop iteration.

This is true if the list is writeable, but, if so surely a Lisp has to also keep duplicating the list or else it will get into trouble?

For reading the list why shouldn't Rust use a slice of the vector? The slice can't own anything, but that's OK, we aren't changing anything. The slice is very cheap, it's basically a pointer into the vector plus a length count.

parent tialaramex 5 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton