SELF is an executable format that stores a program as a SQLite database, with executable segments represented as database rows. A Linux binfmt_misc interpreter maps those rows and transfers control to the program entry point, allowing executable contents and related metadata to be queried with SQL. The format can also let a running program open its own SQLite file through argv[0] and persist state in that same file; /proc/self/exe does not currently provide the original file in this setup. The self-httpd proof of concept packages a web server, website routes, visitor logs and button-press records into one SQLite database file. Its routes, visits and presses tables store page content and runtime data, while the server can query its own segments, symbols and relocations. A POST request to its /api/press endpoint inserts a button press into the executable’s database, and the live demonstration is hosted at selfdb.exe.xyz. SQLite transactions allow site content in the running file to be updated or rolled back without restarting the server. SQLite tools such as sqldiff can compare code, route and metadata changes between versions, and FTS5 can index pages stored in the executable. Deployments can copy a single file, while SQL INSERT ... SELECT statements can migrate tables such as visitor logs and button presses from an old file to a new build before it is swapped in.
fzakaria.com
7 min
19h ago
SELF is an executable format that stores a program as a SQLite database, with executable segments represented as database rows. A Linux binfmt_misc interpreter maps those rows and transfers control to the program entry point, allowing executable contents and related metadata to be queried with SQL. The format can also let a running program open its own SQLite file through argv[0] and persist state in that same file; /proc/self/exe does not currently provide the original file in this setup. The self-httpd proof of concept packages a web server, website routes, visitor logs and button-press records into one SQLite database file. Its routes, visits and presses tables store page content and runtime data, while the server can query its own segments, symbols and relocations. A POST request to its /api/press endpoint inserts a button press into the executable’s database, and the live demonstration is hosted at selfdb.exe.xyz. SQLite transactions allow site content in the running file to be updated or rolled back without restarting the server. SQLite tools such as sqldiff can compare code, route and metadata changes between versions, and FTS5 can index pages stored in the executable. Deployments can copy a single file, while SQL INSERT ... SELECT statements can migrate tables such as visitor logs and button presses from an old file to a new build before it is swapped in.
fzakaria.com
7 min
19h ago
SELF is an executable format that stores a program as a SQLite database, with executable segments represented as database rows. A Linux binfmt_misc interpreter maps those rows and transfers control to the program entry point, allowing executable contents and related metadata to be queried with SQL. The format can also let a running program open its own SQLite file through argv[0] and persist state in that same file; /proc/self/exe does not currently provide the original file in this setup. The self-httpd proof of concept packages a web server, website routes, visitor logs and button-press records into one SQLite database file. Its routes, visits and presses tables store page content and runtime data, while the server can query its own segments, symbols and relocations. A POST request to its /api/press endpoint inserts a button press into the executable’s database, and the live demonstration is hosted at selfdb.exe.xyz. SQLite transactions allow site content in the running file to be updated or rolled back without restarting the server. SQLite tools such as sqldiff can compare code, route and metadata changes between versions, and FTS5 can index pages stored in the executable. Deployments can copy a single file, while SQL INSERT ... SELECT statements can migrate tables such as visitor logs and button presses from an old file to a new build before it is swapped in.
fzakaria.com
7 min
19h ago
No more articles to load