twinBASIC Update: March 3, 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, 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:


Highlights

Changes to DLL Redirection Warnings and Diagnostics Panel

Based on community feedback this week, Wayne made some notable improvements in how DLL redirection is communicated to users:

  • Warnings were added to indicate when VB6 DLL imports are automatically redirected to internal twinBASIC implementations. This helps avoid compatibility issues.
  • However, since no action is necessary for the redirection, the warnings will become "hints" in a future update. Hints are hidden by default to reduce noise.
  • Users can manually recategorize the Warning as a Hint or Info via the Compiler Warnings section of the Project Settings dialog.
  • The Problems panel was renamed to Diagnostics to encompass errors, warnings, hints, and informational messages.
  • This allows non-critical info like the DLL redirection hints to avoid cluttering the panel when hidden. Users can view hints if desired.

Here's Wayne's announcement in Discord:

I'm not planning moving hints/info level stuff to a build log or similar.  Let's keep it simple and just add another category, so we'll have errors/warnings/hints all in the problems panel, with the "hints" category being hidden in that panel by default unless you toggle it on (like you can currently toggle errors/warnings in there). In the code editor, yes there will be a much less distractive squiggle for the hints.

Keeping it all in the same diagnostics system allows for the dev to easily upgrade hints to warnings/errors etc if they so wish

Placeholders Added for Description Attribute

BETA 459 improved the versatility of the [Description()] attribute with the introduction of placeholders ${ProjectName} and ${ComponentName}.

These placeholders are automatically replaced with the actual name of the project and the component to which they are attached, respectively. This dynamic substitution facilitates better discoverability and self-documentation of ActiveX controls and other components within the development environment and when referenced in host applications, ensuring that their purpose and origin are clearly identifiable without requiring manual annotation.

You can see this feature in action in the ActiveX Control project, which was also updated in BETA 459:

[Description("${ProjectName}.${ComponentName}")]
Public Class myActiveXControl

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 development over the past week:

Introduction

The transcript covers continued progress on the twinBASIC programming language, focusing on bug fixes, new features, and discussions around compatibility with Visual Basic 6.

Key Points

  • Bug fixes:

    • Fixed issue opening old projects with error in Debug panel (#1706)
    • Enhanced native exception handling to provide more debug info on crashes
    • Fixed potential menu bar disappearing bug
    • Continued fixes for IDE stability and memory usage improvements
  • New features:

    • Added "hint" diagnostic level for non-critical information
    • LoadPicture now supports byte arrays for images without temp files
    • Enhanced error logging when compiler crashes to identify problem code
  • Compatibility:

    • Ongoing work on DLL redirection compatibility with VB6 imports
    • Discussed handling of VB6 form attribute GUIDs during import
    • Clarified date format issues in Properties editor as lacking VB6 compatibility currently
  • Other conversations:

    • Planned improvements for IDE add-ins support
    • Questions about twinBASIC's LLVM and documentation efforts
    • Queries on support status for specific 3rd party ActiveX controls

Conclusion

Good progress continues to be made, with the team laser focused on squashing bugs and enhancing compatibility with VB6, while also continuing to build out twinBASIC's unique capabilities. The discussions illustrate the project's commitment to becoming the ideal modern successor to VB6 for both new and existing projects.

Around the Web

Identifying twinBASIC's v1 "Blockers"

In the Ideas channel on Discord, Andrew Mansell made the following observation:

The first release of twinBASIC is critical. To use a cliche, you never get a second chance to make a first impression.

To my mind v1 needs to, at a minimum:

  • Be as far as possible compatible with VB6 x86. All reported compatibility bugs closed out, all VB6 syntax and intrinsic controls fully supported.
  • Allow x64 compilation, given appropriate work by the developer.
  • Only introduce language or compiler enhancements if they are 100% reliable.

Above all, v1 needs to be production-ready. Companies that ship VB6 products need to feel optimistic about switching to the new platform.

@WaynePhillipsEA, I'm sure you have a robust system for tracking all the v1 blockers. But as a community, we have limited visibility. Would it be worthwhile opening a v1 project on GitHub, and moving all v1 blocker issues into it?

This is complicated a little by Discord being an additional bug reporting channel. Perhaps v1 blockers should get promoted to GH issues unless they're trivially solved?

Wayne liked the idea and asked the community to begin identifying potential v1 blockers in GitHub:

Yes, I think this would be useful, and would offer a more focused view. To start, perhaps the community can help by adding a simple comment of "v1 blocker" to existing github issues that they feel are important to them, and then the mod team can add them to the a new "v1 project" on GH after review.

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.

ChatGPT Changelog Summary

* Auto-generated via ChatGPT, sorted in order of ChatGPT's opinion of "most impactful changes."

  • improved: Integration of modern programming features such as trace-mode for enhanced debugging, and the compiler's ability to promote services into trace-mode for better diagnostics.
  • added: Support for 64-bit through internal implementations replacing MSVBVM60 API calls, ensuring compatibility with legacy code while leveraging modern system architectures.
  • improved: Enhanced error reporting in the VB form importer and inclusion of form filenames to streamline issue resolution.
  • improved: Renaming the 'PROBLEMS' panel to 'DIAGNOSTICS' and adding support for HINTS and INFORMATION level diagnostics for a more accurate understanding of code issues.
  • fixed: Various regression issues, including problems with LLVM compilation, control array events, and design-time painting of ActiveX controls on host documents like Access forms.
  • fixed: User interface issues in the IDE, such as menu navigation, scrolling errors, and handling of virtual documents, for a smoother development experience.
  • improved: Semantic highlighting and warning systems, including the addition of warning codes when hovering over warnings and the ability to turn off specific warnings.

WARNING: The following issues are present in BETA builds 424 - 4xx (the latest build as of publication):

BETA 455

  • fixed: ActiveX control extender issue in RightToLeft implementation, causing a runtime error to be thrown inside the form designer in some instances [ vinicio, discord ]
  • fixed: some edge cases around IDE panel (re-)loading [ fafalone, discord ]
  • added: redirection of MSVBVM60 declares using API '__vbaRefVarAry' to an internal equivalent implementation, supporting 64-bit [ fafalone, discord ]
  • added: redirection of MSVBVM60 declares using API '__vbaAryMove' to an internal equivalent implementation, supporting 64-bit [ fafalone, discord ]
  • fixed: opening/closing projects quickly could trigger the crash-loop detector and the IDE would go into safe-mode [ fafalone, discord ]
  • fixed: (regression since BETA 424) LLVM compilation is now working again
  • fixed: (regression in BETA 454) code regions could auto-expand after edits in a document [ fafalone, discord ]

BETA 456

  • improved: added warning TB0015_DLLRedirection (hint in future) to indicate when auto DLL redirection has occured for MSVBVM60 and similar imports
  • fixed: Slider / DTPicker / MonthView / UpDown controls now have [DefaultMember] set appropriately [ https://github.com//issues/1791 ]
  • improved: VB form importer now includes the form filename in error reports [ https://github.com//issues/1790 ]
  • fixed: (regression since BETA 424) control array events Index argument always zero [ woeoio, discord ]
  • fixed: virtual documents (such as global find results) would be left open when closing the active project
  • fixed: clicking on an IDE sub-menu header would close the menu rather than triggering the sub-menu to expand
  • fixed: scrolling to the end of a document in the IDE could throw Uncaught errors in the debug console [ fafalone, discord ]
  • fixed: IDE uncaught error: 'IDE internal error: Uncaught TypeError: t is not a function' [ fafalone, discord ]
  • fixed: semantic highlighting issue for some cases of prop-lets going through default member accessors [ https://github.com//issues/1788 ]

BETA 457

  • improved: NATIVE EXCEPTION reports will now promote the compiler services into trace-mode
  • added: trace-mode for the compiler so that native exceptions provide extra debugging information in the debug console, see Help menu
  • fixed: TB0015 DLL-redirection warnings could not be turned off unlike all other warnings [ fafalone, discord ]
  • improved: 'PROBLEMS' panel now renamed 'DIAGNOSTICS' to better reflect the intended purpose
  • added: support for HINTS and INFORMATION level diagnostics
  • improved: hovering over a warning in the IDE will now include the TBXXXX warning code in the displayed information
  • fixed: (regression) opening a document in the IDE which contains no components (e.g. all commented out) could crash-restart the compiler

BETA 458

  • fixed: (regression since BETA 424) when tB generated ActiveX controls were placed on some host documents such as Access forms, at design-time a second copy of the form was being painted to the desktop [ commissioned work ]
  • fixed: "Not implemented" error shown when adding a tB generated ActiveX control to a MS Access Form in some instances [ commissioned work ]
  • fixed: (regression, x64 builds only) stack alignment bug in some instances during codegen causing some runtime instability [ commissioned work ]

BETA 459

  • fixed: (regression) form designer context menu 'ActiveX Properties...' was not working [ sokinkeso, discord ]
  • improved: [Description()] attribute for components now accepts placeholders ${ProjectName} and ${ComponentName} [ Tecman, discord ]
  • improved: the ActiveX Control project now has [Description("${ProjectName}.${ComponentName}")] set for the example control to help discovery in hosts