twinBASIC Update: September 10, 2023

Highlights include a global search IDE addin sample, addin extensibility access to the filesystem, and a discussion about inheritance in twinBASIC.

twinBASIC Update: September 10, 2023

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

Global Search Add-in Sample

Wayne added another twinBASIC IDE sample add-in, demonstrating a "Find in Files" proof of concept.  Here's his announcement on Discord:

BETA 389, Sample 15... soon to be the replacement for the builtin find in files feature
The exposed filesystem is currently limited to read-only support.  Once write-support is available, global-replace will be easy to implement.

It should be relatively easy to modify the sample to add things like search history and regex support.  I only mention it in case anybody fancies taking over 😉

Discord Chat Summary

* Auto-generated via Claude-2-100k on poe.com

Here are some key highlights from the attached Discord conversation about the programming language twinBASIC:

  • twinBASIC is a new BASIC language that aims for high compatibility with Visual Basic 6 while adding many modern features. It can compile natively to 64-bit.
  • Recent development work has focused on extensibility features like add-ins to allow extending the IDE, with plans for a test explorer add-in.
  • Major upcoming work includes finishing multi-document interface (MDI) form support and printer support to reach full VB6 compatibility.
  • There was discussion around COM object creation syntax, with agreement that implicit typing like C# for declared variables would be useful.
  • Issues were raised and addressed around DLL loading, filesystem object creation, textbox limits, and control naming when copying/pasting.
  • Community members are building projects with twinBASIC like UI for machine learning apps and finding solutions to problems by leveraging VB6 documentation.
  • There is interest in expanding OOP features like inheritance further, but also desire to keep the language simple. The current partial inheritance model was explained.

[Followup prompt]: What are the limitations of the current partial inheritance model in twinBASIC?

Based on the conversation, it seems the current inheritance model in twinBASIC has the following limitations:

  • It only supports single inheritance, not multiple inheritance. Only one base class can be specified.
  • It is described as "partial" inheritance, suggesting not all inheritance features are implemented yet.
  • It allows inheriting methods/properties using the Implements keyword, but details were not provided on inheriting other member types like events.
  • The example provided shows inheriting a method, but limitations around inheriting different member access levels (public vs private) were not discussed.
  • It's unclear if polymorphism and overriding of inherited methods is supported.
  • No details were provided about inheritance of interfaces or abstract classes.
  • There was no discussion about inheritance of class initialization behavior.

So in summary, the current inheritance support appears to be relatively basic compared to VB.NET or other OOP languages. The conversations indicate full OOP features are not a priority for twinBASIC compared to compatibility and simplicity. More advanced inheritance capabilities may come in the future.

Around the Web

Nothing new this week.

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 IDE Functionality:

  • Intellisense and hover now include enumeration names for better context.
  • Auto-indentation enhancements for existing code blocks.
  • Syntax highlighting and goto definition now work more reliably for constant expressions.

Enhanced Addin Extensibility:

  • Added capabilities for accessing the project filesystem, including read-only access initially.
  • Introduced properties like Host.FileSystem (with RootFolder and ResolvePath methods) and Host.CurrentProject.RootFolder.
  • Demonstrated usage through Sample 15 "twinBASIC IDE Addin (GlobalSearch)".

Compiler Optimization:

  • Improved detection of illegal array value assignments at an earlier stage in the compilation process.

Fixed Compiler Issues:

  • Resolved problems related to global variables causing complications in compiled EXEs.
  • Addressed TypeName() issue with tb-implemented Collection objects when called from external sources like VBA.
  • Rectified class static variable allocation problem, which had been causing various issues.

Addon for Accessing Projects:

  • Added capability to open projects directly with Host.ActiveEditors.Open(path, lineNumber, columnNumber).

Additional Fixes and Tweaks:

  • DirListBox now handles path elements correctly in its members.
  • Resolved a regression issue with built console applications containing debugger messages.
  • Improved import from VBP, now allowing for malformed VBP files with incorrect linefeeds.

WARNING: The following issue is present in BETA builds 202 - 3xx (the latest build as of publication):

  • there are known memory leaks in these versions, so memory usage will be higher than normal

BETA 386

  • fixed: (regression) packages that rely on global variables could cause issues in compiled EXEs due to linker bug [ https://github.com//issues/1673 ]
  • fixed: TypeName() of tb-implemented Collection object returns 'Object' from external callers such as VBA [ https://github.com//issues/1661 ]

BETA 387

  • improved: (IDE) intellisense/hover involving enumeration values now includes the enumeration name in the qualifier [ https://github.com//issues/1649 ]
  • fixed: (IDE) syntax highlighting and goto definition not working in some cases for constant expressions [ https://github.com//issues/1647 ]
  • improved: (IDE) some auto-indent improvements for pre-existing blocks [ https://github.com//issues/1648 ]
  • fixed: DirListBox was including the path elements in members such as List()/ListIndex etc [ nextKast, discord ]

BETA 388

  • fixed: compiler now detects illegal array value assignments earlier in the compilation process [ Gary Miller, discord ]
  • fixed: (regression) spurious Int3Breakpoint call inside the ActiveXExtender class, causing hard crash of some AX controls when no native debugger attached
  • fixed: (regression since BETA 385) class static variables not allocated properly, causing lots of issues (particularly in VBCCR package)

BETA 389

  • added: (addin extensibility) Host.ActiveEditors.Open(path, lineNumber, columnNumber)
  • added: (addin extensibility) access to the project filesystem (readonly initially)
  • added: (addin extensibility) Host.FileSystem property (exposing RootFolder and ResolvePath methods)
  • added: (addin extensibility) Host.CurrentProject.RootFolder property
  • added: Sample 15 "twinBASIC IDE Addin (GlobalSearch)", demonstrating how to use the filesystem methods of the addin extensibility model

BETA 390

  • fixed: (regression) built EXEs that are console applications could contain debugger messages printed to stdout [ https://github.com//issues/1679 ]
  • fixed: accessing form positional properties was not triggering full load of form [ fafalone, discord ]
  • improved: import from VBP now allows for malformed VBP with invalid linefeeds (\n instead of \r\n)

All original code samples by Mike Wolfe are licensed under CC BY 4.0