RDCore v0.2.1-alpha (preview 2)

Close-up of a weathered dark coin featuring a raised duck emblem and partial lettering
V I V A T ❤️ C U C U M I S ™
[English version follows]

RDCore v0.2.1-alpha, la deuxième préversion de la plateforme, est arrivée! Elle exécute votre code VBA et VB6 hors de l’éditeur VBA, sous Windows, Linux et macOS, et cette fois-ci, elle amène les formulaires avec elle.

RDForms

Une image vaut mille mots, comme on dit :

Desktop screenshot showing a naval battle game with grid boards, ship fleet legend, rubber duck graphics, and a terminal window over a bridge wallpaper
RDCore et RDForms exécutant la démo de la plateforme sur un Mac, avec des sprites PNG.
Derrière, la démo “application console” complétant une partie dans les mêmes conditions.

La première version alpha hébergeait les MSForms natifs, sous Windows seulement. Cette deuxième version alpha exécute vos formulaires Classic-VB dans RDForms, le tout nouveau cadriciel d’interface multiplateforme de la plateforme, qui affiche et exécute votre interface existante sous Linux, ou sur un Mac, Intel ou ARM64. Évidemment, ça fonctionne aussi sous Windows. Porter votre interface vers le nouveau cadriciel est entièrement facultatif (RDCore comprend les fichiers .frm et .frx), mais RDForms est fortement recommandé si vous démarrez un nouveau projet : il fond essentiellement MSForms dans les formulaires Classic-VB, de sorte que vos formulaires RD-VBA peuvent être MDI et afficher des images PNG avec un canal alpha. Bien sûr, ils ne se reportent pas vers MSForms ou les formulaires Classic-VB : ni l’un ni l’autre ne vous laisse régler l’opacité d’un contrôle, par exemple.

Le code d’un formulaire RDForms vit dans un module .rdform, à côté d’un document de conception .xaml.

Le cycle de vie des formulaires VB, les groupes de contrôles, Controls.Add, les membres des ListBox et des ComboBox (avec des icônes!), les menus contextuels, les twips et les modes d’échelle, PaintPicture, Print, Line, Circle, PSet, Point, etc. fonctionnent tous dans RDForms comme dans VB6; les UserControls, PropertyPages et UserDocuments sont des modules de code, et PropertyBag et Ambient sont pris en charge.

App.KeepSystemTheme fait suivre à RDForms le thème du système, alors vous obtenez un thème sombre gratuitement dans vos applications RDForms. Les lecteurs d’écran et les outils de test d’interface voient les menus et les contrôles, eux aussi. Les projets qui référencent MSComctlLib et FM20.DLL les lient dans RDForms, mais ni l’une ni l’autre de ces DLL n’est livrée avec le paquet RDForms.

Quoi d’autre de neuf?

Un projet RD-VBA peut maintenant être une Console Application : ses invites MsgBox et InputBox sont posées dans la console, mais sous Windows, on peut aussi les configurer pour faire apparaître les boîtes natives. Et un programme bâti sous Windows s’exécute sous Linux ou macOS, sans ses sources.

Un espace de travail peut maintenant contenir plusieurs projets qui se référencent les uns les autres : un groupe de projets VB6, ou une paire complément VBA et classeur Excel, peut tenir dans un seul espace de travail. Friend et VB_Exposed fonctionnent comme la spécification le prévoit.

Changements incompatibles

Cette version corrige les constantes du précompilateur VB en introduisant Is64BitEnv, qui sépare proprement les tests de système d’exploitation des tests d’architecture. Dans MS-VBA, Win64 vaut 1 sur un Mac 64 bits, ce qui brouille la frontière entre les deux et fait que les directives #If se comportent de façon inattendue; RDCore vous apporte des diagnostics qui vous disent quand elles sont mal configurées, et offrent de les corriger. La constante Linux64, introduite dans la première version alpha, est retirée (elle vaut 0 à moins que votre code la définisse) : Linux vaut 1 sous Linux, et Is64BitEnv vaut 1 dans tout environnement 64 bits, peu importe le système d’exploitation. #If Linux And Is64BitEnv teste ce que testait Linux64.

Le code écrit dans MS-VBA avec des directives de compilation conditionnelle qui fonctionnent sur un Mac continue de fonctionner tel quel.

Le schéma d’un fichier .rdproj a changé plusieurs fois depuis la première version alpha. Un projet créé avec cette première alpha se charge encore, mais il est recommandé de recréer le .rdproj, surtout si votre espace de travail a été créé à partir d’un projet VB6 : le nouveau schéma comprend des métadonnées de projet supplémentaires, que VB6 utilise pour make et que rdc build utilise à des fins semblables.

Quelques autres changements peuvent surprendre un espace de travail existant (une erreur non gérée termine maintenant le programme comme le fait End, par exemple); les notes de version les énumèrent tous.

Parité des inspections et des refactorisations de Rubberduck

La dernière version de la plateforme RDCore apporte presque chacune des inspections du Rubberduck d’origine (celles qui sont propres à Excel sont exclues, pour l’instant), mais avec un modèle sémantique qui permet d’aller beaucoup plus loin dans l’analyse, en faisant beaucoup moins de suppositions. La plupart offrent une ou plusieurs actions de code correctives (des correctifs rapides), et oui, vous pouvez encore les ignorer, mais ça se fait par les paramètres de configuration, et c’est encore mieux, parce que les paramètres de configuration forment une hiérarchie : la configuration de la plateforme pour la machine se trouve dans le dossier d’installation, la configuration de l’utilisateur dans votre profil, et maintenant une configuration d’espace de travail peut la remplacer pour un espace de travail.

  • Les inspections de Rubberduck sont devenues des diagnostics RDC. Voyez la documentation pour la liste complète :
    • Membres par défaut et vérifications des affectations
    • Liaison tardive et validation des interfaces
    • Code inutilisé ou mort
    • Plateformes et compilation conditionnelle
    • Là où MS-VBA et sa propre spécification MS-VBAL divergent
    • Projets et compilation : références circulaires entre projets, aucun point d’entrée ou plus d’un
    • Moins de faux positifs sur toute la ligne
  • Des outils de refactorisation, bien sûr :
    • Extract Method peut remplacer d’un coup, partout dans le projet, les copies de la sélection par un appel de la nouvelle méthode
    • Inline Member, tout nouveau : remplace un appel d’une procédure par son corps
    • Convertir un GoSub en procédure
    • Encapsulate Field
    • Implement Interface (offert sur la ligne Implements)
    • Move Members vers le haut et vers le bas d’un module; Sort Members
    • Remove et Reorder Parameters
    • Move Closer to Usage
    • Rename des types, des énumérations, des modules, du projet, des étiquettes de ligne et des contrôles de formulaire; le renommage suit les vraies liaisons symboliques. Comme toutes les refactorisations de RDC, il est entièrement déterministe et n’est pas une opération de recherche et remplacement textuelle.

Outils CLI

Les applications client et serveur de RDCore ont maintenant un écran de démarrage fourni par le SDK, et peuvent le remplacer par le leur, alors tous les outils ont l’air de faire partie de la même famille, parce que c’est le cas!

rdc build -c Release bâtit un programme qui peut s’exécuter hors de son espace de travail, et rdc build -r le bâtit pour Windows, Linux ou macOS (x64 ou Arm64), depuis n’importe quelle machine.

rdc bench exécute le corpus de bancs d’essai de la plateforme sur votre machine; donnez-lui un espace de travail et vous pouvez mesurer votre propre code source RD-VBA. La plateforme s’occupe pour vous de la mise en température et des statistiques.

rdc export-library extrait tous les symboles d’une bibliothèque de types donnée; quand la plateforme a les symboles d’une bibliothèque, elle peut compiler le code source écrit pour cette bibliothèque (mais pas l’exécuter : il faut pour ça la bibliothèque elle-même).

rdc mcp --workspace <chemin> sert les outils d’assistant IA intégrés de RDCore, par le protocole MCP standard.

Serveur MCP intégré

Comme on l’a déjà écrit, RDCore embrasse l’IA. Les outils MCP intégrés le démontrent : ils donnent à un assistant de programmation LLM le modèle sémantique de RDCore, par des outils entièrement déterministes qui trouvent les symboles, les références et les diagnostics, listent et appliquent les correctifs rapides, et renomment selon les liaisons. Un assistant IA qui utilise ces outils a quelque chose que la plupart n’ont pas, parce que les outils MCP se branchent habituellement sur un IDE, et non directement sur le cerveau et le modèle sémantique d’une plateforme de langage.

La différence est majeure : sans modèle sémantique, un assistant IA travaille avec des résultats non déterministes et traite le code source comme du texte brut. Bien des modèles deviennent très bons à travailler ainsi, mais ils restent sujets aux hallucinations et ne génèrent pas toujours le code optimal. Avec le MCP de RDCore, ces agents ont accès aux symboles, aux références, aux diagnostics et aux correctifs, et ils peuvent se servir de ces outils pour valider le code qu’ils génèrent, avant même qu’il n’arrive dans une réponse du clavardage.

Tout hôte d’assistant qui parle MCP peut s’en servir : vous fournissez le modèle, RDCore lui donne des ailes.

Performance

Ce cycle apporte des gains de performance étonnants sur toute la ligne pour le code compilé, et cette version compile beaucoup plus de code source RD-VBA que la précédente : là où bien des cas restaient interprétés, la plupart s’exécutent aujourd’hui compilés.

L’achèvement de l’étape de l’abaissement vers l’IR explique à lui seul une bonne part des gains, mais les bancs d’essai se sont surtout améliorés grâce à l’optimisation de la compilation et à la réduction des allocations : plusieurs opérations n’allouent maintenant presque rien et n’entraînent exactement aucune collecte de mémoire .NET :

Performance comparison table showing fastest, median, slowest, total, allocated memory, and GC counts for calls, statements, arrays, strings, numeric operations, variables and parameters, and standard library functions.
Ces chiffres bougent à chaque fusion et n’indiquent que des charges de travail précises et irréalistes; mesurez votre propre code par rapport à une exécution de référence dans MS-VBA pour faire vos propres comparaisons valables à la maison.
Dark benchmark dashboard comparing Excel for Mac VBA and RD-VBA, showing RD-VBA is 6.81 times faster overall with a horizontal speed-up chart by group.
Exécution maison sur MacOS: RD-VBA l’emporte avec 61/63 cas plus rapides que MS-VBA, complétant ici le banc d’essai en 304.3 millisecondes, contre 2,073.5 pour MS-VBA sur MacOS (ARM64).

Essayez-le!

Ça fait beaucoup de canard pour une deuxième préversion, et c’est encore une alpha : attendez-vous à des aspérités, et à ce que les choses changent d’une version à l’autre. Téléchargez-la, pointez rdc vers votre code, et puis VIVAT CUCUMIS!


Close-up of a weathered dark coin featuring a raised duck emblem and partial lettering
V I V A T ❤️ C U C U M I S ™
English

RDCore v0.2.1-alpha, the platform’s second preview, is out! It runs your VBA and VB6 code outside the VBA editor, on Windows, Linux and macOS, and this time it brings the forms along.

RDForms

A picture is worth a thousand words, as they say:

Desktop screenshot showing a Naval battle game window with Battleship grids, colored ship markers, duck illustrations, and a terminal log against a Golden Gate Bridge wallpaper.
RDCore+RDForms running the platform demo on a Mac, with PNG sprites.
Background: the console application demo running to completion all the same.

The initial alpha release hosted native MSForms, on Windows only. This second alpha release runs your Classic-VB forms in RDForms, the platform’s shiny new cross-platform UI framework that renders and runs your legacy UI on Linux, or on a Mac, Intel or ARM64. Of course it also works on Windows. Porting your UI to the new framework is entirely optional (RDCore understands .frm/.frx), but RDForms is highly encouraged if you’re starting a new project: it essentially folds MSForms into Classic-VB forms, so your RD-VBA forms can be MDI and display PNG images with an alpha channel. Obviously, they don’t back-port to MSForms or Classic-VB forms: neither lets you set a control’s Opacity, for example.

An RDForms form’s code-behind lives in a .rdform module beside a .xaml designer document.

VB forms’ lifecycle, control arrays, Controls.Add, ListBox and ComboBox members (with icons!), context/popup menus, twips and scale modes, PaintPicture, Print, Line, Circle, PSet, Point, etc. all work on RDForms as they do in VB6; UserControls, PropertyPages and UserDocuments are code modules, with PropertyBag and Ambient supported.

App.KeepSystemTheme makes RDForms follow the system-wide theme, so you get a dark theme for free in your RDForms applications. Screen readers and UI testing tools see menus and controls, too. Projects that reference MSComctlLib and FM20.DLL bind them in RDForms, but neither DLL ships with the RDForms package.

What else is new?

RD-VBA projects can now be a Console Application, whose MsgBox/InputBox prompts are handled in the console, although on Windows they can also be configured to pop the native boxes. And a program built on Windows runs on Linux or macOS, without its sources.

Workspaces can now include multiple projects that reference one another; a VB6 project group or a VBA add-in + Excel workbook pair can exist in one workspace. Friend and VB_Exposed work as specified.

Breaking changes

This release fixes the VB precompiler constants by introducing Is64BitEnv, cleanly separating OS checks from bitness checks. In MS-VBA, Win64 is 1 on a 64-bit Mac, which blurs the line between OS and bitness checks and makes #If directives behave unexpectedly; RDCore brings you diagnostics that tell you when they are set up wrong, and offer to fix them. The Linux64 constant that the first alpha release introduced is retired (it is 0 unless your code defines it): Linux is 1 when running on Linux, and Is64BitEnv is 1 when running in a 64-bit environment, regardless of the OS. #If Linux And Is64BitEnv tests what Linux64 did.

Code that is written in MS-VBA with conditional compilation directives that work on a Mac continues to work as-is.

The schema definition of a .rdproj file has changed several times since the initial alpha release. A project file from that first alpha still loads, but re-creating the .rdproj is recommended, especially if your workspace was created from a VB6 project: the new schema includes additional project-level metadata that VB6 uses for make and that rdc build uses for similar purposes.

A few other changes may surprise an existing workspace (an unhandled error now ends the program as End does, for one); the release notes list them all.

Rubberduck inspection & refactoring parity

The latest version of the RDCore platform brings almost every single one of the legacy Rubberduck inspections (the Excel-specific ones are excluded, for now), but now with a semantic model that enables going much further in the analysis, while making far fewer assumptions. Most of them offer one or more corrective code actions (quick fixes), and yes, you can still ignore them, but that’s through configuration settings, so it gets even better, because configuration settings are a hierarchy: machine-level platform configuration lives in the installation folder, user-level configuration lives in your user profile, and now workspace-level configuration can override it within a workspace.

  • Rubberduck’s inspections have become RDC diagnostics. See the documentation for the full list:
    • Default members and assignment checks
    • Late binding and interface validation
    • Unused/dead code
    • Platforms and conditional compilation
    • Where MS-VBA and its own MS-VBAL specification diverge
    • Projects and builds: circular project references, no entry point or more than one
    • Fewer false positives across the board
  • Refactoring tools, of course:
    • Extract Method can replace every duplicate of the selection across the project with a call to the new method, in one go
    • Inline Member, brand new: replaces a call of a procedure with its body
    • Convert GoSub to Procedure
    • Encapsulate Field
    • Implement Interface (offered on the Implements line)
    • Move Members up and down a module; Sort Members
    • Remove/Reorder Parameters
    • Move Closer to Usage
    • Rename types, enums, modules, the project, line labels, form controls; rename follows actual symbolic bindings. Like all RDC refactorings, it is entirely deterministic and not a text-based search & replace operation.

CLI Tools

RDCore client and server applications now get an SDK-provided splash screen and may replace it with their own, so all the tools look & feel like they’re part of the same family, because they are!

rdc build -c Release builds a program that can run outside of its workspace, and rdc build -r builds it for Windows, Linux or macOS (x64 or Arm64), from any machine.

rdc bench runs the platform’s benchmark corpus on your machine; give it a workspace and you can benchmark your own RD-VBA source code. The platform handles warm-ups and stats for you.

rdc export-library extracts all the symbols of a specified type library; when the platform has the symbols for a library, it can compile (but not run; that needs the actual library) source code written against that library.

rdc mcp --workspace <path> serves RDCore’s built-in AI assistant tools, over standard MCP.

Built-in MCP Server

As was written before, RDCore embraces AI. The built-in MCP tooling demonstrates it: it gives an LLM coding assistant RDCore’s semantic model through fully deterministic tools that find symbols, references and diagnostics, list and apply quick fixes, and rename by binding. An AI assistant that uses these tools has something most don’t, because MCP tools typically hook into an IDE, not directly into a language platform’s brains and semantic model.

The difference is major: without a semantic model, an AI assistant works with non-deterministic outcomes and treats source code as plain text. Many models are getting very good at working like this, but they remain prone to hallucinations and may not always generate optimal code. With RDCore MCP, these agents get access to symbols, references, diagnostics and fixes, and they can use these tools to validate the code they generate before it even lands in a chat reply.

Any assistant host that speaks MCP can use them: you supply the model, RDCore empowers it.

Performance

This cycle delivers astonishing performance gains across the board for compiled code, and this version compiles much more RD-VBA source code than the previous release: where many cases remained interpreted, most today run compiled.

Completing the IR lowering milestone explains a lot of the performance gains all by itself, but the benchmarks mostly improved by optimizing compilation and reducing allocations: several operations now allocate almost nothing and incur exactly zero .NET garbage collections:

Performance comparison table showing fastest, median, slowest, total, allocated memory, and GC statistics for calls, statements, arrays, strings, numeric operations, variables and parameters, and standard library functions.
These figures move at every merge and only indicate specific, unrealistic workloads; benchmark your own code against an MS-VBA reference run to make your own valid comparisons at home.
Dark benchmark dashboard comparing Excel for Mac VBA and RD-VBA, showing RD-VBA speedups by group with a horizontal bar chart.
A third party’s run on MacOS: RD-VBA wins with 61/63 faster cases than MS-VBA, completing the benchmark runs in 304.3 milliseconds while MS-VBA did the same in 2,073.5, on MacOS (ARM64).

Try it!

That’s a lot of duck for a second preview, and it’s still an alpha: expect rough edges, and expect things to change between versions. Download it, point rdc at your code, and VIVAT CUCUMIS!

RDCore.CLI / Platform Updates

The RDCore language platform is taking shape and is about to get very serious about its ambitions: take MS-VBAL and implement it from the ground up into the LSP platform Rubberduck would have been if it became VBA.

I remember telling a friend last spring about my plans; “ok but what about the debugger?” they asked – I said where we’re going we don’t need a debugger, we are the debugger. Last week, we arrived.

MS-VBA halts your debugging session when you rename a symbol in the current instruction, presumably because the edit cannot be made in all places at once, leaving the program invalid in the interim steps.
RD-VBA merrily lets you resume after doing exactly the same, because renaming a symbol is an atomic operation that can perform multiple edits at once.

Edit and continue

Perhaps the single most defining feature of Classic Visual Basic, has arrived in RDCore: the ability to reshape the compiled program, observe and manipulate its symbols and values as it runs in a debugger.

E&C is a rather complex matter, and MS-VBA halts execution in quite several situations, for very valid reasons. The fact that RDCore allows resuming execution in places where MS-VBA would not, doesn’t take anything away from the historical feature: RDC’s internals are modeled in such a way that makes these limitations a bit easier to overcome, I suppose.

Edit and apply later

When RDCore cannot apply an edit, it often can (and does) hold on to the compiled version and issues a RDC20001 diagnostic that says the edit will be applied after the program restarts – rather than stopping the debug session right there and then.

Edit and take it back

If RDCore cannot apply an edit, and cannot hold on to the compiled version while keeping its state coherent, you can simply undo it, and then resume execution as if nothing happened.

See the documentation for a complete breakdown of the specific cases and the differences between RDCore and MS-VBA.

All debugger features are provided through standard DAP endpoints over stdio.


Code formatting

LSP defines endpoints for code formatting and format-as-you-type, but doesn’t specify what it specifically entails, leaving a language server free to do whatever it deems necessary to fulfill the request.

In RDCore, that means indenting the module of course – with legacy Rubberduck’s indenter settings imported from your Rubberduck configuration… a bit like how Rubberduck imported your legacy Smart Indenter settings on the first load.

In the REPL client (rdc.exe running standalone), formatting is applied whenever the program source code is read – so when you LIST or SAVE a .rdc program file.

Code formatting settings are editable (with completion lists!) from the interface with the CONFIG command, and take effect immediately.

Block foldings

At the start of any block, the LIST output will show ▽▲ glyphs in the margin, indicating the start of foldable and folded code blocks, respectively.

Use the FOLD command to toggle them; completion list offers the valid line numbers.

If a folded block hides a breakpoint, it is displayed in the margin on the folded line, even if that line doesn’t have a breakpoint.


Completion lists

Completion lists show available commands, keywords, standard library modules, functions, and procedures; enum arguments, object members. All with the signature and docstring underneath.

The one single thing that makes the biggest difference in how hard or easy it is to learn a programming language, is its completion lists: without it, everything feels like a magic incantation that you must know in order to make anything work at all.

With it, it’s like the standard library is telling you how to use it, and you can explore all the types and members and discover things, all without leaving your editor.

RD-VBA completion is snappy and relevant, and signature help provides the docstrings as you type – in the language configuration of your session for the standard library (although currently only available in French and English).


MSForms hosting

The RD-VBA runtime is now capable of hosting MSForms. It does not, at this stage, host its own “RDForms” cross-platform GUI components, so trying to run a user form in Linux or on a machine without the non-distributable MSForms 2.0 DLL will raise a runtime error instead of showing a UI.

At design/compile time though, all the symbols remain available, so you get completion lists and signature help regardless, and the code compiles.

We could describe it as RD-VBA replacing MS-VBA as the MSForms designer and runtime host here, taking the legacy Microsoft UI framework made for Office automation out of its box and into standalone RD-VBA applications.

This is ultimately just the fallback solution, a shortcut to get something out the door faster: the goal is for the beta stage to host its own implementation of a GUI framework that can run and render anywhere: the one HexIDE built to do the same for VB6 forms and controls.

Remember MVVM in VBA? The example form’s content is dynamically generated at run-time, and RDCore runs it and its events; it works!


Alpha release?

As of this writing, RDCore is still unreleased pre-alpha. To try it today, you must clone the repository on GitHub and build and deploy the platform yourself, and then it’ll deploy an unoptimized debug build that’s intended for local development and debugging.

The roadmap is quickly becoming a long green list of checked boxes, there are now over 13k unit tests and 80% coverage, so an alpha release can’t be too far down the line. What’s holding it up?

HexIDE integration

Releasing RDCore without a LSP client integration beyond its own REPL/CLI toy application wouldn’t do it justice: there are so many things RDCore can do as a platform, that the REPL client simply cannot express, the first of which is handling a project with anything more than a single procedure scope with BASIC-style line numbers. The REPL client is a LSP demo and platform integration testing tool; it isn’t “the product”, even if, without an IDE, it’s what gives you a small glimpse of what the platform and language server can do.

There could be a small VSCode extension that implements the SDK’s RDCoreClientApp and integrates the LSP server into VSCode… but VSC is a general-purpose jack of all trades, master of none editor that makes the experience awkward when you just want your good old VBIDE with the modern-day perks.

This is where HexIDE wins: like VSCode it has its language features provided by LSP server extensions. But the Hex is for 6, as in VB6 – it is an independent project under MIT licensing, which gives a fork more rights than what we intend to leverage to ultimately make it the RDCore platform’s official IDE.

By 2027, it will be possible to import a VBA project or open a .vbp in HexIDE; analyze, test, and build it (.net exe/dll) in both CI/CD pipelines and the editor with RDCore, and compile it to native x86/x64 and extend the language beyond VBA with twinBASIC – all without leaving your IDE, and none of it requiring you to be on a Windows desktop with Office installed.

RDCore.SDK

The MIT-licensed RDCore.SDK project at the center of the platform is being extracted into its own separate repository, and will be publishing a NuGet package that RDCore platform components and extensions (including the HexIDE extension) will be referencing like any other package. The idea is to make it as easy as possible to write RDCore platform extensions.

Because the language core and runtime and platform SDK is only the beginning for the RDCore platform: unit testing will soon build on top of it, for example – but the alpha release will not wait for the platform extensions.

RD-VBA CLI

(English below)

Un jalon majeur a été franchi la semaine dernière : la plateforme RDCore dispose désormais d’un interpréteur qui assemble toutes les pièces du puzzle en quelque chose de traçable, configurable et extensible, qui ressemble aux débuts d’un runtime.

Là où tout ceci devient très concret : l’application console exécute maintenant une boucle REPL interactive où vous exécutez une session runtime en mode immédiat :

Ne vous laissez pas avoir par le look C64-BASIC : il s’agit d’un client LSP avec une session RD-VBA.

Les 4 octets alloués sont pris par le module et la procédure synthétique où vit le code source de votre programme. Tapez une instruction VBA, elle s’évalue et affiche son résultat; précédez-la d’un numéro de ligne, et vous venez d’inscrire cette instruction à cette ligne dans votre programme RD-VBA. Le nom de ce module synthétique est Program, et le nom de la procédure est Main. Vous verrez régulièrement ces identifiants dans les traces de la pile d’exécution (stack trace) des erreurs rencontrées – qui seront ici toujours sous Main, mais vous comprendrez que ce même mécanisme fonctionnera peu importe la profondeur de la pile dans un véritable client (IDE), avec un vrai projet et plusieurs modules et procédures.

L’idée ici n’est pas de faire évoluer cette application en un IDE non plus – mais ça fait une façon très divertissante de tester la plateforme, le cœur de langage et ses sémantiques. Le rôle de cette application est de simplement permettre de tester la plateforme de bout en bout. Étant un client LSP, nous verrons fort probablement apparaître un surlignage sémantique de la syntaxe au niveau de la sortie de LIST par exemple, ou alors des listes de complétion interactives; les diagnostics sont déjà branchés et ANALYZE en affichera les détails dès que ceux-ci deviendront disponibles. PEEK/POKE ne sont que pure lecture/écriture directe en mémoire à la Commodore64.

RUN exécute le programme de haut en bas, à moins que vous lui construisiez un parcours avec GoTo et GoSub/Return, auquel cas vous savez probablement ce que vous faites… sinon les diagnostics seront bientôt là pour vous guider.

Sémantiques

Toute la plomberie est en place; ce qu’il reste, c’est l’implémentation : les instructions I/O comme Open, Close, Print#, Write#, Put#, Get# sont implémentées; les déclarations, boucles, conditions, sauts et gestion d’erreurs sont fonctionnels. Beaucoup reste à faire: chacune des instructions doit avoir une implémentation, sans quoi les exécuter sera toujours en erreur.

L’implémentation de la librairie standard a débuté : Len et LenB sont les premiers consommateurs des données de stockage des UDT, et bien que LSet fonctionne tel que spécifié sur une String ou un UDT, la très vaste majorité de la librairie demeure à implémenter. Il s’agit de travail relativement simple qui n’a pas à traverser plusieurs couches d’abstraction et peuvent être des gains rapides; c’est pourquoi j’ai préféré donner les plus gros morceaux à Claude, les fonctions pures de la librairie peuvent être implémentées plus tard.

Ceci dit l’exécution et la gestion d’erreurs en place donnent déjà un bon aperçu :

Un programme RD-VBA qui ne contient pas d’instructions non-implémentées se complète.

Le retrait de l’instruction On Error GoTo révèle quelques faits intéressants :

D’abord, il y a une différence entre une erreur lancée explicitement par l’application, et une erreur d’exécution. Ensuite on remarque le numéro de ligne, puis la stack trace.

Ce que ces images ne montrent pas, c’est que le numéro de ligne est un symbole ici, seulement parce qu’il s’agit du mode programme – mais dans un document, la configuration par défaut fait de ce numéro l’emplacement L1C1 exact de l’erreur dans le document.

Une erreur d’application (VBA00000) est une erreur lancée par le code source (via Error, ou Err.Raise); une erreur d’exécution (VBR00000) est une erreur lancée par l’interpréteur. MS-VBA ne différencie pas réellement ces deux types d’erreurs – il y a donc désormais une distinction claire entre les deux, et ça ne brise rien du tout!

Aucune erreur d’application ne peut être confondue avec une erreur d’exécution, et il y aura toujours une trace de la pile d’exécution, même en mode immédiat!

Limitations

Certaines limitations sont inhérentes au fait qu’il s’agisse d’une application console: en effet il serait surprenant d’y voir une fonctionnalité affichant des info-bulles au survol d’un symbole.

D’autres limitations sont plutôt liées au design:

  • Le module Program et la procédure Main sont intrinsèques et ne peuvent pas être renommés.
  • Une commande sans numéro de ligne s’exécute immédiatement; les numéros de ligne sont donc obligatoires pour tout programme dans ce client.
  • Les numéros de lignes ne devraient pas empêcher l’utilisation de libellés, mais ceux-ci ne fonctionnent pas actuellement avec un numéro de ligne; GoTo/GoSub doivent donc référer à un numéro de ligne.
  • Les continuations sont invalides: un numéro de ligne ne peut pas être situé en plein milieu d’une instruction.
  • Limitation éventuelle du jeu de syntaxe valide en mode BASIC (configurable).
  • Limitation éventuelle à 10,000 lignes de la longueur permise d’une procédure; l’erreur procedure too long devrait alors être lancée à la compilation, mais possible que le mode BASIC fonctionne différemment.
  • Exit Sub termine le programme; Exit Function et Exit Property sont statiquement invalides.
  • Sub Main() et End Sub sont implicites: le corps du programme constitue le corps de cette procédure.
  • L’ajout de procédures additionnelles n’est pas supporté (les numéros de ligne étant invalides au niveau des déclarations d’un module); utilisez plutôt GoSub/Return avec de larges sauts de numérotation pour coder des sous-routines.

D’autres limitations sont ponctuelles et seront résolues avant le lancement de la v1 :

  • L’instruction REM qui explose à l’exécution est objectivement comique, mais ne restera vraisemblablement pas brisée longtemps.
  • L’invocation de membres de la librairie standard qui ne sont pas encore implémentés sera également en erreur.

Manipulation de Mémoire

Les commandes PEEK et POKE ne sont pas (encore?) implémentées en tant que mots-clés et donc pas utilisables dans du code source RD-VBA, mais les commandes fonctionnent et permettent donc une lecture/écriture directe d’octets en mémoire applicative – opération évidemment très risquée, mais la nostalgie l’a emportée.

Ceci dit les opérations LSet fonctionnent dans le code source sur des String et UDT.

Jalons

L’évolution du cœur de langage est complètement découplée de celle de l’application CLI, donc celle-ci fonctionnera de mieux en mieux et de façon de plus en plus complète à mesure que s’ajouteront les sémantiques du cœur de langage, et ce sans rien devoir corriger ou modifier dans l’application même.

Cela ne signifie pas pour autant que le travail est terminé!

L’application supporte notamment des thèmes, donc si le bleu C64-BASIC ne vous plaît pas, vous pouvez toujours passer à un thème foncé moderne. Ce n’est donc qu’une question de temps avant que la sortie de LIST affiche un surlignage sémantique issu du serveur de langage!

Exploiter cette connexion LSP constitue la façon dont cette application deviendra ultimement beaucoup plus qu’un éditeur BASIC. ANALYZE est déjà prêt à afficher les diagnostics, dès qu’ils commenceront à apparaître dans la plateforme.

Le mode REPL est bien pour une démo, mais le véritable outil est le mode CLI non interactif.

Les outils modernes s’exécutent dans des pipelines CI/CD (intégration et livraison continues) dans le cloud. rdc.exe sera à terme en mesure de compiler un projet, d’en exécuter les tests, et de bloquer une livraison qui dévie des conventions établies, le tout complètement en-dehors de l’écosystème MS-VBA.

Êtes-vous READY?


Mise à jour | Update 2026-10-02:

English

Si seulement 1986 avait eu LSP…
If only 1986 had LSP…

A major milestone was knocked down in the last week: the RDCore platform now has an interpreter that puts all the previous pieces together into a traceable, configurable, and extensible beginning of a runtime.

Where this gets very real, is with the CLI app now running an interactive REPL program mode where you’re basically running a runtime session in immediate mode:

Don’t be fooled by the C64-BASIC look; this CLI app is a full-fledged LSP client with an active RD-VBA runtime session.

The 4 bytes taken are allocated for the synthesized module and procedure scope your program space lives in. Type a VBA expression, and you get its result; precede it with a line number, and now you’ve written that instruction at that specified line number in your program. The name of this synthesized module is Program, and the name of the enclosing procedure is Main. This matters, because you’ll see these identifiers in error stack traces – here only ever inside Main, but you can see what this means for error handling with an actual IDE client, and a project with real procedure scopes.

The idea is not to evolve this app into one, either; it’s just to make a fun way to test the language core and semantics… and diagnostics – the platform, basically. The role of RD-VBA CLI mode is to test the platform end-to-end, hands-on – and being a LSP client means we’ll probably get to write old-school BASIC programs with semantic syntax highlighting in LIST outputs, completion lists for the REPL inputs. Diagnostics are already wired, ANALYZE will start showing meaningful output when providers/extensions issue diagnostics. PEEK/POKE is just C64-like pure unsafe program memory read/write.

RUN runs the program top to bottom, unless you make it do funny things like GoSub, in which case you probably know what you’re doing. If you don’t, …RDCore diagnostics will eventually have your back covered.

Semantics

So the plumbing is in place; what remains is semantics: file I/O statements like Open, Write, Print#, are implemented at the language core layer. Declarations, control flow, error handling as well. Still a lot remains TODO – every single statement keyword must have its semantics implemented, otherwise running them gets you an internal error.

Standard library implementation has begun as well; Len and LenB are the first consumers of the UDT member storage data, and while all the symbols are defined and LSet works as specified on UDT and strings, the vast majority of the standard library remains to be implemented; this is mechanical work that doesn’t need to reach across multiple layers to be a quick gain – so I let Claude/Opus focus on the more meaty parts that do cross into the runtime and memory layout, leaving the simpler, pure functions for later.

Control flow and error handling is fully functional:

BASIC-like RD-VBA code runs end-to-end in the app, …as long as the program doesn’t involve unimplemented semantics.

Removing the On Error GoTo instruction reveals a number of interesting facts about RD-VBA:

First, there’s a difference between an error you raise and an error the runtime raises. Second, errors have a source location pointing to the line number of the faulting instruction, and then there’s a stack trace.

What this doesn’t tell you, is that the platform is showing symbolic line numbers here only because it has no workspace document proper (the internal buffer just simulates one), but in an IDE client the default configuration would be reporting the actual L1C1 document location.

An application error (“VBA00000”) is a run-time error that is raised by the workspace code; a runtime error (“VBR00000”) is a run-time error that is raised in the language core runtime semantics. MS-VBA historically did not really differentiate between these errors; now there’s a structural distinction between them, and it doesn’t break anything!

No Error or Err.Raise statement can ever be mistaken for a runtime error, and we always get a stack trace, even in immediate command mode.

Limitations

Some limitations are inherent to the CLI app being a CLI app: hover tooltips aren’t going to be available, and that’s a given.

Others are design decisions. These include:

  • Program.Main project and procedure scope; intrinsic, cannot be renamed.
  • C64-style program interface, using line numbers as markers for instructions that are stored in the source buffer rather than immediately piped to the interpreter; this makes line numbers inherently mandatory in this client.
  • Line numbers should not prevent the use of line labels, however labels do not currently parse with line numbers. GoTo must therefore refer to line numbers.
  • Line continuations cannot be used; a line number isn’t a valid statement to continue into.
  • Eventually artificially limiting the valid RD-VBA syntax (including comments) in CLI program mode to the BASIC subset of VB, via appsettings.json platform configuration.
  • Eventually limiting the number of logical lines to 10,000; procedure too long compile-time error ought to be raised then, but BASIC mode will probably end up working differently.
  • Exit Sub terminates the program; Exit Function and Exit Property are statically illegal.
  • Sub Main() and End Sub are implicit; the program body is that procedure’s body.
  • Additional Sub procedures cannot be defined (line numbers are illegal on declaration members); use GoSub/Return with wide line numbering gaps to denote subroutines instead.

Other limitations are temporary pre-alpha missing implementations that will definitely be implemented before a v1.0 can ship:

  • REM statements (BASIC-style comments) throwing statement not implemented is objectively funny, but will probably not take too long to get working as the no-op instruction it is.
  • Standard library implementation being incomplete, any function call that refers to a symbol defined there throws not implemented as well.

Unsafe Program Memory Ops

Not (yet?) implemented as keywords, the PEEK and POKE immediate commands allow byte-level unsafe reads and writes (!) from/to a specified address in program memory space. This is obviously dangerous and may lead to crashes, but nostalgia won.

That said LSet and RSet semantics are both implemented, including against UDT values.

🎯 Milestones

The evolution of the RD-VBA language core and runtime implementation is architecturally decoupled from the CLI application, so it’ll automatically throw fewer errors as the language core progresses, without fixing or changing anything anywhere in the CLI app.

That doesn’t mean the work is done, however.

The app supports themes, so if you don’t like C64-style BASIC blue, you might like a modern dark theme instead. It’s only a matter of time before LIST output gets semantic syntax highlighting from the language server!

Leveraging this LSP connection is how the app will turn into something more than a BASIC console. ANALYZE is already wired up to report diagnostics as soon as they start coming.

A BASIC immediate/command/program mode is nice for a platform demo, but the real tool is the non-interactive CLI mode.

Modern tools run in the cloud, from CI/CD scripts that build a project, run its tests, inspect its vulnerabilities and deviations from established coding practices; rdc.exe supports an extensible set of command-line tools exactly for this. Extensions can supply a provider for various commands such as test or analyze, and a CI/CD script could be configured to gate a build on tests passing and diagnostics showing no warnings or errors.

Are you READY?