twinBASIC Update: December 2, 2024

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 Monday week, 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, please leave a comment below.

Here are some links to get involved with the project:


Highlights

BETA Release Progress Update

Latest update from Wayne (as of 2 Dec 24):

I know the next release is highly anticipated. Please bear with me a little longer. It'll be worth the wait, I promise.

The workload from changing to live form designers has been significantly more than expected. This is a one-off cost for a big improvement in AX compatibility. We're getting there, just a little more patience needed.

To further reassure the community that progress really is being made, Wayne posted the in-progress release notes for the upcoming (unfinished) release. It's a looooong list, so I've published it at the bottom of the page where detailed release notes typically go (along with an AI summary if you just want the highlights).

Black Friday Sale on *PERPETUAL* twinBASIC Licenses (and vbWatchdog)

Message from Wayne in Discord:

Black friday time! Check out our black friday special offers on perpetual licences, available until 6th December only: https://twinbasic.com/BLACKFRIDAY (offers on twinBASIC and vbWatchdog)

If you're not ready to put down money on twinBASIC just yet, there's also a great deal on vbWatchdog all by itself:

This Black Friday/Cyber Week, get vbWatchdog Ultimate Edition (supports both VBA & VB6) for just £99 (regular price £290). That’s a massive 66% off! Don’t miss out!

https://twinbasic.com/blackfriday (OPTION 4)

If you've never heard of vbWatchdog, allow me to introduce you:

Error Handling Evolution
How you handle errors says a lot about you as a programmer. Most people evolve with experience in how they handle errors. From the most naïve to the most advanced, here is what that evolution looks like.

P.S. Now is probably a good time to remind you that I am not on the development team or payroll of the twinBASIC or vbWatchdog products. In the interest of full disclosure, Wayne has provided me with lifetime licenses to the ultimate edition of both products as a thank you for my DevCon Vienna presentations on twinBASIC. That said, I was a paying vbWatchdog user for years before Wayne gave me those licenses. I would not want to go back to writing VBA without vbWatchdog.

Discord Chat Summary

* Auto-generated via Claude-3.5-Sonnet-200k on poe.com

The past week in twinBASIC development has shown significant progress toward a major upcoming release, with improvements in ActiveX control compatibility and various bug fixes. The development team continues to refine features while the community explores new integration possibilities with Windows technologies.

Key Points:

  • A significant update is in progress that will introduce live-backed form designers, replacing isolated control rendering, which should resolve many ActiveX control compatibility issues, particularly with controls like SSTab.

  • The IsMissing() behavior for ParamArray parameters has been fixed to match VB6 functionality, addressing a compatibility issue reported by users.

  • WinRT OCR capabilities have been successfully demonstrated in twinBASIC, with community members sharing working examples and improvements over VB6 implementations using interface-driven approaches.

  • The development team announced that twinBASIC developer licenses will now support installation on up to 3 machines for Ultimate Edition users, up from the previous limit of 2.

  • A special Black Friday promotion was launched, offering significant discounts on perpetual licenses for both twinBASIC and vbWatchdog, running until December 6th.

  • The community reached a milestone of 700 members, showing growing interest in the platform.

The week's discussions highlight twinBASIC's continuing evolution toward better compatibility with existing VB6 and ActiveX technologies while introducing modern features. The upcoming release, though slightly delayed, promises significant improvements in ActiveX control support through the implementation of live form designers, demonstrating the team's commitment to both compatibility and advancement.

Around the Web

twinBASIC OCR Sample App

Over on vbforums, VanGoghGaming posted the following:

This project is a complete rewrite of its VB6 counterpart using the new tB features like type casting and interface definitions (also showcasing WinRT vector parsing, async operations and no more "DispCallFunc" atrocities).

The code is now much shorter and easy to read
[twinBASIC] - Simple OCR Text Recognition from a PictureBox Image-VBForums
This project is a complete rewrite of its VB6 counterpart using the new tB features like type casting and interface definitions (also showcasing WinRT vector parsing, async operations and no more “DispCallFunc” atrocities). :bigyello: The code is now much shorter and easy to read: Class cOCR Implements IAsyncOperationCompletedHandlerOcrResult Private OcrEngineStatics As IOcrEngineStatics, OcrEngine As IOcrEngine, SoftwareBitmapFactory As ISoftwareBitmapFactory, SoftwareBitmap As

The link above includes a link to download the source code.

To read more about the project from the twinBASIC perspective, check out the related post in the twinBASIC Discord server's show-and-tell channel: Simple OCR Text Recognition from a PictureBox Image.

ChatLLM in twinBASIC

Another thought-provoking proof of concept from fafalone:

Using libchatllm from tB

This is a simple app based on https://github.com/JohnClaw/chatllm.vb that showed a simple way to use libchatllm: https://github.com/foldl/chatllm.cpp. See those repos for more models, more information, etc.

For more info, check out the project's GitHub page:

GitHub - fafalone/ChatLLM-tB: Using ChatLLM from twinBASIC
Using ChatLLM from twinBASIC. Contribute to fafalone/ChatLLM-tB development by creating an account on GitHub.

Changelog

Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.

Releases · WaynePhillipsEA/twinbasic
Contribute to WaynePhillipsEA/twinbasic development by creating an account on GitHub.

No releases this week.

Pending Release Notes

As mentioned above, Wayne published a list of changes for the (unfinished) upcoming BETA release:

  • fixed: IDE evaluating custom class enumerator (NewEnum) for Locals/Watches panel during debugging could cause recursion problems
  • improved: many form/UserControl/ActiveX behaviours reworked to better match VBx
  • fixed: accessing array element of fixed-length array inside a UDT with bounds-checks OFF would ignore the lower bound index [ https://github.com/twinbasic/twinbasic/issues/1920 ]
  • added: project setting 'Codegen Model' for refining the generated code (size vs speed)
  • improved: codegen output size reduced (in all models) from previous builds ('Smaller' model ~20%, 'Balanced' ~10%, 'Faster' ~5%)
  • fixed: not all ByVal params should be copied in the implicit function prolog [ fafalone, discord ]
  • fixed: (regression) LLVM compilation not working on Sub routines
  • added: project setting 'Include Runtime PNG Support' (default YES), set to NO to reduce final built executable size
  • added: project setting 'Project: Strip PE File Relocation Symbols' (default YES for EXEs, NO for DLLs)
  • added: project setting 'Project: Enable Address Space Layout Randomization (ASLR)' (default YES)
  • added: project setting 'Project: PE File Image Base Address', allowing to override the EXE/DLL image base address
  • fixed: 'Trace procedure entry and exit points' project setting could cause floating point return values of standard module procedures to be set to zero on Win64 target
  • fixed: DIAGNOSTICS panel now hides the file (group) nodes when all of its children are hidden
  • improved: added IDE option 'Check referenced packages are up-to-date' default YES [ Krool, discord ]
  • improved: the IDE will now remember the Win32/Win64 target architecture for a project and restore the last used architecture when loading the project
  • fixed: some issues in importing some VBP projects, causing 'circular reference' compilation errors after import
  • added: error TB5246 'Bad JSON Syntax' for when a designer underlying JSON is not parsable (e.g. corruption or bad import)
  • added: error TB5247 'Unable to find matching form designer JSON' for when a class form designer is missing or wasn't parsed (rather than generic 'circular reference' error)
  • added: 'View as Markdown Preview' context menu option for .MD files in the IDE
  • improved: (VBP import) IMPORT_LOG is now a markdown file with better formatting
  • fixed: 'block not closed' compilation errors could sometimes prevent auto-correction of other lines, such as 'EndIf' -> 'End If' [ wqweto, discord ]
  • fixed: 'Ctl' suffix is now added appropriately to AX Control type library symbol names when LIBFLAG_FCONTROL is not set and 'Use ActiveX Controls' flag is set in project references
  • fixed: delegate defined as 'Sub' would cause a crash if you try to use the (void) value as part of an expression [ loquat, discord ]
  • fixed: if the icon of a built executable has changed, Windows should now update the icon cache immediately
  • added: project setting for 'Icon Form' to match VBx support for specifying the form icon to use as the EXE build icon
  • fixed: passing a LongPtr value to a function delegate parameter would cause a compilation error rather than a warning [ fafalone, discord ]
  • improved: runtime controls now use 'ThunderRT6' class prefix rather than 'Thunder' (e.g. ThunderRT6CommandButton) to match VBx
  • improved: now using a common base WNDPROC for all controls to match VBx
  • improved: position of IDE color picker when near the bottom edge of the IDE window [ sokinkeso, discord ]
  • improved: IDE form designer mini-toolbar now available for AX controls to allow opening of property sheets
  • fixed: (regression) clicking anywhere in the monaco editor whilst using the 'View As JSON' feature caused an IDE Internal Error
  • fixed: String to numeric type conversions could sometimes ignore regional settings, not matching VBx behaviour [ kimpos, email ]
  • improved: form-designer has been reworked to use live backed form designers, rather than isolated control rendering [ fixes lots of AX controls like SSTab ]
  • fixed: Controls.Add now works with AX controls

AI Changelog Summary

Generated by Claude-3.5-Sonnet.

Here's a concise summary of the notable twinBASIC updates [for the upcoming, as-yet-unfinished release}:

  • Enhanced Form Designer and ActiveX Support

    • Reworked form/UserControl/ActiveX behaviors to better match VB6/VBA
    • Implemented live-backed form designers, improving compatibility with ActiveX controls like SSTab
    • Added runtime controls using 'ThunderRT6' class prefix for VB6 compatibility
  • Performance and Size Optimizations

    • Added new 'Codegen Model' project setting to balance code size vs. speed
    • Reduced output code size (Smaller: ~20%, Balanced: ~10%, Faster: ~5%)
    • Added optional PNG support and PE file optimization settings
  • Project Configuration Improvements

    • Introduced project settings for ASLR and PE File Image Base Address
    • Added 'Icon Form' setting to match VB6 executable icon behavior
    • Enhanced VBP project import process with better markdown formatting
  • IDE Enhancements

    • Added Markdown preview support for .MD files
    • Improved form designer mini-toolbar for ActiveX controls
    • Enhanced regional settings compliance for string-to-numeric conversions