News for hackers. Stuff that matters.
Re:Kilo: A text editor in less than 1000 LOC with syntax hig... by shpx on Tuesday May 20, 2025 @04:16AM (#44039082)
VS Code used 40-60 bytes per line, so a file with 15 million single character lines balloons from 30 MB to 600+ MB. kilo uses 48 bytes per line on my 64-bit machine (though you can make it 40 if you move the last int with the other 3 ints instead of wasting space on padding for memory alignment), so it would have the same issue.

https://github.com/antirez/kilo/blob/323d93b29bd89a2cb446de9...

Re:Kilo: A text editor in less than 1000 LOC with syntax hig... by throw10920 on Tuesday May 20, 2025 @08:49AM (#44040992)
> a file with 15 million single character lines

I have never seen a file like this in my life, let alone opened one. I'm sure they exist and people will want to open them in text editors instead of processing with sed/awk/Python, but now we're well into the 5-sigma of edge cases.