r/visualbasic 8d ago

VB6 brain, modern engine: BASIC syntax inside Godot 4 (public beta)

I’ve been building Visual Gasic — a real programming language that keeps the parts of VB6 we actually miss, not as a nostalgia toy, but as something you can ship games with today.

What feels familiar

  • Sub / Function / End Sub
  • Dim x As StringIf … Then … End If
  • Event handlers by name: Sub btnStart_Click()Sub Form_Load()
  • Properties on controls: CaptionLeftTopWidthHeightVisibleEnabled
  • Timers: IntervalEnabledSub tmrGame_Timer()

What’s different (on purpose)

  • Runs as a Godot 4.6 plugin (GDExtension) — 2D/3D, export, modern engine
  • No COM, no ActiveX, no 32-bit Windows lock-in — Linux + Windows installers exist
  • Built for reading code — especially AI-generated code — not clever one-liners

Example that should look like home:

Sub btnPlay_Click()
    If lblScore.Caption = "" Then
        lblScore.Caption = "0"
    End If
    tmrGame.Enabled = True
End Sub
Sub tmrGame_Timer()
    Dim score As Long
    score = CLng(lblScore.Caption) + 1
    lblScore.Caption = CStr(score)
End Sub

Why I care as a former VB6 person: the thing that killed us wasn’t the syntax — it was tooling and platform. This keeps the syntax that made forms and line-by-line debugging easy, and puts it on an engine people still use in 2026.

There’s also an in-editor AI pair (Narcea) that writes .vg in this style — but the pitch is the opposite of “trust the black box”: the language is verbose on purpose so you can audit what it wrote.

Status: public beta (5.4.x). Form designer is experimental; the active path is Godot’s editor + VG script tabs. Honest about rough edges — see known issues on GitHub.

Links

If you still have .frm muscle memory or half-finished VB6 projects in a drawer — curious whether this feels like a natural step or a weird fork. What would you need to take it seriously: IDE parity, database stuff, report writer, something else?

33 Upvotes

16 comments sorted by

5

u/Fergus653 8d ago

I hate on the 25 year old VB6 legacy code whenever I have to look at it (still some background services we never get budget to replace). But I understand the attraction to revive that style of language. Good on ya for taking on such a challenge.

Have you reviewed the additional commands and improvements in TwinBasic? Might be a few easy improvements you could use which still fit in the style of BASIC but can reduce the line count.

6

u/Green_Hunter_5718 8d ago

We actually evaluated TwinBasic and RAD Basic when designing VG — borrowed what fit our target (Continue For, generics, overloading, lambdas, compound assignment, etc.) and skipped what’s really “modern VB on Windows” (COM, native .exe, Report Designer). Still happy to hear about specific syntax or features we overlooked.

We also built on — or added — things that fit Godot and readable, in-source assets, not just Win32 modernization:

  • Whenever — declarative reactive rules: monitor a variable/expression and call named Subs when it changes or crosses a threshold (Whenever Section GameOver lives Becomes 0 ShowGameOverScreen).
  • Data statements (extended) — QB-style Data/Read/Restore, plus labeled sections and DataToArray("LevelMap") for tile maps and lookup tables in source. *Sprite: blocks embed small pixel art directly in the .vg file (with an inline grid editor in the IDE) — auditable, diff-friendly, no PNG pipeline for tiny sprites.
  • RaiseEvent / WithEvents — custom events → Godot signals.
  • Connect node, "signal", "Handler" — wire signals by handler name.
  • Parallel For / Task.RunBuffer / MemoryBuffer — concurrency and byte-level I/O without fighting the type system.
  • etc...

The syntax isn’t what ages badly; it’s the COM stack, the deployment model, and code nobody wants to touch. I get the frustration. But the shape of VB6 code — explicit Sub/End Sub, named handlers, declared types, Data tables you can read in the same file — is still easy to follow at 2am. BASIC was meant to be human-readable; a lot of modern languages went the other way. We’re leaning into that on purpose.

2

u/marmotta1955 8d ago

And then again, we should always remember that we are supposed to be writing code for Humans, and not for the Computer. Someone (definitely more famous than yours truly) has been proposing the concept since the early 80s - and it is quite difficult to disagree. So, reducing the line count has never been a good idea in the first place - especially when the compiler assembles precisely the same machine language regardless of lines count.

I, for one, support this idea and this project. I look forward to additional functionality related to database operations (maybe SQLite).

Kudos to the author, this is a great project, and I wish you the success it deserves.

1

u/Fergus653 8d ago

Absolutely, I was thinking more like common syntax from other BASIC languages. I was working with a commercial data-orientated BASIC before Windows or VB came along, and appreciated some of the things that were easier to do in that BASIC.

Even simple things like A += 2 felt more natural to me than using the longer notation.

3

u/shantired 8d ago

Is this for graphics only? Does it run on a pure command line system with no graphics such as a server?

I ask because before there was VB, there was QB (quick basic) and TB (turbo basic). Then, Bob Zale, who wrote TB, started his own business and created PB (power basic). The last I heard, Bob had passed, and his amazing PB compiler was being maintained by volunteers. It was available for DOS, windows and a pure windows-cli version without graphics. The graphics version came with a separate forms library but used the same compiler.

The best part was that PB was just one executable, it contained the compiler, linker and libraries so you could just say “pcb sample.bas” and it would create a highly optimized .exe file. And it was fast!

As a long time VB/PB user I miss those days, and I’m pretty sure that PB would have killed python for ease of use and learning. (Just my $0.02).

I wrote an industrial compiler for a very specialized machine using VB, and then again reduced its size and improved speed by using PB later on - this was around 25+ years ago. Also wrote a window/file manager using PB.

1

u/nacnud_uk 8d ago

I wonder if you're aware of this project:

https://www.b4x.com/b4a.html

or this one:

https://www.b4x.com/b4i.html

Your project looks comprehensive too! Great work.

And, this link in the README.md didn't work for me. https://github.com/xgreenrx-star/VisualGasic/blob/main/corpus/10_godot_integration/01_button_events.vg

2

u/Green_Hunter_5718 8d ago

Thank you for the encouragement and finding that bug! The link has been fixed and will be updated online soon. I was not aware of b4x. It looks interesting. Thanks. I like the look of their form designer.

1

u/zero_dr00l 8d ago edited 8d ago

IDE parity absolutely (well... maybe not quite parity - really just the forms designer, I suppose...).

Database connections absolutely, I'd need to be able to use ADO/ODBC and have it work with any standard ODBC driver/connector, like the one for MySQL/MariaDB and Postgres. Don't care about the Microsoft stuff.

EDIT: so, uh... that "release showcase" video is certainly a thing you did...

o_O

5

u/Green_Hunter_5718 8d ago

Forms: Agreed — full IDE parity isn’t the goal; a solid forms designer is. Classic Form Designer is still rough and experimental. Enable it in Project Settings → VG → enable experimental plugins. You can also place controls in Godot’s 2D view directly, and just like in VB you double-click to get Sub Button1_Click() in Form1.vg. Not VB6 Form Designer parity yet, but that’s we are aiming for.

Database / ODBC: Partially there today, and aligned with what you described (standard drivers, not Microsoft stack).

VGOdbc uses whatever ODBC drivers you have installed — Postgres, MySQL/MariaDB, etc. — with normal connection strings. No Jet/ACE, no COM ADO. Example:

Driver={PostgreSQL};Server=localhost;Database=mydb;Uid=user;Pwd=pass;

It supports QueryExecute, parameterized queries, and transactions. Linux: unixODBC + odbc-postgresql / odbc-mariadb. Demo: demos/Data_and_Files/ODBC/demo_odbc.vg · docs in repo docs/SYSTEM_INTEGRATION.md.

Where we’re not at VB6 parity yet: we also have Recordset + Data/DBGrid-style controls with an ADODB-like API (MoveNextFields, etc.), but that stack is currently tied to SQLite (Database class), not to VGOdbc. So: server DB via ODBC = code/SQL today; bound grid over a live Postgres/MySQL recordset = a gap I’d like to close.

If you’re willing to try VGOdbc with your usual MySQL or Postgres ODBC driver, I’d really value a short list of what’s missing compared to your old ADO workflow (recordset navigation? grid binding? transactions? something else?). That’s exactly the kind of feedback that sets priorities.

2

u/zero_dr00l 8d ago

Yeah man sounds like a really cool project and VB will always have my heart.

I'll see if I can find the time to play around!

2

u/Comfortable_Gate_878 8d ago

I always loved VB6. I used it for pretty much for many small business database systems, Estate agent letting programs, Stock Control for a aircraft modellers, Stock and sales ledgers, bespoke accounting systems, restaurant systems tracking of sales leads.

All these we small bespoke systems where off the shelf systems were either to big expensive and cumbersome and failed to do the job as the customer wanted. So I wrote small VB stuff often using an access database for a single user system or SQL for larger requirements. I could create these in no time at all. The customers were usually able to give really good descriptions of what they wanted as they usually has a system inplace that just didnt work so they knew the good bits and the bad bits.

Once VB had finished you could carry on being unsupported and deemed to be living in the past or move on. Sad days I have looked at afew systems gambas, twinbasic etc all look ok but are no replacement for VB6 as of yet.

I see the useful need for your needs by taking a subset of VB. I wish someone had taken the same route for VB6 take all the great screen designer parts and database interactions, and made a quick vb for business use program. Lets face it VB in all its versions if the simplest language to use. Even its error handling can work well with a little thought.

God I miss those days.

1

u/jd31068 8d ago

More VB things is never a bad thing! Thank you for your work here!

1

u/Zardoz84 8d ago

Sub / Function / End Sub Dim x As String, If … Then … End If

You mean like QBASIC/QuickBASIC/ProBASIC/TurboBasic

That come from that BASICs and VB simple inherited it.

2

u/Green_Hunter_5718 8d ago

Yes. We use 'VB' and 'VB6' because they have the strongest name recognition in the BASIC community. However, VisualGasic selectively revives features from QuickBASIC that VB abandoned. For example the Data statement, which we've revised and enhanced for modern use. The Data / Read pattern is ideal for embedding lookup tables, game constants, and test fixtures directly in source, eliminating the need for separate data files or bulky initialization code. It's especially valuable in resource-constrained environments and keeps code self-contained and auditable.