BF-SQLite offers a unique approach to interacting with SQLite databases through BrainFuck, showcasing how complex tasks can be simplified with innovative uses of AI. This project provides a working demo for reading headers, scanning tables, and performing limited SQL operations, all designed to demonstrate the unexpected potential of unconventional programming languages.
BF-SQLite: SQLite File-Format Access in BrainFuck
BF-SQLite is an experimental project designed to interface with SQLite databases using the BrainFuck programming language, employing only standard Linux primitives. This initiative highlights how software typically deemed complex can be constructed quickly with the assistance of AI. Inspired by Matt Shumer's article Something Big is Happening, the project illustrates the capabilities of BrainFuck rather than advocating for its practical application in database operations.
SELECT name FROM users;
SELECT name, sex FROM users;
CREATE TABLE log (ts INT, value TEXT);
INSERT, UPDATE, and DELETE operations on a minimal demo database.The following functionalities have been successfully implemented:
SELECT queries on the demo users tableThe interaction model operates as follows:
SQLite .db file
↑
│ dd / raw page bytes
│
Shell pager
↑
│ ASCII request/response
│
BrainFuck program
The protocol is intentionally designed to be straightforward:
H reads the 100-byte SQLite header and displays it in hexadecimal format.R <page_size> <page_no> retrieves a page and returns it as hex.W <page_size> <page_no> writes a specified page back in hexadecimal format.The repository is organized into distinct directories for clarity and efficiency:
bf/ - Contains demo programs and BrainFuck helper libraries.examples/ - Hosts curated demos and reference sketches.scripts/ - Includes pagination, build, and execution helpers.tools/ - Offers a Dockerized toolchain.docs/archive/ - Contains older planning and maintenance notes.BF-SQLite serves specifically as a BrainFuck-driven SQLite file-format demonstration and is not intended to function as a full SQLite replacement or SQL engine.
No comments yet.
Sign in to be the first to comment.