History of DFHack...
Is long. I really don't remember a lot of the details. It's been 7 years? I'll just try to fill in the blanks that people missed.
It started as a part of Khazad - a DF visualizer which I ported to linux:
https://github.com/ImpalerWrG/Khazad/commit/c5b21a2479926d03e5cdc20ced5f5c10a38d5d3ahttps://github.com/ImpalerWrG/Khazad/commits/master?page=17Over time, it turned into a separate project, used in Khazad:
https://github.com/ImpalerWrG/Khazad/commits/master?page=13https://github.com/DFHack/dfhack/commit/fac88478bd72056e4043e73ff1e8832ce1474a63At this point, it was structured as a library (common functionality) and a bunch of executables (the actual tools like `reveal`). It worked sort of like a debugger - stopping the main process, making its changes and then letting it run again.
Then
ImpalerWrG made some comments on here that weren't well received and got driven away by the locals (Toady included). I got caught up in that and was forced to completely abandon Khazad. After the dust settled, DFHack continued as an entirely separate project.
It expanded, and over time, I tried improving how it worked. One of the big problems was performance. Stopping and starting the DF process alone was slow. On linux, it could also only write 4 bytes at a time to memory. It had to ask the OS to do everything and it simply wasn't good.
My first attempt at fixing the performance was sort of silly. It involved injecting code into DF (that part survived until now) and then setting up a shared memory area that was used to push data through. It was very new to me, and I made plenty of mistakes... like trying to use a busy loop in order to speed up pushing of data through this window... It only worked well on dual core CPUs, when nothing else was running:
https://github.com/DFHack/dfhack/commit/efce0ab21b34085a76fd9e7b4d58166e114dca04That obviously couldn't work, and I don't think many people used it (if anyone).
I think the suggestion to move more things into the DF process came from Baughn (but I'm not really sure). Also, some (bad) antivirus software started to detect the DFHack tools as viruses. So, I simply had to change it to how it works now:
https://github.com/DFHack/dfhack/commit/81d648dfa73f1a3b1b62039c1277bd38c9414347I had a video of the first running DFHack console inside DF... but I can't find it. It was basically printing the game cursor coords to the console
The rest of the DFHack APIs and tools got ported to the new layout.
I added plugins and a RPC interface based on sockets and Google protobuf.
Support for scripting in Lua and Ruby got added (actually, the old dfhack had python scripting support, but that died a long time before this).
The old APIs were superseded by df-structures, which got split off at some point (I think):
https://github.com/DFHack/dfhack/commit/f2a69188ea3fc100662bb334664f7223cbfe5049... and the rest of it was a lot of work. After several years of maintenance, I left the project for others to worry about