Live data from Hacker News

Serverless QBasic

psuter.net

11–20 of 40 posts

Re: Serverless QBasic

#11
post #10

The suggestion to "use SYSTEM instead of END" is suspicious. SYSTEM spawns the system shell as a sub-process. If one would EXIT from the spawned command.com/cmd.exe, QBASIC would pop up back. I think a user of programs written in this way would find themselves surprised.

This is not true, system quits basic. In gwbasic this was unconditional since there was no ide, in qbasic it works if you used /run to start the program right away, otherwise system is equivalent to end and just drops you back into the ide.

Re: Serverless QBasic

#12
post #8

It’s slow. All those layers of abstraction exact their toll on latency, even on today’s monster systems. Reading the essay, my heart goes out to the author: he missed all those wonderful years in the ‘80’s and the early ‘90’s cracking protections, swapping, coding intros, watching demos and competing on the Commodore64, Commodore Amiga and the ATARI ST. He missed out on all the wonderful memories and all the action.…

Feels like a Pavlovian wound inflicted by the state of our industry. Find a little piece of nostalgia? Dockerize it!

Re: Serverless QBasic

#13
post #6

> While Microsoft did have a compiler for the language, I couldn’t easily find a version of it online. I have archived the QuickBASIC 4.5 compiler here: https://github.com/susam/dosage/tree/master/langs/qb45 The above archive is obtained from here: https://www.qbasic.net/en/qbasic-downloads/compiler/qbasic-c...

http://www.antonis.de/qbdown/qbcompil.htm

I see a few problems in the QuickBasic 4.5 (English) distribution available at antonis.de.

- The BRUN45.EXE file in QB_4_5_E.ZIP is the German version one whereas the other files in this ZIP are the English version ones.

- The original directory layout of QuickBasic 4.5 (INC/, HLP/, LIB/) is missing although all the important content from those directories are preserved in the top-level directory.

- The content of the INC/EXAMPLES/ directory is missing too.

The original distribution is much better preserved at the www.qbasic.net URL I shared earlier. It also contains the English version of QBasic 1.1 interpreter.

Re: Serverless QBasic

#14
post #6

> While Microsoft did have a compiler for the language, I couldn’t easily find a version of it online. I have archived the QuickBASIC 4.5 compiler here: https://github.com/susam/dosage/tree/master/langs/qb45 The above archive is obtained from here: https://www.qbasic.net/en/qbasic-downloads/compiler/qbasic-c...

Thanks, this is great!

Re: Serverless QBasic

#15
post #3

Thanks for this fun article :) I noticed your serverless function response time is between 2000 to 3000ms, I wonder why and it would be super interesting to have more details about time taken by each step of the process (python proxy / dosbox / qbasic / openwhisk) Point of comparison, nodejs function executed on AWS Lambda: https://00demo-32387b.appdrag.com/api/Morse?txt=SOS-Test

Thank you!

On a "warm" invocation, almost all the time goes into DOSBox + QBasic.

Not precise measurements but: on my MacBook Pro, running the QBasic interpreter from within DOSBox consistently takes about 1.5 seconds & running DOSBox + QBasic from the shell in "headless" mode takes about 2.4 seconds.

OpenWhisk also gives me the logs of the invocations, which include debug lines produced by DOSBox, and from the timestamps in those I can tell that invocations do typically spend >2s running DOSBox.

Re: Serverless QBasic

#16
post #4

Fun article! I've gotta give this a try myself. On a related note (of using BASIC where it doesn't belong), I hacked together a method to convert BASIC code to WebAssembly using BaCon[0], a BASIC-to-C converter, and Emscripten to take the resulting C output and generate some wasm.[1] Much like the linked article, this is a fun diversion to entertain the idea of using BASIC where the language authors couldn't possibly…

This is really interesting, thank you! I've been working the last couple of days on getting an old type-in game working and I had some vague thoughts about it being fun to somehow make it playable on the web. I'd have to convert it from Microsoft BASIC to the dialect BaCon uses, but that's definitely an option. Another option I've considered is to see about getting cbmbasic[0] running using a JS terminal emulator. An…

It is my understanding that QB64 [1] compiles through C++, although I haven't tried it myself. They in theory support a superset of QBasic, and you could compile the C++ generated files using emscripten (again, in theory).

[1] https://en.wikipedia.org/wiki/QB64

Re: Serverless QBasic

#17
post #10

The suggestion to "use SYSTEM instead of END" is suspicious. SYSTEM spawns the system shell as a sub-process. If one would EXIT from the spawned command.com/cmd.exe, QBASIC would pop up back. I think a user of programs written in this way would find themselves surprised.

It was definitely a little confusing, as there seems to be many ways of exiting. From the QBasic docs in the IDE:

END: Ends a program, procedure, block, or user-defined data type. [...] If no argument is supplied, END ends the program and closes all files.

STOP: Halts a program.

SYSTEM: Closes all open files and returns control to the operating system.

You may be thinking of:

SHELL: Suspends execution of a Basic program to run a DOS command or batch file.

Re: Serverless QBasic

#18
This is very cool. I've often wished I could return to my roots of simply programming, and not being a server admin and dba. Am I the only who wishes we could deploy things like BASIC applications to a runtime in the cloud and be done with all these layers of abstraction and incidental complexity?
Post reply on HN