Active Development · M2 Achieved

c3 — The Next-Gen
VB6 Compiler

Modern compiler that takes your VB6 code to the x64 era — with Unicode, multi-threading, and zero-modification compilation built in.

x64 · Unicode · Multi-threaded · Zero modification

8,178
Lines of Code
80+
AST Node Types
14
Precedence Levels
200+
RTL Functions Planned

c2 → c3: Three Generations of Progress

VB6's original compiler c2.exe targets x86 only. c3.exe brings three fundamental upgrades.

Capability c2.exe (VB6) c3.exe (vb6c3)
Architecture x86 (32-bit) x64 (64-bit) NEW
String Encoding ANSI / BSTR Unicode (UTF-16) NEW
Threading Single / STA Multi-threaded NEW
Runtime MSVBVM60.dll Static-linked (no DLL)
Debug Info PDB PDB (MSVC native)
C Code Output No Yes (debuggable)

Everything VB6 Needs for the Modern Era

No source code modification required. Your VB6 projects compile as-is.

Native x64 Compilation

Generate 64-bit Windows executables and DLLs. Break the 2GB memory barrier. Direct x64 COM interop via MSVC ABI.

First-Class Unicode

BSTR strings are UTF-16 throughout. Source files support UTF-8/GBK/UTF-16 encoding with automatic detection.

Multi-threaded Runtime

No more single-threaded apartment model. Free-threaded COM, CreateThread, and true parallel execution.

VBA Compilation

Compile VBA code alongside VB6 projects. Supported as a first-class compilation target.

Static-Linked RTL

No runtime DLL dependency. All 200+ VB6 runtime functions are compiled directly into your executable. Clean deployment.

Safe Compilation

Unsupported syntax always reports an error. Never silently miscompiles. Miscompilation is worse than no compilation.

VB6 Source → Native Binary

C code generation + MSVC gives you readable, debuggable output with zero external dependencies.

📄
VB6 Source
🔍
Lexer
🌳
Parser
📎
AST
🛠
Semantic
💻
C Code
cl.exe
🚀
.exe/.dll

Development Progress

Milestone-driven development. Every phase must pass verification before advancing.

M1

P0 — Infrastructure

CMake build, diagnostics, source manager (GBK/UTF-8/UTF-16), LL(2) lexer, compiler driver

Completed
M2

P1 — Parser & AST

Recursive descent + Pratt (14 levels), 80+ AST nodes, soft keywords, ~2900 lines parser code

Completed
P2

P2 — Semantic Analysis

Symbol table, type system, Variant inference, default property resolution, type checking

Next Up
P3

P3 — C Code Generation + MSVC

VB6→C type mapping, expression/stmt/proc codegen, cl.exe + link.exe driver

Planned
P4

P4 — Runtime Library (RTL)

BSTR, Variant, SAFEARRAY, 200+ runtime functions, all statically linked

Planned
P6

P6 — VBA Compilation Support

Compile VBA code from Office documents as first-class target

Planned

Developer-Friendly CLI

Clean, composable command-line interface designed for CI/CD pipelines and build automation.

  • --dump-tokens Inspect lexer output
  • --dump-ast Visualize parse tree
  • --syntax-only Fast syntax validation
  • --target win-x64 Cross-target support
  • -O2 -g Optimize + debug info
$ c3 hello.bas --dump-ast
Module: hello.bas
  Sub Main (access=Public)
    LocalDecl → Dim name As String
    Assign: name = "World"
    If → Else → End If
    For i = 1 To 10 → Next i
    ✓ 0 errors, 0 warnings

$ c3 hello.bas -o hello.exe -O2
✓ Compiled: hello.exe (x64)

Ready to Bring VB6 to x64?

c3 is under active development. Follow progress or try the latest build.