Hacker News new | ask | show | jobs
by jamon51 954 days ago
I love this so much. I got my start on QBasic and made hundreds of games between 12 and 19 years old. I eventually left it behind, but always had a fond spot in my heart for it.

Last year, when I was going to rebuild my personal website, someone on Twitter challenged me: “Build it in QBasic, you coward”. I was like “haha…wait, can I?”

And I did! It runs on QB64 on a DigitalOcean droplet.

Here’s the source:

https://github.com/jamonholmgren/jamon.dev

Check app.bas for the QBasic code.

I may eventually release a CLI and library that lets people spin up a QB64 website in little time.

4 comments

Ha, I once created a web framework in classic ASP that was inspired by QBasic - you’d use pure HTML templates but in handlers you’d write LOCATE statements using XPath selectors instead of screen coordinates, followed by PRINT statements to actually fill in the content of an element. Never tried to actually write it in QBasic itself though. Nice work!
Thank you!

XPATH in LOCATE stmts sounds like asking a disco dancer to moonwalk -- out of its era, but oddly fascinating to watch

It honestly wasn’t a bad approach in practice, many years later there was a similar library called Enlive in Clojure which I genuinely enjoyed. Forces you to use nice semantic IDs and classes for everything. I suppose if you wanted the real BASIC experience you’d actually just PEEK and POKE with character offsets into the templates or something ungodly like that.
This is awesome! Kudos!

I wish there was some kind of "computing archeology" discipline

The folks who built this stuff are still alive. Historian would be a better fit, and we can archive the actual first-hand accounts if we don't waste the chance.
I was confused for a few seconds. This is to help others. The user didn't build their website, they built the web server, a more difficult task.

I was expecting a classic CGI gateway approach with some templating support and maybe a data source (not necessarily sql but perhaps INI).

Instead it's an HTTP server

You could serve your qbasic website from an old Android phone in a drawer my dude.
Not with BabaBASIC (for now?). No networking support whatsoever :P
Fairly certain jamon can wire in some io, let me nerd snipe in peace plz
My apologies. BabaBASIC is here to make any Android-related anachronistic dream come true (˃̣̣̥ w ˂̣̣̥).
I think I have a general idea on how to implement basic TCP/IP sockets while staying true to QBasic 4.5's spirit (i.e. not introducing functions like _OpenConnection/_ConnectionAddress etc.)

The "API" I have in mind would look something like

```

OPEN "TCP:\127.0.0.1\80\LISTEN" FOR INPUT AS #1 INPUT #1, CONN$ IF CONN$ <> "" REM CONN$ contains something like "TCP:\127.0.0.1\80\REMOTE_HOST\REMOTE_PORT" OPEN CONN$ AS #2

  REM ... respond to request
  PRINT #2, "200 OK"
  CLOSE #2
END IF

```

Don't tempt me.
Ugh, jamon51, I think we slashdotted your website