twinBASIC Update: November 26, 2023
Highlights include foundational work on the forthcoming Edit & Continue feature and a new wiki page documenting the twinBASIC compiler constants.
On April 23, 2021, I helped Wayne Phillips introduce the world to twinBASIC at the Access DevCon Vienna conference. I boldly predicted that twinBASIC (along with the Monaco editor) would replace VBA and its outdated development environment by 2025. With that goal in mind, this weekly update is my attempt to keep the project fresh in the minds of the VBA development community.
Every Sunday, I will be providing updates on the status of the project, linking to new articles discussing twinBASIC, and generally trying to increase engagement with the project. If you come across items that should be included here, tweet me @NoLongerSet or email me at mike at nolongerset dot com.
Here are some links to get involved with the project:
- Custom twinBASIC IDE Installation Guide
- GitHub Issue Tracker (report bugs)
- twinBASIC Discord Server (chat about the project)
- twinBASIC/VBx LinkedIn Group
Highlights
"Edit & Continue" Under Active Development
As you'll see below, there were no new official releases in the past week, but that doesn't necessarily mean Wayne took the week off. On the contrary, it seems he made major progress on a very technically challenging feature: Edit & Continue.
This is the feature in VBx that allows you to step through code, pause execution, edit the code being executed, then resume execution which will use the edited code. I know of very few other programming languages that support this feature outside of the Microsoft BASIC family (VB6, VBA, etc.). (If you know of others, please mention them in the comments below.)
Anyway, here is Wayne's announcement and feature preview from the twinBASIC Discord server:
Not the most exciting example of edit & continue, but figured it was time to share
We've gone from reparsing and recompiling the full project on every keystroke, to a much more refined compilation process in order for this to work. There's another week of work to get this more refined, but I'm pleased it's coming along nicely.
(full disclosure: I cheated a little in the above as I copy & pasted the- 458
, since the incremental compilation currently doesn't deal with compilation errors gracefully, and starting to type-
would have triggered a compilation error)
Discord Chat Summary
* Auto-generated via Claude-2-100k on poe.com
Here is a summary of the key points from the General channel transcript for twinBASIC:
Introduction
The General channel covers a wide range of discussions related to the development of the new twinBASIC programming language. Over the past week, conversations focused on new features being worked on, bug fixes, and comparisons between twinBASIC and other languages like VB6.
Summary
- Edit & continue is being implemented, which allows code to be edited during debugging without restarting. This requires more incremental compilation instead of full recompiles.
- Menus and shortcuts in the IDE still need more work before v1.0. Things like missing context menu items were noted.
- Holding down delete key to delete lots of text can cause crashes due to memory usage spiking if the buffer fills.
- String ptrs can substitute for UDTs but not for all APIs taking strings. This causes ambiguity errors.
- ReDim Preserve was found to not properly preserve bounds when using non-traditional negative LBounds. This is a bug.
- DirectComposition arrays deform if defined different than VB6 expects due to mismatch between C style [x][y] and VB style (x,y).
- Dropped support for Windows 7 in WebView2 means new features may not work on Win7 later. But binaries should continue supporting it.
- FindFirstFile has inconsistent matching on Win7 like returning filename.3 for search term filename3*. Seems fixed in newer Windows versions.
- Discussed pros/cons of continuing IDE support for Win7 as it loses mainstream support.
Conclusion
Good progress was made on big features like edit & continue while also fixing bugs and evaluating future platform support. Discussions highlighted differences between twinBASIC and VB6/other languages. Overall work continues on track towards the v1.0 release.
Around the Web
twinBASIC Compiler Constants Documented
Jon Johnson (aka, fafalone) created a new wiki page documenting the existing twinBASIC compiler constants.
Win16
Win32
Win64
VBA6
VBA7
MAC
TWINBASIC
Note that most of these are also VBx compiler constants, but TWINBASIC
is a newly-introduced compiler constant. This constant can be used to write twinBASIC-only code that takes advantage of new language features, while still maintaining support for VB6/VBA if needed via the #Else
clause.
Changelog
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
No new releases since last week.