logoalt Hacker News

WalterBrightyesterday at 5:49 PM4 repliesview on HN

Back in the 1980s, text editors had configuration files. The configuration file would be read every time the editor was loaded. This was very slow on a floppy disk system.

I realized that, instead of a configuration file, I could configure the executable instead! So, any changes in configuration meant the editor would patch its own exe file!

This marvelous technique came to an end when attempts to stop malware got folded into the operating system.


Replies

weinzierlyesterday at 6:06 PM

Some early systems, like TeX and I believe some Lisps, took this to the extreme. Instead of patching, they loaded their config once and then dumped the configured process image to a file, which was used in subsequent invocations.

show 6 replies
UltraSanetoday at 6:29 AM

When I was learning Python I wrote a program that stored data in its own .py file. I felt pretty smart.

badsectoraculayesterday at 6:10 PM

IIRC early Turbo Pascal versions worked like that too, there was some "setup" program that let you configure colors, etc, by modifying the COM/EXE file itself.

show 1 reply
akoboldfryingtoday at 2:36 AM

Was the advantage that the exe file's sectors were likely to be contiguous on disk, so the config data could likely be read in a single pass through sectors on the same track, as compared to probably having to wait for a full revolution and a track seek for the separate config file approach? Or was it that the config file was verbose but compressed to a much smaller image in memory, thus fewer bytes to read?