Urgent.News

What's breaking now, across thousands of outlets.

Tech

Queryable Executables

My article about executing a SQLite database, titled 'Your executable is a SQLite database', garnered positive attention. The concept of binfmt_misc allowing a program to run from a database file has struck a chord with many people. SELF, a format where the program itself is a SQLite database, is a format that has been considered for a while.

By using binfmt_misc, the program can trigger a custom interpreter that maps the rows in the segments table and jumps to the entry point. This concept has led to a whole class of binary tooling collapsing into SQL. The idea of storing the program's state within the same file it runs from, using ACID transactions, has been explored.

An example of this is 'self-httpd', a proof-of-concept webserver that stores the website, routes, and visitor logs within the same SQLite file. This webserver is live at https://selfdb.exe.xyz. The file contains the program, the website, the routes, and all the visitor logs. The web-server is also the server, the program, the website, and the visitor log.

The simplicity of using SQL for all aspects of the application is appreciated. The concept of fully queryable executables has been explored, with SQLite's capabilities being leveraged for tasks such as audits, full-text search, and data migrations. The webserver, for example, can edit its own content while running, with updates being made transactionally.

The file format being SQLite enables the use of existing tooling, making it a simple and efficient solution. The author has found this idea intriguing and is curious to see what others might do with this concept. The project can be found at fzakaria/selfdb.

Written by urgent.news from Hacker News's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.

Read the original at fzakaria.com →

More in Tech

A LaunchAgent gets `Operation not permitted` for `~/Documents` while Terminal works

The same zsh script could list ~/Documents when I ran it in Terminal. Started as a LaunchAgent, it failed with: ls: /Users/administrator/Documents: Operation not permitted The LaunchAgent had the same…

  • LaunchAgent encountered 'Operation not permitted' error on ~/Documents
  • Terminal accessed the same directory without permission issue
  • Difference found in launch context and macOS privacy settings

More from Wednesday 26 August →