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:
- twinBASIC Installation Guide
- GitHub Issue Tracker (report bugs)
- twinBASIC Discord Server (chat about the project)
Form Designer Improvements
There were a bunch of developer quality of life improvements made to the twinBASIC form designer this week:
- Form designer supports [CTRL]-key for multi-select
- Color picker remembers the 8 most recently used colors in the custom palette
- SVG image support (requires Inkscape, installed separately)
- Unsaved changes in form designer are reflected when debugging/building
- Form designer context menu looks more like a traditional Windows context menu
New options added to the form context menu:
- "Lock all controls"
- "Unlock all controls"
- "Select all"
New options added to the selected control(s) context menu:
- "Lock controls"
- "Unlock controls"
- "Align to grid"
Around the Web
A Third Option for a twinBASIC IDE?
Currently, the only supported IDE for developing in twinBASIC is VSCode.
This approach made it easy for Wayne to focus on building a rock-solid compiler without having to worry about simultaneously building a development environment from scratch. VSCode has a robust ecosystem of extensions around it.
However, there are some downsides. The main issue is that the amount of customization available is limited. This was less of an issue in the beginning, when GUI design was not a consideration. The VSCode environment has also been met with criticism from VBx developers that were not already using VSCode for other work, as it's a major departure from the traditional VB6 IDE.
Several months ago, the long-term plans were updated to include a move to Theia, an open-source IDE forked from the VSCode project. Theia is basically a less-locked-down version of VSCode. Being a fork, it's generally several months behind VSCode in features, and there are likely VSCode extensions that won't run in Theia. On balance, the tradeoff seems worthwhile.
Of course, building the actual twinBASIC customizations on top of Theia will take time, too. Hence, the reason this is a long-term plan.
This week, though, Wayne played around with the idea of building a completely custom IDE using...twinBASIC itself.
The main editor pane would be a WebView2 container control (coming soon to twinBASIC) that would use the Monaco Editor as the code editor (i.e., the same editor used in VSCode). I should point out here that VSCode itself is written in Electron, which is basically just a wrapper around a standalone Chromium engine. In other words, VSCode is using this same approach of building an editor around a web viewer control.
I'll let Wayne explain the benefits of the approach (quoted from the twinBASIC Discord server):
The main benefit of this approach over VS Code is that we get absolute full control over the UI and all the plumbing. If we want toolbars... easy. If we want modal dialogs... no problem, etc. we gain full control over everything from the loading of the projects (e.g. not requiring a separate code-workspace file) right up to the UX.
Here's a quick mockup that Wayne put together:
Again, here's Wayne:
There'd be no chance of using existing extensions. But... with twinBASIC being the 'host' here, it would offer new opportunities, by allowing creation of extensions written in twinBASIC (rather than JS/TS).
I'd be interested to hear what extensions people here are using alongside twinBASIC in VS Code.
Shortly after writing up this section, Wayne posted a new discussion over on GitHub confirming that he will be moving in this direction in the near-term, with Theia support still planned at some point in the future (Theia itself is not quite capable enough to support twinBASIC at this time).
Here's the summary from Wayne's announcement:
To summarize, the plan is to now create a new, simple IDE built on cross-platform web-based technologies for our immediate needs. The VS Code extension will continue to be maintained and improved for those that want to use it that way. The long-term plan is to move to Theia, though we will probably keep the new 'simple' IDE available as it has significantly fewer system requirements.
Here are the updates from the past week. You can also find this information by installing the twinBASIC VS Code extension and clicking on the Changelog tab of the extension page:
[v0.14.36, 24th February 2022]
- fixed: unsaved changes in the form designer are now reflected immediately in the debugger and when building [ https://github.com/WaynePhillipsEA/twinbasic/issues/741 ]
- fixed: scollbar background color in form designer context menus was appearing as transparent since v0.14.35
[v0.14.35, 24th February 2022]
- improved: form designer also now handles CTRL key for multi-select, the same as VBx [ https://github.com/WaynePhillipsEA/twinbasic/issues/706#issuecomment-1047204224 ]
- improved: form designer now offers a
Lock All Controls/
Unlock all controlsoption in the form context-menu
- improved: form designer now offers a
Select alloption in the form context-menu
- improved: form designer now offers a
View codeoption in the form context-menu
- improved: form designer context menu now looks more like a traditional Windows context-menu
[v0.14.34, 24th February 2022]
- fixed: qualified datatype resolution was considering Private types during selection [ https://github.com/WaynePhillipsEA/twinbasic/issues/757 ]
- fixed: auto-implementation of friend members is now provided by invoking a runtime error to match VBx [ https://github.com/WaynePhillipsEA/twinbasic/issues/750 ]
- fixed: type-libraries with a default-value applied to void* types is now accepted by tB [ https://github.com/WaynePhillipsEA/twinbasic/issues/753 ]
- (WinNativeForms v0.0.18.0) refactored: WindowsAPI to temporarily avoid naming conflicts [ https://github.com/WaynePhillipsEA/twinbasic/issues/747 ]
[v0.14.33, 23rd February 2022]
- improved: form designer now supports SVG images, converting them to Windows EMF format using Inkscape (installed separately) [ https://github.com/WaynePhillipsEA/twinbasic/discussions/749#discussioncomment-2235024 ]
[v0.14.32, 23rd February 2022]
- improved: added a parser rule so that most root statement keywords must be followed by whitespace, otherwise don't treat as a statement keyword [ https://github.com/WaynePhillipsEA/twinbasic/issues/751 ]
- fixed: added stricter validation to generics
Ofkeyword to help backwards compatibility [ https://github.com/WaynePhillipsEA/twinbasic/issues/752 ]
- fixed: datatype suffix handling in cases where the expression is terminated with 'Then' / 'To' / etc [ https://github.com/WaynePhillipsEA/twinbasic/issues/754 ]
- fixed: successful UDT finalization within type libraries was dependant on the declaration order [ https://github.com/WaynePhillipsEA/twinbasic/issues/755 ]
[v0.14.31, 22nd February 2022]
- added: support for interface PropertyBag_VB5 [ https://github.com/WaynePhillipsEA/twinbasic/issues/745 ]
- improved: tweaked the spectrum.js color picker so that the custom selection palette (last 8 custom colors) is stored into the IDE settings [ https://github.com/WaynePhillipsEA/twinbasic/issues/748 ]
- added: (temporary) context menu on Windows colors in form designer, allowing to pick from the list of system colors
[v0.14.30, 22nd February 2022]
- added: implementation of PropertyBag (VB6-compat only, not PropertyBag_VB5) [ https://github.com/WaynePhillipsEA/twinbasic/issues/745 ]
[v0.14.29, 21st February 2022]
- added: 'Lock controls'/'Unlock controls' option in the context-menu of selected controls in the form designer. State is stored with the form metadata
- added: 'Align to grid' option in the context-menu of controls in the form designer