You could serve your qbasic website from an old Android phone in a drawer my dude.
Re:Show HN: QBasic 4.5 on Android
by thatha7777 on Thursday November 09, 2023 @10:55AM
(#38206593)
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
Re:Show HN: QBasic 4.5 on Android
by thatha7777 on Thursday November 09, 2023 @12:17PM
(#38207844)
My apologies. BabaBASIC is here to make any Android-related anachronistic dream come true (˃̣̣̥ w ˂̣̣̥).
Re:Show HN: QBasic 4.5 on Android
by thatha7777 on Thursday November 09, 2023 @01:59PM
(#38209309)
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.
Re:Show HN: QBasic 4.5 on Android
by thatha7777 on Thursday November 09, 2023 @01:54PM
(#38209225)
Ugh, jamon51, I think we slashdotted your website
Re:Show HN: QBasic 4.5 on Android
by thatha7777 on Thursday November 09, 2023 @10:54AM
(#38206585)
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.
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!
Re:Show HN: QBasic 4.5 on Android
by thatha7777 on Thursday November 09, 2023 @03:05PM
(#38210411)
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.
Re:Show HN: QBasic 4.5 on Android
by kristopolous on Thursday November 09, 2023 @05:00PM
(#38211967)
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
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.