twinBASIC Update: September 30, 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:
- Custom twinBASIC IDE Installation Guide
- twinBASIC Discord Server (chat about the project)
- twinBASIC Wiki (list of new features not in VBx)
- GitHub Issue Tracker (report bugs)
- twinBASIC/VBx LinkedIn Group
Highlights
Delegate Support and AddressOf
Improvements
For details, refer to the following GitHub issue: Invoke function by AddressOf Pointer.
Here is an AI-generated recap of the full discussion (via ChatGPT-4o-latest):
Here's a summary of the key points from the GitHub issue discussion on invoking functions by AddressOf Pointer in twinBASIC:
-
The initial request was for a VB-like syntax to invoke functions by pointer, similar to C/C++, as VB6/VBA lacks this capability natively.
-
The discussion evolved into a broader request for delegate support in twinBASIC.
-
Various syntax proposals were discussed, including:
- Using a "CallByAddressOf" keyword
- Adopting FreeBasic-like syntax for function pointers
- Implementing a delegate system similar to C#
-
Wayne Phillips (twinBASIC developer) confirmed that the plan is to implement delegates as typed function pointers, with backwards compatibility for coercing to LongPtr.
-
The community discussed the importance of type safety and the potential risks of implicit conversions.
-
In September 2024, Wayne announced the implementation of delegate syntax in BETA 616, with further refinements in BETA 617:
- Delegates are defined using the "Delegate" keyword
- AddressOf now returns a delegate type instead of LongPtr
- Compiler warnings help ensure type safety when using delegates
-
The new delegate system allows for more flexible and type-safe function pointer usage, while maintaining backwards compatibility through explicit type casting.
-
The community generally responded positively to the implementation, seeing it as a significant improvement in twinBASIC's capabilities for handling function pointers and callbacks.
This feature addition represents a major step forward in twinBASIC's development, bringing it closer to modern language capabilities while maintaining compatibility with VB6/VBA paradigms.
Compiler Constant Added: TWINBASIC_BUILD
The constant can be used to write code that compiles and runs in multiple versions of twinBASIC when using features introduced in newer builds.
#If TWINBASIC_BUILD >= 615 Then
'Use feature introduced in BETA 615
#ElseIf TWINBASIC_BUILD >= 610 Then
'Use feature introduced in BETA 610
#Else
'There's no point in checking TWINBASIC_BUILD numbers under 610
' since the constant itself did not exist yet
#End If
For more usage details and a list of all other available conditional compile constants, check out the official wiki documentation, which fafalone just updated: twinBASIC Compiler Constants.
Discord Chat Summary
* Auto-generated via Claude-3.5-Sonnet-200k on poe.com
Here's a summary of the key points from the twinBASIC Discord chat transcript for the General channel from September 24-30, 2024:
The past week saw exciting developments and discussions in the twinBASIC community, highlighting the language's progress and future prospects. Here are the key takeaways:
• Mike Wolfe, a key figure in twinBASIC development, will be presenting "twinBASIC: Past, Present, and Future" at the UKAUG Microsoft Access Conference at the University of Oxford on November 20th. This event may include a sneak peek of "twinBASIC for Applications."
• A new compiler constant, TWINBASIC_BUILD
, will be added in the next release to help developers with conditional compilation for supporting older versions. This will use the BETA number and continue to increase sequentially even after the BETA phase.
• The twinBASIC website has been updated with a new top section, featuring a more dynamic presentation of the language's features. Future plans include unique screenshots for each feature and an interactive scrolling mechanism.
• A significant discussion arose comparing twinBASIC to RADBasic, another VB6 successor project. The consensus among experienced users was that twinBASIC is far more advanced, with 615 public releases compared to RADBasic's limited availability and progress.
• New features in twinBASIC include improvements to the AddressOf functionality for class instance members and the introduction of delegate types, albeit with some current limitations.
• Users reported some issues with importing VB6 projects, particularly around UserControl fonts and resolver bugs. The twinBASIC team is actively working on addressing these concerns.
• There was discussion about potential future features for twinBASIC v2, including generic delegates and extension methods, which could enable LINQ-like functionality.
In conclusion, twinBASIC continues to make steady progress towards becoming a robust VB6 successor with modern features. The upcoming presentation at the UKAUG conference and ongoing development of new capabilities demonstrate the project's momentum. While some compatibility issues persist, the active community engagement and responsive development team suggest these will be addressed in future releases.
Around the Web
twinBASIC.com Gets a Facelift
The twinBASIC home page got some long-overdue TLC this past week.
The updated site includes a high-level overview of the project, a screenshot of the twinBASIC IDE, a link to the 12-month roadmap, and a list of the new features introduced in twinBASIC.
twinBASIC Roadmap Update
Wayne updated the twinBASIC roadmap this week.
Here are the highlights:
- v1 Target Release Date changed to 31 December 2024 (was 1 Oct 24)
- MDI Form support removed from roadmap (now complete)
- Missing IDE features (e.g., rename refactoring, test explorer, etc.) delayed until after version 1 release date
- All other pending features pushed back one quarter (e.g., 2024 Q4 -> 2025 Q1)
UKAUG Conference Announcement on Access World Forums
Rod Gordon, one of the hosts of the upcoming UK Access User Group conference at Oxford University, posted about the event on Access World Forums:
As a reminder, I'll be presenting the latest updates on twinBASIC–including the much-anticipated (English-speaking*) debut of twinBASIC for Applications. If you are an AWF member, please leave a comment to help boost the thread's visibility and generate interest in the event.
I look forward to seeing you there.
*twinBASIC for Applications (tBA) makes its world premiere a few weeks ahead of my UKAUG presentation, when Juanjo Luna presents the feature at Karl Donaubauer's German-speaking AEK Conference in Nuremberg, Germany, on October 19-20, 2024.
Changelog
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
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 updates in twinBASIC:
• Added experimental support for function pointer types using delegate syntax, improving type safety and flexibility when working with function pointers.
• Introduced the TWINBASIC_BUILD
conditional compiler constant, which evaluates to a Long containing the sequential build release number.
• Improved form designer experience with a semi-transparent minibar and better positioning when switching between code and form views.
• Fixed several issues related to control events, including Form and MDIForm Activate/Deactivate events now firing correctly to match VB6 behavior.
• Enhanced the DIAGNOSTICS panel with better organization, alphabetical sorting of file groupings, and improved usability for reviewing issues.
• Made various improvements to support twinBASIC for Applications (TBA), with a prototype now in private testing.
WARNING: The following issues are present in BETA builds 546 - 617 (the latest build as of publication):
- there are known memory leaks in these versions, so memory usage will be higher than normal
BETA 609
- fixed: Math.Oct() could cause crash in compiled applications on X64
- fixed: Eval("Date$()") would bind to Date() rather than Date$()
- improved: implicit conversion warnings now ignore missing arguments that get populated from default values, to prevent many unnecessary warnings with many MS Acces object model methods
- improved: TB0025 unused parameters not ignores interface memebr implementations and event handlers
- fixed: Input statement would fail at codegen stage when passed an enumeration value type [ axisdj, discord ]
- fixed: after being launched within the IDE, some projects would need a clean compiler restart before building to EXE/DLL to build properly
- improved: IDE project loading with multiple tab restoration is now smoother with less flickering
- improved: changes to support twinBASIC for Applications (TBA) - prototype now in private testing
BETA 610
- added: conditional compiler constant
TWINBASIC_BUILD
that evaluates to a Long constant containing the sequential build release number (e.g. 610 for BETA 610) - fixed: issue with PictureBox.AutoSize when the picture box ScaleMode does not match the container (Nibbles2) [ fafalone, discord ]
- fixed: (regression in BETA 609) IDE loading a project and restoring layout could cause IDE errors
BETA 611
- fixed: (regression) lightweight controls not honouring anchors [ sokinkeso, discord ]
- fixed: touching an internally implemented control array collection field wasn't triggering the form container to load [ fafalone, discord ]
- fixed: unhandled errors in event handlers under the debugger would sometimes be treated silently
- fixed: (regression) IDE 'Real OS Titlebar' option not working correctly in recent builds [ fafalone, discord ]
BETA 612
- improved: SHIFT+click on monaco editor scrollbar now jumps to the position rather than scrolling by page [ bradPeg, discord ]
- fixed: debugger edge case involving Implements-Via inheritance, potentially causing crash during debugging of such objects
BETA 613
- fixed: MonthView bug, pressing left/right arrows doesn't stop when mouse is released [ https://github.com/twinbasic/twinbasic/issues/1898 ]
- fixed: Ax filter issue that could cause double WM_COMMAND events from control containers (e.g. tB CommandButton on a VBCCR FrameW)
- improved: form designer minibar is now semi-transparent until hovered over, to be less distracting (experimental)
- fixed: form designer minibar could sometimes show up in the wrong position (0,0) when switching between code and form designer
- fixed: (regression in recent builds) default event of ActiveX controls was being wrongly chosen
BETA 614
- improved: tweaked DIAGNOSTICS panel so that each issue uses only a single line, unless selected
- improved: tweaked DIAGNOSTICS panel so that you must double click to jump to the code point
- fixed: DIAGNOSTICS panel scroll thumb bar was not able to be dragged [ sokinkeso, discord ]
BETA 615
- improved: DIAGNOSTICS panel file groupings are now alphabetically sorted
- fixed: Form Activate/Deactivate events now fire in the same manner as VB6
- fixed: MDIForm Activate/Deactivate events now fire, matching VB6
- fixed: (regression) __IMPORT_LOG would not automatically open properly in imported VBPs
BETA 616
- added experimental support for function pointer types (delegate syntax) [ https://github.com/twinbasic/lang-design/issues/44 ]
- added warning TB0026 Mismatched Delegate Types
BETA 617
- fixed: many edge cases involving
Delegate
syntax - fixed: class member AddressOf produced invalid stubs for CDECL procedures in 32-bit compilations
- improved: class member AddressOf support now allows for Single, Double and Date return types
- improved: AddressOf now returns a delegate type rather than a LongPtr value for helping promote type safety (can still be treated as a LongPtr for back compat reasons)