twinBASIC Update: February 18, 2024
Highlights include progress on the IDE memory leaks, object models for automating Excel's Solver, and discussion regarding a taskbar icon monitor issue.
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:
- Custom twinBASIC IDE Installation Guide
- GitHub Issue Tracker (report bugs)
- twinBASIC Discord Server (chat about the project)
- twinBASIC/VBx LinkedIn Group
Highlights
Memory Leak Progress Update
As mentioned in last week's update, Wayne has been focusing on cleaning up the memory leaks that have been an issue in the new IDE for a long time. Here's a brief recap of his updates in this regard:
[WaynePhillipsEA — 02/14/2024 7:44 AM]: Making good progress with the memory leaks guys
[WaynePhillipsEA — 02/15/2024 7:21 AM]: I can now write a declare statement inside WinDevLib with only 100MB RAM leakage rather than 3000MB leakage, so things are getting better
[bclothier — 02/15/2024 8:36 AM]: Just out of curiosity, are you using windbg or valgrind or ? to find them?
[WaynePhillipsEA — 02/15/2024 10:15 AM]:Neither. I've used both in the past, but I find the best solution is a homegrown one. In debug builds of tB I can track all internal objects live and with absolute precision. The only problem is that there are vasts amounts of information to digest due to the complexities that come with writing a compiler. In this release there are now no leaks at the root stages of the compiler (roughly equating to what you would think of as a 'parser'). However, there are still leaks at the later stages that I haven't got to yet.
There are always chances of regressions with this sort of work - in particular new compiler crashes. However, a number of stability improvements have been made in this release, and so hopefully stability will be generally improved.
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 General channel covers a wide range of topics related to the ongoing development of the twinBASIC programming language. Conversations this week focused on resolving bugs, planning new features, and community updates.
Summary
-
A major memory leak bug is being fixed, reducing RAM usage significantly when declaring APIs. This should improve IDE stability.
-
There was discussion around getting the 64-bit MSComCtl ActiveX control working in twinBASIC. A registry file was shared to register it properly.
-
Preparations are being made for Mike (nolongerset) to demo creating a custom IDE add-in at the Access DevCon conference using twinBASIC.
-
A new user was welcomed and given advice on moving from VB6 to twinBASIC, including using the 32-bit IDE mode initially.
-
The difference between Long and LongLong data types was explained for 64-bit programming.
-
An ambiguous method error was discussed, related to resolving function overloading. Suggestions were made to improve the error message.
-
There was an extensive discussion comparing complex nested loop control flows across languages like VB6, twinBASIC, Java, and C#.
Conclusion
Good progress was made this week on resolving stability issues and planning for new features like IDE add-in capabilities. The community continues to grow, and twinBASIC's adoption is being promoted through conference sessions and other outreach. The language's compatibility and interoperability continues to improve weekly.
Around the Web
MS Excel SolverWrapper
GCUser99 posted the following announcement in the Discord show-and-tell channel:
Pretty niche, but in case anyone uses MS Excel's Solver for linear/non-linear optimization, this is a unique automation implementation. I've included in the repo the Inno Setup source for installing the twinBASIC DLL, in case that is of any use as a potential prototype for installing MS Office ActiveX DLL's...
Taskbar Icon Monitor Issue
The following is an AI-generated recap (via Claude-2-1ook) of a GitHub issue that generated significant discussion this week:
Here is a summary of the twinBASIC GitHub issue #1765:
-
The issue involves taskbar icons for twinBASIC IDE and apps not moving to the correct monitor when dragging the window between multiple displays.
-
This differs from most other apps, where the taskbar icon follows the window when dragged between monitors.
-
The likely cause is the main form window in twinBASIC being owned by the hidden ThunderMain window rather than the desktop.
-
A workaround was provided using SetWindowLong to set the owner to 0 (desktop) during Form_Load. This made the icon follow the window between monitors.
-
There was confusion over the proper handle to use for the desktop window. GetDesktopWindow() is recommended, but 0 worked here.
-
Overall this appears to be a small compatibility issue between twinBASIC and other Windows apps. The workaround helps apps behave as users expect when moving between monitors.
Changelog
Here are the updates from the past week. You can also find this information by visiting the GitHub twinBASIC Releases page.
ChatGPT Changelog Summary
* Auto-generated via ChatGPT, sorted in order of ChatGPT's opinion of "most impactful changes."
- improved: General stability during editing sessions has been enhanced, along with a reduction in RAM leaks, supporting a more efficient development experience.
- added: New IDE commands like tbEditor_DeleteLines with default shortcut CTRL+SHIFT+DELETE, and tbFindWidget_HistoryCyclePrevious/Next for improved navigation in the Find widget.
- fixed: Addressed various 'IDE internal errors' reported in the debug console, enhancing reliability.
- fixed: Resolved issues with the package manager panel, control array group wrapper access, and other IDE functionalities to improve user interaction and workflow.
- fixed: Eliminated a system beep that occurred when pressing Tab/Enter in TextBox/ComboBox controls, resulting in a smoother UI experience.
- added: Recognition for new VIP GOLD supporters within the IDE, acknowledging community contributions.
WARNING: The following issues are present in BETA builds 424 - 452 (the latest build as of publication):
- there are known memory leaks in these versions, so memory usage will be higher than normal
- see important release notes from BETA 424 here https://github.com/twinbasic/twinbasic/releases/tag/beta-x-0424
BETA 449
- fixed: a few more 'IDE internal errors' reported in the debug console
- added: commands
tbFindWidget_HistoryCyclePrevious
andtbFindWidget_HistoryCycleNext
and attached to Up/Down keys when find widget is focused [ Gary Miller, discord ] - fixed: package manager panel goes completely blank and unclosable if left open when opening a non-package project [ fafalone, discord ]
- fixed: accessing a control array group wrapper via the
Controls
collection not working [ sokinkeso, discord ]
BETA 450
- improved: reduction in RAM leaks during editing sessions
- improved: improved general stability during editing sessions
BETA 451
- added: (IDE) IDE command
tbEditor_DeleteLines
(default CTRL+SHIFT+DELETE shortcut) [ Gary Miller, discord ] - fixed: (IDE) statusbar growing in height by 1px when hovering over IDE commands [ sokinkeso, discord ]
- fixed: (IDE) when the rename input box was active, global keyboard shortcuts were still responding [ FullValueRider, discord ]
- fixed: (IDE) double clicking on an existing watch in the WATCH panel was not allowing to edit it
- fixed: (IDE) a few more 'IDE internal errors' reported in the debug console
- fixed: (IDE) middle code selector dropdown was not using the 'default' event appropriately [ https://github.com//issues/1780 ]
- fixed: (IDE) importing a VBP generated class headers using the old attribute spacing/formatting [ https://github.com//issues/1777 ]
BETA 452
- fixed: (IDE) a few more 'IDE internal errors' reported in the debug console
- improved: (IDE) reduction in RAM leaks during editing sessions
- fixed: Clipboard.SetData() second arg should be Optional [ https://github.com//issues/1787 ]
- fixed: removed system beep when pressing Tab/Enter in a TextBox/ComboBox control [ https://github.com//issues/1785 ]
- added: (IDE) recognition for our new VIP GOLD supporters