|
|
|
|
|
by floren
1385 days ago
|
|
I've been digging into Common Lisp again lately. I'm really enjoying some parts: CLIM is weird but interesting, and the fact that I'm basically developing inside a debugger makes testing and iterating on stuff pretty straightforward. On the other hand, library documentation frequently feels more like the programmer was making notes to himself rather than illustrating how the code might actually be used. I was also pretty shocked when, after using a quick shell script to generate a file containing a big list (~80MB on disk, 800k items) defined in s-expressions, reading it into SBCL exhausted the heap. After telling SBCL it could allocate two gigabytes I was able to read the file, but doing anything with it was a sure-fire way to run out of memory again. I would never think twice about reading an 80MB file into a Go program! I sort of feel like I'm walking through an abandoned alien city and wondering what size they were, how many limbs they had, and if we share the same 5 senses or not. |
|
- Use an array
- Load the entire file in a memory buffer and skip the reader
- Use mmap (for extra points, you can keep the entire file outside the Lisp heap but still manipulate it in Lisp)