Developer Preview 2 - DOWNLOAD/PREVIEW INFO
twinBASIC is a modern BASIC compiler that aims to be fully compatible with all existing VB6 and VBA code. This is a work in progress project. Features are being added and improvements are being made daily. For this initial preview we have disabled some features that are not yet ready for public exposure. There are some parts of the VB syntax that are not yet supported. We are working hard behind the scenes to get the remaining parts of the syntax incorporated, so please bear with us.
This is a commercial project, though the 32-bit Windows version of the project will be available completely free of charge. Developers that need to build 64-bit binaries will either need to purchase a licence or endure a 5-second twinBASIC splash screen when their applications start.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
Current Preview State
This preview version of twinBASIC can compile standalone EXE applications, ActiveX DLLs and ActiveX Controls.
Most of the common VB language features are complete, however there are a few important things to note. These issues will be fixed in the weeks and months ahead.
- Error numbers and descriptions don't always match VB yet
- multi-threading only allowed via the debug console for now
- vbWatchdog support disabled
- Webserver extension library disabled
- The VBA.Interaction.* namespace is implemented but has little test coverage, so there may be issues
- The VBA.Strings.* namespace is implemented but has little test coverage, so there may be issues
- Download the twinBASIC IDE zip file
- Development environment currently tested and supported on Windows 7, Windows 8, Windows 10 and Windows 11
twinBASIC issue tracking is now live at GitHub. We've been inundated with bug reports and feature requests from many different sources. Going forward, it would help immensely if you could report bugs and post feature requests over at the repository which will help us better keep track and manage requests.
You can also join us over on our Discord server to chat about anything related to the project:twinBASIC DISCORD server
Alternatively, you can get in touch with the lead developer on twitter: Follow @WaynePhillipsEA
InstallationDownload the twinBASIC IDE
The twinBASIC IDE does not require any installation on your machine. Just download the latest ZIP file, extract it, and run the twinBASIC.exe file from the root folder.
Getting Started - Sample 1 - HelloWorld!
Let’s dive in with a simple Hello World project.
Launch the twinBASIC IDE by opening the twinBASIC.exe file you downloaded earlier. Now select the 'Samples' tab, and open the sample called 'Sample 1. HelloWorld'
Press F5 to run the startup procedure (Sub Main in this case), and you should be presented with the sample message box:
To build an EXE file from your project, first save the project (File menu > Save Project), then press the Build button on the toolbar:
The EXE file will now be built, and you should see the details in the DEBUG CONSOLE panel:
The project settings allow for changing general project settings and COM references.
twinBASIC itself supports multi-threading, but before we unleash this feature properly to the world, we need to add some language syntax to support the feature.
In the meantime, you can test multi-threading capabilities from the debug console, by starting an expression with the tilde character (~) to indicate that you want to run the code on another thread.
Compiled code emitted by twinBASIC Preview 1 is unoptimized native code. Even though the output code is unoptimized, it is typically much faster than VBA (or VB6’s p-code compilation), simply due to it being native machine code.
Work is already underway to integrate LLVM into twinBASIC so that we can grab some of the amazing benefits it offers for code generation.
Generated EXE and DLL files tend to be very small with twinBASIC. Please note that generated EXEs and DLLs do not require any runtime or redistributable components! (unless you reference third-party components yourself).
New compiler features
We’ve already covered many of the new language features available in twinBASIC in our videos:
In case you missed them, let’s take a quick look at some of the new features available in twinBASIC...
Inline variable initialization
The DeclareWide keyword turns off the implicit ANSI to Unicode conversions that usually happen behind the scenes when Strings are used with the Declare statement
Naturally, since COM doesn't support parameterized constructors, only the default constructor is exposed via the generated COM type library.
Don't be alarmed... twinBASIC still supports Class_Initialize() too!
Oh, and generic inference is also supported, so you can simplify that...
Generics are supported for procedures, classes and UDTs. Generics are not exposed in the generated COM type libraries, and so can only be used internally via twinBASIC.
TOP TIP: twinBASIC accepts literals as well as types in generic specifiers!
Implements per-procedure support
Block comments (as seen in many C style languages)
... and much, much more!! Check out our videos!
Bit shifting <<, >>
Short-circuiting operators AndAlso, OrElse, If() operator