Executable Is a SQLite Database
Ranked #4 on Hacker News with 136 points and 17 comments.
I have been probably obsessed with two things in the last few years: Nix as a tool to explore innovative ideas that require the capability to rebuild the world and replacing ELF with SQLite as an executable format. You might have noticed that these two ideas are well suited to each other.
I explored the idea during my PhD thesis but found feedback from others unmotivating. Radical ideas are hard to sell, as you are working against the inertia of the established solution.
One of the end results of that exploration was sqlelf , a tool that lets you explore an ELF file declaratively using SQL. 1 1 I wrote a paper, arXiv:2405.03883 , that I failed to get published and a follow-up post on querying with it . SELECT name FROM elf_symbols instead of fiddling with readelf and grep . It was remarkably simple by leveraging virtual tables over the ELF: however I found it to be a refreshing improvement to explore the ELF file format. I knew however that there is still something much bigger to be done.
I never let the idea go and with the recent improvements with LLMs, I find it compelling to revisit these ideas to explore further. Specifically, can we replace ELF with SQLite as an executable format? π€
Not βa database that describes an executableβ, but the actual file you chmod +x and run.
I developed a pretty fleshed out prototype. It is called SELF , the Structured Executable & Linkable Format , because I am unoriginal. It is on GitHub if you are interested. Iβm surprised about all the interesting things that fall out of this idea.