August 4th, 2024

Qub – a framework for building websites with QBasic

Qub is a CLI tool for generating web servers using QB64, simplifying web development for QBasic users. It supports macOS and Linux, with commands for creating and managing websites.

Read original articleLink Icon
NostalgiaExcitementConcern
Qub – a framework for building websites with QBasic

Qub is a command-line interface (CLI) tool designed for generating web servers and frameworks for building websites using QB64, a modern variant of QBasic. It simplifies web application development for users familiar with QBasic. Qub has been primarily tested on macOS and Linux, with potential compatibility on Windows through WSL or Git Bash. To get started, users need to set up an alias in their terminal and can execute basic commands such as running the CLI, checking the version, and creating or updating a website.

To create a website, users run the command `qub create`, follow the prompts to specify a domain name, and then navigate to the project folder to build the website using `./bin/build` and start the server with `./server`, allowing access at http://localhost:6464/. The generated website features a specific folder structure that includes directories for binaries, configuration files, web pages, and static assets. Key features of Qub include page routing, static file serving, customizable 404 pages, and basic dynamic variable support, with plans for future enhancements to include more dynamic features and templating support. Qub is licensed under the MIT License, and further details can be found on its GitHub repository.

AI: What people are saying
The comments reflect a mix of nostalgia, technical concerns, and appreciation for the Qub project.
  • Many users express nostalgia for QBasic and share their early programming experiences.
  • There are concerns about the security implications of using `curl` for command execution in the CLI tool.
  • Some commenters highlight the differences between traditional QBasic and the modern QB64 used in this project.
  • Users appreciate the simplicity and accessibility of the Qub tool for web development.
  • Several commenters share their own experiences with similar projects or technologies, fostering a sense of community.
Link Icon 12 comments
By @jamon51 - 6 months
Hey, fun to see my fun little project showing up on HN!

Yes, aliasing the CLI command to a remote script is not exactly best practice. My casual question to myself when I made it was … what’s the literal easiest way I could get this to work on someone’s computer with as few dependencies as possible? This was the solution I came up with. (And in my defense, it is similar to how you install homebrew … `/bin/bash -c "$(curl -fsSL https://xn--rvg)`, but I get that most wouldn’t trust a somewhat random GitHub account like this.)

If you have any questions about this, let me know! My website (https://jamon.dev) runs on it (in a DigitalOcean droplet) and I’ve enjoyed the experience.

By @roywiggins - 6 months
I know this project is just for fun, but I did once work on a website backend that genuinely used Visual Basic 6 to generate dynamic webpages. This was not a small, internal product either, and it was in this century. I think they moved it all to .NET eventually, but for a while it was Frankensteined out of .NET and VB6.

The main thing I remember was trying to debug questionnaire functionality and getting very nearly nowhere: it was an entire questionnaire engine implemented in VB6, which was probably why it hadn't been ported to .NET yet. I'm sure PHP of the same vintage would have been equally gnarly, mind you.

By @pan69 - 6 months
Cool as this is, this isn't the QBasic that came with Microsoft DOS back in the day. It seems to be written in QB64 which is a modern BASIC distribution that retains compatibility with MS Qbasic.

E.g. to open the TCP/IP connection, this project uses the _OPENHOST function, which does not exist in the olden QB.

https://qb64.com/wiki/_OPENHOST.html

https://github.com/jamonholmgren/qub/blob/main/template/qub/...

By @shannongreen - 6 months
And I thought "install from curl" was bad. Now we run from curl, every time?

  alias qub="source <(curl -sSL https://raw.githubusercontent.com/jamonholmgren/qub/main/src/cli.sh)"
By @jayski - 6 months
I love it. I too started programming with QBasic in the 90s. I spent many hours modifying (and breaking) the code for bananas.bas and nibbles.bas to give myself all kinds of superpowers.

I haven't touched QB in decades but I'm glad someone did and had fun working on it.

By @nxobject - 6 months
I very much love it – taking console-oriented languages/environments where they shouldn't be give me so much joy, especially ones you've grown up with. I started with RAD Pascal, and I am lucky that there are modern Pascals around with the very comfortable development environments.
By @slmjkdbtl - 6 months

  alias qub="source <(curl -sSL https://raw.githubusercontent.com/jamonholmgren/qub/main/src/cli.sh)"
a bit concerning to hot alias a simple command to remote shell execution
By @keepamovin - 6 months
Wow, so cool. I love QBasic, it was officially my first programming language (besides messing around in asm with debug on DOS (version 5 I guess) in the late 80s early 90s

I was hoping to see like request handlers

By @mattl - 6 months
Great to see this!

Back in the late 90s I worked on a system that generated a static website from an existing QB application. The app itself was a flat file database with a few thousand entries and was very fast. The web version was equally fast as you’d enter a customer number and it would just redirect you to that page. It did very little but we did add a few hints to the screen output and then would screen-scrape the app window to a plain text file and then run my tool to convert those plain text files to templated pages.

By @nickstinemates - 6 months
Reading [1] brings back such good nostalgia writing Visual Basic. Now I need to take the opportunity to write some good QBasic code. Thanks for this!

1: https://github.com/jamonholmgren/qub/blob/main/template/qub/...

By @vunderba - 6 months
Good stuff! Noticed this is written using the modern day variant QB 64.

Does QB64 still suffer from a slight amount of latency when you punch the RUN button associated with the fact that it has to compile the code before it runs it? I miss the dopamine hit from old school QBasic with its "relatively" instantaneous interpretive code when hitting F5.

By @0points - 6 months
Oh my. My last qbasic project was a crappy bbs system with message boards and whatnot in 1994.

I thought we all took qbasic around the barn and never spoke of it again.

How come it is becoming popular again? I seen pascal trending too, why???