10 PRINT "WHAT IS THIS"
This is satire. It is also real: it serves HTTP, routes requests, renders templates, escapes output, reads a database and answers JSON. Written in BASIC. On purpose. Not affiliated with, endorsed by or a threat to Laravel.
BASIC cannot open sockets. Neither could your Commodore 64. So socat listens, a 100-line bash adapter does the HTTP part, and bwBASIC does everything else: routing, controllers, templates, escaping, URL decoding, CSV parsing and JSON.
browser ──TCP──► socat ──stdin──► bootstrap/handle.sh ──file──► bwbasic build/APP.BAS
│
10 INDEX.BAS ► 1000 ROUTER ► 9000 ON...GOSUB ► 2xxxx CONTROLLER ► 3000 VIEW
│
browser ◄──HTTP── handle.sh ◄────────── PRINT #9 ─────────────────┘
20 GOSUB ROUTES
Routes are DATA statements. Order is priority.
10000 REM @range 10000-14999
10010 DATA "GET", "/", 20000
10020 DATA "GET", "/users", 21000
10030 DATA "GET", "/users/{id}", 21100
10040 DATA "GET", "/hello", 22000
10050 DATA "GET", "/goto", 23000
BASIC cannot GOSUB to a variable, so gosubtisan build writes the dispatcher for you. That is the entire service container:
9000 REM DISPATCHER. GENERATED BY GOSUBTISAN BUILD. DO NOT EDIT. WE MEAN IT. 9010 ON RTN GOSUB 20000,21000,21100,22000,23000,21300,21200
| Laravel (PHP) | Laravel BASIC | |
|---|---|---|
| Controller dispatch | Reflection + container | ON RTN GOSUB |
| Dependency injection | Service container | Every variable is global, so everything is already injected |
| Namespaces | PSR-4 | Line number ranges |
| ORM | Eloquent | GOTOquent (CSV files) |
| CLI | artisan | gosubtisan |
| Queues | Horizon | 10 GOTO 10 |
30 GOSUB SCREENSHOTS
Real screenshots. Served by bash, socat and a BASIC interpreter. No PHP was harmed.
40 RUN
No clone, no build, just pull (amd64 and arm64, from the GitHub Container Registry):
docker run --rm -p 8000:8000 ghcr.io/dcarrero/laravel-basic # open http://localhost:8000
Docker Compose (recommended, read-only and all):
git clone https://github.com/dcarrero/laravel-basic.git cd laravel-basic docker compose up --build # open http://localhost:8000
The container runs as a non-root user, with a read-only filesystem, no capabilities and a healthcheck that asks ARE YOU ALIVE? every 30 seconds.
Bare metal (Debian/Ubuntu):
sudo apt install bwbasic socat cp .env.example .env ./gosubtisan serve
50 GOSUB GOSUBTISAN
$ ./gosubtisan route:list
METHOD URI ACTION (LINE)
GET / GOSUB 20000 WelcomeController.BAS
GET /users GOSUB 21000 UserController.BAS
GET /users/{id} GOSUB 21100 UserController.BAS
GET /hello GOSUB 22000 HelloController.BAS
GET /goto GOSUB 23000 GotoController.BAS
GET /api/users GOSUB 21300 UserController.BAS
GET /api/users/{id} GOSUB 21200 UserController.BAS
60 LIST DOCS
The long versions, for people who read manuals (all four of you):
- Architecture: socat, bash, bwBASIC and how a URL becomes a line number.
- gosubtisan: every command, with real output.
- Deployment: read-only Docker, tmpfs, healthcheck, and why not production.
- Testing: curl, grep and GitHub Actions.
- Contributing: add a route, add a view, number your commits.
70 PRINT "AS SEEN IN"
- programacion.net (Spanish): how the satire is built, from
DATAroutes toON...GOSUB. - administraciondesistemas.com (Spanish): the Docker side, and three bugs that only showed up when tested.
- systemadministration.net (English): same story, for the sysadmins who skipped Spanish class.
No journalists were harmed. One GOTO was.
80 DATA SPONSORS
Brought to you by people and projects that take technology more seriously than this repo does:
- programacion.net: programming news, guides and community for developers. Where you go after
10 PRINT "HELLO". - opensecurity.es: cybersecurity news and analysis. The reason this framework escapes its output.
- Color Vivo: a network of 100+ digital media sites. Some of them older than this framework's ideas, none older than its language.
- Stackscale: European private cloud and bare-metal infrastructure. Enough RAM to run every BASIC program ever written, at the same time.