twinBASIC Update: December 17, 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

Pending Release Update

Here's the latest from Wayne:

I prefer not to provide another uncertain release date, as determining the exact timeframe is incredibly challenging, and it is frustrating for both parties when a deadline is missed. Releasing too early risks backlash from regressions, and I’m committed to ensuring it’s truly ready before launch. While it won’t be much longer, I kindly ask for a bit more patience.

In the meantime, to give you a taste of what’s coming, here’s the latest list of release notes:

[Editor's Note: See "Pending Changelog" section below for full detailed list of release notes. What follows here is an AI-generated summary of the highlights.]

AI-Generated Changelog Summary

* Auto-generated via Claude-3.5-Sonnet, sorted in order of its opinion of "most impactful changes."

Here's a concise summary of the notable twinBASIC updates:

  • Runtime & Performance Improvements

    • Added new 'Codegen Model' project setting with optimizations reducing output size by 5-20%
    • Enhanced control over executable size with options to disable PNG support and strip PE file relocation symbols
    • Improved form/UserControl/ActiveX behaviors to better match VB6/VBA compatibility
  • Development Experience

    • Added support for Markdown preview and improved form designer with live-backed forms
    • Introduced [Debuggable] attribute and project setting to control debugging granularity
    • Enhanced IDE features including remembered Win32/Win64 target architecture and better package reference management
  • Security & Deployment

    • Added ASLR (Address Space Layout Randomization) support with configurable settings
    • Improved DLL compatibility for Windows 7/8 systems
    • Added customizable PE File Image Base Address option for EXE/DLL files
  • Bug Fixes & Compatibility

    • Fixed critical issues with array handling, type conversions, and ByRef Variant parameters
    • Improved regional settings compliance for string-to-numeric conversions
    • Enhanced ActiveX control support and initialization error handling

Remember, the above release notes refer to an as-yet-unreleased BETA version of twinBASIC. Wayne rarely goes this long between BETA releases, so he is providing them to demonstrate ongoing progress behind the scenes, even if it's not visible in the form of new releases.

twinBASIC Long-Term Viability Update

From Wayne in Discord:

I know some of you have had concerns about the long-term viability of twinBASIC. With the end of the year fast approaching, I want to share a small but significant milestone regarding the VIP Gold license program.

When I introduced this special license at the start of the year, it was largely a speculative venture. My hope was that a few customers might be willing to invest in twinBASIC’s future, with the possibility of reaping the rewards later on. The price tag was carefully chosen to balance the long-term sustainability of the project against the need for short-term funding to keep development alive and progressing.

At the time, I set modest expectations for this program, with a medium-term goal of attracting 5-10 VIP Gold customers. This week, I’m delighted to share that we are now onboarding our 6th VIP Gold customer!

The support from this community, both financially and in general, continues to exceed my expectations. Your belief in the project and your encouragement have been invaluable.

Thank you all for being part of this journey and for helping to ensure that twinBASIC has a bright future ahead.

Discord Chat Summary

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

Overview

The week saw significant discussions around Excel XLL development, progress on major projects like XYplorer's potential port to twinBASIC, and important project sustainability updates. Community engagement remained high with detailed technical discussions and notable milestones in both development and business aspects of the project.

Excel Integration Development

  • Detailed troubleshooting of Excel12v function implementation, with community members collaborating on XLOPER12 handling and memory management
  • @fafalone demonstrated progress on Excel XLL UDF functionality, sharing a preview of working Excel functions
  • @gromrgb provided corrected implementations for Excel12v and XLOPER12 string handling, improving XLL development capabilities

Major Project Developments

  • XYplorer file manager (previously VB6) team announced they are evaluating twinBASIC for migration, with initial testing showing promising results
  • Initial performance testing shows current twinBASIC builds about 10% slower than VB6 native code, with @waynephillipsea confirming LLVM optimization will significantly improve this
  • @waynephillipsea shared extensive upcoming release notes, though declined to provide specific release date to ensure quality

Business & Community Updates

  • Project reached significant milestone with 6th VIP Gold license customer, exceeding initial program expectations
  • @waynephillipsea provided reassurance about project's long-term viability and ongoing development progress
  • Community members actively helping each other with migration strategies and API modernization approaches

Technical Discussions & Improvements

  • Discussion of API migration strategies for 64-bit compatibility, with recommendations for using WinDevLib
  • Identification of compiler warning improvements needed for delegate return type specification
  • Exploration of ActiveX library naming and build process challenges

Conclusion

The week demonstrated strong progress across multiple fronts, from core development to community adoption. The successful VIP Gold license program and potential adoption by major projects like XYplorer indicate growing confidence in twinBASIC's future. While the community eagerly awaits the next release, the focus remains on ensuring quality and stability over rushing to meet artificial deadlines.

Around the Web

XYplorer Project Mulling twinBASIC Migration

XYplorer could soon join the ranks of complex VB6 projects migrated to twinBASIC, alongside the popular iGrid ActiveX control from 10Tec and the open-source PhotoShop-like VB6 project, PhotoDemon.

From the XYplorer website:

XYplorer is a file manager for Windows. It features tabbed browsing, a powerful file search, a versatile preview, a highly customizable interface, an optional dual pane, and many unique ways to efficiently automate repetitive tasks. It’s fast, light and portable.
The XYplorer project is kicking the tires on twinBASIC. I predict we'll see a "Built with tB" sticker on XYplorer shortly after twinBASIC implements LLVM optimization.

tB XLL UDF Proof of Concept: Part 2

From fafalone in Discord:

This is a more useful followup to my initial proof-of-concept for creating an XLL Addin using twinBASIC, which is backwards compatible with the VB6/VBA7 language.

This demo shows how to create User-Defined Functions (UDFs), Excel functions capable of very high performance because they directly execute native compiled code, which is much faster than VBA P-code. Like the event handlers, UDFs are simply functions exported from our XLL, which is a renamed Standard DLL.

I've done some initial work to make XLLs more accessible, creating wrappers to create and retrieve data from XLOPER12 types. ExcelSDK.twin is portable and meant to be reused in new XLL projects, I'll probably turn it into a package when there's more wrappers to simplify things.
GitHub - fafalone/TBXLLUDF: twinBASIC XLL UDF Addin Example
twinBASIC XLL UDF Addin Example. Contribute to fafalone/TBXLLUDF development by creating an account on GitHub.

Pending Changelog

  • 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
  • fixed: DragIcon property sheet ellipses button now opens the Icon file browser, rather than generic picture file browser
  • improved: single-click inside a selected CheckBox/CheckMark/OptionButton in the form designer will now toggle the Value of the control
  • improved: VisualStyles control properties are now updatable at runtime
  • fixed: changing PictureBox.Appearance property at runtime would have no effect
  • fixed: setting property ProgressBar.Step would be ineffective (Native Common Controls)
  • fixed: some general issues with Label.AutoSize behaviours not perfectly matching VBx
  • fixed: Form.MinButton / MaxButton property ignored when Form.BorderStyle is vbFixedSingle [ VanGoghGaming, discord ]
  • added: [Debuggable(False)] attribute, defaults to True, allowing to turn off breakpoints/stepping support for a procedure or all procedures in a module/class
  • added: project setting 'Project: Debuggable', defaults to YES, allowing to turn off breakpoints/stepping for the whole project/package
  • improved: built-in packages now have the Debuggable setting set to NO to allow for easier step debugging in user projects
  • improved: some ActiveX control initialization errors are more gracefully handled by the form designer
  • fixed: issue with UDT return types being exposed in generated type-libraries [ VanGoghGaming, discord ]
  • fixed: issue with UDT containing other sub UDT members being exposed in generated type-libraries [ VanGoghGaming, discord ]
  • fixed: loading of form wit MDIClient property set to True could cause hard crash if there is no MDI Form in the project, rather than a trappable error
  • fixed: Err.Raise 0 should produce an invalid procedure call error, rather than a 'success' error message
  • fixed: changing breakpoints would not cause the project to be marked as dirty, so a further document edit was required to persist them [ Aaraya, vbforums ]
  • fixed: 'Use ActiveX Controls' property on COM references is now completely overriden (to FALSE) for MSAccess references which wrongly has FCONTROL flags set
  • improved: Sample 4 so that refering to CommandBars("Add-ins") menu now works regardless of user locale
  • added: [_HiddenModule].GetDeclaredTypeProgId(Of T) generic function for obtaining the stringified progID of a type
  • improved: Sample 4 and 5 to use GetDeclaredTypeProgId instead of a hardcoded string
  • fixed: IsMissing() returning False incorrectly when passed an empty ParamArray [ VanGoghGaming, discord ]
  • improved: added IDE setting 'Code Editor Font: Use Ligatures' (default FALSE) needed for some fonts [ Flowesans, discord ]
  • fixed: setting Timer.Interval to a negative value did not produce an error [ Krool, discord ]
  • fixed: linker bug causing 'Unable to load DLL' errors at DLL callsites on Win7/8 machines... sometimes [ HackerVlad, vbforums ]
  • fixed: some edge cases around ByRef Variant handling with regards to pass-thru arrays [ https://github.com/twinbasic/twinbasic/issues/1961 ]
  • fixed: hovering over a single-character operator in the code editor whilst in a debug session would throw an IDE error