Executable Is a SQLite Database(fzakaria.com)
547 points by setheron 17 days ago | 106 comments
tl;dr: The author built SELF, a prototype executable format that replaces ELF with a SQLite database, using binfmt_misc to launch it via a custom interpreter that maps segments and resolves symbols through SQL queries. Individual binaries are ~2x larger due to b-tree overhead, but packing an entire userland (723 executables, 400 libraries) into one database yields 611 MiB vs 644 MiB of ELF files, with tools like `strip`, `ldd`, and `LD_PRELOAD` reducing to SQL transactions and joins. Code is available at fzakaria/selfdb.
HN Discussion:
  • Excitement about SQLite virtual tables and the broader potential of the approach
  • Extending the idea further to include app data, VFS, or cross-platform runtimes
  • ~Noting that executable formats being databases is not novel (PE/COFF, .NET)
  • Questioning why SQLite specifically is needed rather than just a SQL query engine over ELF
  • Concern that memory copying vs mapping is a serious dealbreaker for the approach