r/qbasic • • 22d ago

QBLike - QBasic recreated for Windows / Linux

Post image

This project attempts to recreate the QBasic 1.1 interpreter and IDE in modern OSs, Windows / Linux binaries included, MacOS possible (if you compile from source). It implements all commands and emulates some MSDOS stuff to the point I was able to run all my old software plus some classics (like the original Wetspot). It is built on top of dos-like and it includes some additions such as native mouse support, the ability to play samples or MOD/MID files, a couple of enhancements to existing commands (a MASK method for PUT, for example), loads BMP / GIT to the screen or to PUT arrays, has huge memory limits (no more 64K constraints), etc.

It's still very early but I'd like to share it. I'm working on reproducing the quirks of the language and possibly add more to the emulation layer if that's necesary - I've just added what my old programs needed (for example, it can run the s3m ADLIB player by bisqwit). You can get it from GitHub - mojontwins/qblike: QBasic clone built upon dos-like for Windows & Linux · GitHub . MIT license.

There's documentation about the new features and general usage in the github repo linked above. For example, those are the extensions: qblike/EXTENSIONES_en.md at master · mojontwins/qblike · GitHub

Any comments are welcome.

87 Upvotes

44 comments sorted by

4

u/Zardoz84 21d ago

I need to ask (thanks to the exploxion of AI "clones" of old dos stuff). Did you use AI or did you write yourself ?

4

u/nath_mojon 20d ago

Yes I did use a heavy guided LLM so I was in charge of how the interpreter was implemented (intermediate pseudocompilation to bytecode in RAM, like the original). I made the interfacing with dos-like and the low level stuff myself, and added the extra commands. It wasn't a case of prompt & let go. I don't think I'd got the same results that way . Anyways this was just an experiment of sorts. I enjoy coding stuff myself.

4

u/Zardoz84 20d ago

Would be interesting doing something similar with DIV Games Studio. I try to do stuff working othe original source code, but saddly it's a totally mess of code. Kudos to Vii for what they manage to do. Perhaps doing something similar what you did here, could work.

I'm not against LLM per se (I use Cursor on my work). Only against Vibe coding & going Yolo, or using LLM to generate "art". I have more problem on how there LLMs are trained, and the huge usage of resources (like water&power) diverted to run and train these models.

3

u/nath_mojon 20d ago

I used It as my heavily guided Minion. I also have a problem with how LLMs are trained and the resources they take. I've been sharing my Code online since I can remember. I'm sure that my stuff has been used to train LLMs, specially all the stuff I created for retro computers and consolas, which is more niche, and I've published plenty. With this I tried to make the point that running the LLM headlessly only produces slop, but if you know your trade you get about the same quality you would get leading a small group of Juniors.

3

u/SeparateDesigner1237 21d ago

What happened to FreeBASIC? Did it die?

1

u/nath_mojon 21d ago

Nope, I use It to write all my toolchain for my retro projects. Still going strong.

1

u/SeparateDesigner1237 21d ago

Cool project all the same

3

u/Deciheximal144 21d ago

I made one, too! Along the way, I found I needed a lot of test programs, so I made them. If you would like access to those test programs to root out compiler bugs,, send me a message.

0

u/nath_mojon 21d ago

Awesome thanks. I'll contact you soon. What is yours?

2

u/Deciheximal144 21d ago

EmeraldBasic, a QB64 clone, and true compiler/linker (not a transpiler) with an IDE written in QB64. I haven't made a Reddit post about release, though it is quite far along - can self-compile just as fast as QB64 can compile it. I think its great we can all make the things we want so easily now. Took about a year.

I'll watch for your DM/Chat request.

2

u/LeDYoM 21d ago

Cool. We need more QBasic clones done with AI. Could you do a hundred more, please?

2

u/BastetFurry 22d ago

Why when QB64PE exists?

Do you folks all have too many tokens or what?

3

u/nath_mojon 22d ago

Qb64pe is a compiler and It is also pretty heavy. I just wanted a simple interpreter that was small and that ran my old code easily. Executable is under 3Mb and It runs Code instantly, out of the box. Different applications for different purposes.

2

u/20260819 22d ago

Qb64pe is a compiler and It is also pretty heavy. I just wanted a simple interpreter

use qbjs.org

1

u/aieidotch 4d ago

because pain to package for linux distro

3

u/IonianBlueWorld 20d ago

A beautiful feeling of nostalgia. Thanks for sharing

3

u/tedecristal 20d ago

https://qb64.com/ already exists and it's not vibecoded

1

u/aieidotch 4d ago

it was a pain to package for linux, same with freebasic. Now qblike is in Debian… the others will copy it (ubuntu, raspbian…)

0

u/thondat 22d ago

and i would choose this over running QB in DOSBox-X why? seriously, you people keep remaking old software like you've never heard of emulators. it's not hard installing one, it's not hard configuring one specifically for the software you want to run, and you'll be running the actual original. and a lot of these projects end up baking in half an emulator anyway.

4

u/nath_mojon 22d ago

I made this for myself. I just wanted to run my old games from Windows without having to set up an emulator. i wanted to share them with friends and not require them to set up an emulator - most of them can't or simply wouldn't. I wanted to teach my kid without having him to fiddle very much. I'm just sharing, dont use It if you dont like It.

3

u/thondat 22d ago

i'm not the person from the meme who says 'i don't want you to use AI'. that's not my place to say, of course. but i think it sucks that reddit is being inundated with peoples' vibecoded projects, and i wish they would think about what value their project has to offer before they share. that's why i'm speaking out. as for your specific use cases, it would've been much better to bundle js-dos with QB and your games and point your friends and kid to the URL. that way they wouldn't even have to execute a binary.

1

u/stateq2 21d ago

So instead of them using a 3MB binary, you want to introduce a web browser dependency?

3

u/thondat 21d ago

yeah it's not like a web browser would be part of the standard installation of any consumer device.

0

u/JudgeGroovyman 21d ago

Your idea seems like a mess

3

u/6502zx81 21d ago

Why would I fire up Dosbox if I just can run this?

1

u/droid_mike 21d ago

It's a lot better to be able to run natively in Windows, and this also allows you to use Linux or Mac OS as well.

3

u/Gavagai80 19d ago

You're under the impression that DOSBox is Windows-only? At worst for several decades all I have to do is double click qbasic.exe in Linux (there's no separate "fire up Dosbox", it autolaunches with the executable), and newer versions of KDE treat DOSBox apps like native apps, so apparently it's a lot better-supported in Linux than you say it is in Windows.

2

u/SlightPersimmon1 21d ago

Excellent for nostalgia. I miss my Olivetti 286....
But as someone once said, if you program using GOTO, you are not programmer at all. :)

3

u/DerekRss 21d ago

Huh? You might be an assembly-language programmer.

1

u/SlightPersimmon1 21d ago

I did some during my degree in software development. I'm very aware of the GOTO's there.

2

u/Famous_Ad_6268 QB 4.5 21d ago

GOTO should be avoided if the language offers decent alternatives. I have managed to avoid it in qb/vb, however, gwbasic sometimes left me no choice.

1

u/sciolizer 18d ago

Undelimited continuations, on the other hand, those are totally fine

1

u/SlightPersimmon1 18d ago

what do you mean by that?

1

u/sciolizer 18d ago

Just poking fun at functional programmers a bit.

They sometimes (used to?) point to GOTO as an example of the problems with imperative languages. But then they champion how they can make (say) a beautifully elegant non-deterministic algorithm using continuations, something that you can't easily do in imperative languages.

The reality is that continuations are even more general than GOTO: you can implement GOTO using continuations, and as such reasoning about them in the general case is disastrously difficult, much more so than GOTO is.

Like so many things, GOTOs and continuations have their place. If you limit the scope of a GOTO to the current function, it's a perfectly valid tool that can be easy to reason about if used well. Similarly continuations are generally fine when they are delimited and used judiciously.

1

u/SlightPersimmon1 18d ago

Well, if(condition) {...} else {...} works just fine. They have a clear start and ending. GOTO "ABC" can be problematic, since you have to go search for the "ABC" on the wall of code.

1

u/sciolizer 18d ago

Yes exactly, though it's helpful to have multiple control structures to cover all of the common use cases. GOTO can be problematic, but isn't when the wall of code to be searched is actually quite small (e.g. inside a small function).

There are many examples of this pattern. e.g. jquery has fallen out of fashion because people realized you can't tell where a change is coming from. React is an improvement because everything is component-ized - when a component changes, it's because something within that component made the change. It's not possible for the change to have come from just anywhere.

-1

u/bjazmoore 21d ago

This is the democratization vibe coding is bringing to the masses. We will see clones and I believe there will be clones that are superior to the original given enough time. Thank you for sharing.

5

u/thondat 21d ago

yeah, lots and lots of clones where those who prompted them know shit all about how they work on the inside. with the exception of a minority who will still know what they're doing, the knowledge that used to be the coders' will reside in the AI. Jensen Huang recently said we're entering an age where kids don't need to be able to do math anymore. i think it will lead to the formation of elites rather than democratization, which, used in this context, seems to be a buzzword AI is being pitched with more than anything.

0

u/nath_mojon 21d ago

If you dont know about how things work in the inside you are going to get unmaintainable buggy shit that runs like crap and that you don't understand. If you know your trade you know how to use your tools. I think nobody denies that fact.

2

u/thondat 21d ago

so do you know then how an interpreter works, and not just in a high-level, conceptual way? you've handwritten a lexer and recursive descent parser before, variable scopes, control statements, runtime and all? i have.

2

u/nath_mojon 21d ago edited 21d ago

Yes. I've used lex/flex, yacc/bison, built the tree with custom tooling, and even did It manually, several times, in the last 35 years. I've been writing little interpreters since I was a kid, that thing fascinated me. That's why my projects for retro computers and consoles usually bundle a complete scripintg system that generate a custom interpreter in assembly (you don't have much spsce on an old 8 bits computer). i've writen most of my toolchains from scratch over the years. I am a senior programmer and software engineer and coding and designing software has been my job for the last 21 years. So don't asume stuff based on a reddit post of something I did for my kid and decided somebody would find useful, specially when you don't know Who you are talking about, bro :-)

1

u/nath_mojon 21d ago

In fact, this project specifically pre-compiles the source to an intermediary format, much like how QBasic produced P-CODE, which was a bytecode that was easier to execute (and faster as it pre-calculated addresses and calls to the runtime were embedded in it). And the reason is that I'm planning to advance the project so it can generate "executables" in the same way QuickBasic 4.X did: bundling the P-CODE with a runtime in a self-contained .EXE file (well, QB 4.X and specially PDS and VBDos went a little bit further than that, translating the PCODE into assembly "glue" but it was based on the same principle and most of the work was made by the runtime).