Instance Logo

evokegts.umbrellix.org

bread haters (ignore pfp/name) . @croissant, @zeroes.ca

@LunaDragofelis @bjornsdottirs 🌟 Yeah.

I know GNU ed(1) for instance represents text through ASCII strings organized into a linked list data structure—one entry per line in the file. So in that program, adding lines is very simple which matches how you used ed(1) anyway. Wouldn't be surprised if most other editors used linked lists to index lines.

I once hacked on an editor that used UTF-32 to represent characters. An extremely weird choice until you remember that you get complete Unicode coverage while being able to easily jump to specific characters in a file, because each character is 4 bytes, or one 32-bit word. UTF-8 is really only good for storing and transmitting over the wire. Working in it is a bit of a pain.

But yeah memory-mapped plaintext is just a bad idea.

Open thread