Well, fair point and a nice link. I mostly thought identical names for roughly 
identical things and worth mention.

Since this thread is about storing to disk, I should mention the too often 
neglected option of near-zero overhead native-binary-layout file formats that 
are "`mmap` & go" with no repeated parsing or even unnecessary paging. The file 
system can basically become your memory allocator. Ascii->binary and especially 
binary->Ascii is an expensive conversion for numbers (though any cost is always 
"compared to what").

Native binary does break "portability" to e.g. machines with different 
endianness/byte-order or non-IEEE floating point formats and whatnot. In the 
modern era, little endian and IEEE FP has won to such a degree that in practice 
this may matter little, if at all. In the old days, sharing a network volume 
between e.g., a big endian Sparc and a little endian Intel box was more common.

Anyway, Nim supports this all fine (as in, e.g., my 
[https://github.com/c-blake/suggest)](https://github.com/c-blake/suggest\)), 
but A) that is _far_ from pedagogical code, { but hey, at least it's a fully 
worked example }, and B) it can often be error prone work in general. Someone 
out in Nim land should maybe do a macro package someday to make it easier 
(unless they already have?).

Reply via email to