Project Codename: BasicForge
Project Type: Native Programming Language, Compiler Toolchain and Visual IDE
Initial Target: Windows 10/11 — x64
Compiler Implementation: C and C++
IDE Implementation: Rust
Output: Native Windows PE32+ executable (.exe)
BasicForge is a new, independent programming language and development environment combining:
- The readability and simplicity of Visual Basic 6 and VB.NET.
- The performance and control of native compiled languages.
- The power of modern compiler optimization (via clang/LLVM).
- A modern Visual Basic-inspired visual development environment.
- Native Windows PE32+ executable generation.
BasicForge is not a wrapper around an existing compiler, nor a source-to-assembly translator. It has its own language frontend, semantic model, intermediate representation (IR), and native code-generation pipeline. The default backend emits C and compiles it with clang/lld-link; an optional LLVM C++ backend can be enabled when LLVM development headers are available.
- Windows 10 or Windows 11 (x64)
- A C++ compiler (clang-cl or MSVC) for building bfc.exe
- Rust toolchain (cargo, rustc) for building the IDE
- LLVM/clang toolchain (
clang.exe,lld-link.exe) — auto-detected
cd C:\Users\manshadi.PDF\Desktop\BasicForge\compiler
cmake -S . -B build -G Ninja -DCMAKE_BUILD_TYPE=Release -DBFC_BUILD_TESTS=ON
cmake --build build --config ReleaseLLVM is auto-detected. Set BFC_LLVM_ROOT (CMake) or BFC_LLVM_BIN (runtime,
directory containing clang.exe/lld-link.exe) if LLVM is not in
C:\Program Files\LLVM.
For the optional direct LLVM/LLD backend, install the LLVM development
libraries and headers (LLVM.lib, LLD.lib, llvm/IR/Module.h); CMake then
defines BFC_LLVM_HEADERS_AVAILABLE automatically. Without them, the compiler
uses the C emission backend (clang + lld-link).
cd C:\Users\manshadi.PDF\Desktop\BasicForge\compiler
ctest --test-dir build -C Release --output-on-failure
# End-to-end compile-and-run suite (hello, math, loops, classes, concat)
.\tests\run_tests.ps1The suite covers lexer, parser, semantic analysis, IR, diagnostics, fuzz smoke
tests and end-to-end compilation (including classes, methods, properties and
VB-style & concatenation).
cd C:\Users\manshadi.PDF\Desktop\BasicForge\ide
cargo build --releasebfc ships a real LSP server for external editors:
{"command": "C:\\...\\BasicForge\\bfc.exe", "args": ["--lsp"]}Supported: initialize, shutdown, full-text didOpen/didChange/didSave/
didClose with publishDiagnostics, keyword completion, hover and
go-to-definition (symbol table built from the parser).
A Form declaration compiles to a real Win32 window with controls and event
handlers:
Module Main
Form MainForm
Width = 640
Height = 480
Text = "My App"
Button btnOK
Text = "OK"
Left = 20
Top = 20
Width = 100
Height = 32
OnClick = btnOK_Click
End Button
TextBox txt
Text = "hello"
Left = 20
Top = 70
Width = 200
Height = 24
End TextBox
End Form
Sub Main()
Print(GetText("txt"))
End Sub
Sub btnOK_Click()
Print("clicked")
End Sub
End ModuleSupported controls: Button, Label, TextBox, CheckBox, RadioButton, GroupBox,
Panel, PictureBox, ListBox, ComboBox, TrackBar, ProgressBar, DateTimePicker,
ListView, TreeView, RichTextBox, TabControl, ToolBar, StatusBar, UpDown. Events: OnClick (Click/CheckedChanged),
OnDoubleClick, OnTextChanged, OnSelectedIndexChanged, OnValueChanged,
OnAfterSelect, OnScroll, OnGotFocus, OnLostFocus, OnKeyDown,
OnKeyUp, OnMouseMove, OnMouseEnter, OnMouseLeave, OnMouseWheel,
OnPaint and OnDragDrop. GetText("name") / SetText("name", value) access
controls by name. The IDE Form Designer generates this syntax directly.
libraries/stdlib contains pure BasicForge modules. Include them inside a
module (they contain only Sub/Function, not their own Module):
Module Main
Include "math.bf"
Include "string.bf"
Include "array.bf"
Include "file.bf"
Include "date.bf"
Include "console.bf"
Include "json.bf"
Include "csv.bf"
Include "validation.bf"
Include "random.bf"
Sub Main()
Print(Clamp(15, 0, 10))
Print(IsPrime(97))
Print(ToUpper("hello"))
End Sub
End ModuleCompile with -I libraries/stdlib. bfc.exe also searches libraries/ and
libraries/stdlib/ relative to the executable automatically.
sdks/ contains Win32 wrappers (sdks/win32/win32.bf,
sdks/win32/environment.bf) and JSON/CSV wrappers. Include is recursive and
deduplicated, so wrappers can include stdlib modules safely.
bfc.exe app.bf -o app.exe --target console # console (default)
bfc.exe app.bf -o app.exe --target gui # WinMain / windows subsystem
bfc.exe lib.bf -o lib.lib --target staticlib # static library
bfc.exe lib.bf -o lib.dll --target sharedlib # DLL (DllMain)sharedlib uses the CRT aliases (/ALTERNATENAME) and ucrt.lib; a .def
file can be added to export functions.
The IDE debugger panel drives the native bfc debug through a pipe:
- Start / Continue / Step / Stop buttons
- Breakpoint list
- Editable registers (
setreg) - Disassembly view (
disasmvia llvm-objdump) - Call stack and live debug output
The CLI supports INT3 breakpoints (function or file:line), continue,
single-step, backtrace, registers, globals and --script automation.
bfc.exe debug MyApp.exe
(bfdbg) break Main
(bfdbg) continue
(bfdbg) registers
(bfdbg) backtrace
(bfdbg) print MyGlobal
(bfdbg) quit
Supported: INT3 breakpoints by function or file:line, continue, single-step,
backtrace, register inspection, global/address reads.
# Compile a .bf source file to a PE32+ executable
bfc.exe examples\HelloWorld.bf -o HelloWorld.exe
# Run the generated executable
HelloWorld.exeBasicForge is a case-insensitive, strongly typed language with Visual Basic-inspired syntax.
Dim age As Integer = 25
Dim name As String = "Iliya"
Dim enabled As Boolean = True
Dim total = 100 ' Type inferenceIf age >= 18 Then
Print("Adult")
Else
Print("Minor")
End IfFor i As Integer = 1 To 10
Print(i)
Next
While condition
Print("Working")
End WhileSelect Case value
Case 1
Print("One")
Case 2
Print("Two")
Case Else
Print("Other")
End SelectSub SayHello(name As String)
Print("Hello " & name)
End Sub
Function Add(a As Integer, b As Integer) As Integer
Return a + b
End FunctionModule Main
Sub Main()
Dim result As Integer = Add(10, 20)
Print(result)
End Sub
End ModuleFields, auto-properties, constructors, methods and Me are supported
end-to-end (including As New and method calls):
Module Main
Class Person
Public Name As String
Public Age As Integer
Public Sub New(name As String, age As Integer)
Me.Name = name
Me.Age = age
End Sub
Public Function GetInfo() As String
Return Me.Name & " is " & CStr(Me.Age)
End Function
End Class
Sub Main()
Dim p As New Person("Alice", 30)
Print(p.GetInfo())
End Sub
End ModuleLeft, Right, Mid, InStr, Format, Len, Trim, Replace, Split, Join
Dim name As String = "BasicForge"
Print($"Hello {name}!") ' Hello BasicForge!$"..." embeds expressions in {...}; {{/}} escape literal braces.
CInt, CLng, CDbl, CStr, CBool
For Each, Do / Loop, Try / Catch / Finally (planned)
BasicForge/
├── compiler/ # C++ compiler frontend, semantic analysis, IR, codegen
├── ide/ # Rust desktop IDE
├── runtime/ # Minimal native runtime (C/C++)
├── libraries/ # Standard library
├── examples/ # Example .bf programs
├── tests/ # Compiler and IDE tests
├── docs/ # Language specification and syntax docs
├── ARCHITECTURE_DECISIONS/ # Architecture decision records
├── THIRD_PARTY_NOTICES.md # Third-party attribution
├── DEPENDENCIES.md # Dependency registry
├── DEPENDENCY_LICENSES.md # License compatibility
├── LANGUAGE_SPECIFICATION.md# Formal language specification
└── README.md # This file
BasicForge reuses mature open-source infrastructure:
- clang/LLVM — C emission, optimization and toolchain (Apache 2.0 + LLVM Exception)
- LLD — Windows PE/COFF linker (Apache 2.0 + LLVM Exception)
- egui — Rust GUI framework (MIT OR Apache-2.0)
- tower-lsp — Language Server Protocol (MIT OR Apache-2.0)
- tree-sitter / rowan / salsa — Incremental parsing and syntax trees (MIT OR Apache-2.0)
- gimli / goblin / LIEF — Binary parsing and debug info (MIT OR Apache-2.0)
- Ninja — Build system (Apache 2.0)
See THIRD_PARTY_NOTICES.md and DEPENDENCY_LICENSES.md for full attribution.
See LICENSE for details.
Third-party components retain their original licenses and attribution notices.
| Milestone | Status | Description |
|---|---|---|
| M0 | ✅ | Research and architecture |
| M1 | ✅ | Build infrastructure |
| M2 | ✅ | First working compiler (HelloWorld → PE32+ EXE) |
| M3 | ✅ | Core language (variables, types, arithmetic, conditions, loops, sub/functions, modules) |
| M4 | ✅ | Classes, properties, constructors, methods, arrays, enums, type conversion, string functions, Do/Loop (verified end-to-end) |
| M5 | 🔄 | Runtime (memory, file I/O, exception handling) |
| M6 | ✅ | Rust IDE (editor, project explorer, build/run, diagnostics, form designer UI) |
| M7 | ✅ | bfc --lsp server: diagnostics, completion, hover, definition |
| M8 | ✅ | Visual Form Designer → native Win32 forms (Button/Label/TextBox/...) |
| M9 | ✅ | Native debugger CLI (bfc debug): breakpoints, step, backtrace, print |
| M10 | ⏳ | Optimization and stability |
| M11 | ⏳ | Documentation and release |
- Windows x64 only. The compiler, runtime, forms and debugger target
x86_64-pc-windows-msvc. This is intentional and not planned to change. - Form Designer scope. Forms compile to Win32 windows with the 10 supported
controls and Click/TextChanged events. The IDE designer can create/open/save
forms and emits compilable
Formcode. - Debugger scope.
bfc debugsupports conditional INT3 breakpoints (break <name> if <cond>),locals/stack,watch/unwatch,setreg,disasm,threads,delete,enable/disableand--script. The IDE panel drives it and shows disassembly and editable registers; source-level locals from PDB local info are not implemented yet. - LSP scope. Hover/definition use the current file plus a workspace-wide symbol index with function signatures, parameter types and class members. Diagnostics run the semantic analyzer with workspace symbols registered, so cross-file type mismatches are reported.
- No cross-compilation and no bundled LLVM; LLVM/clang/lld-link are
detected from
BFC_LLVM_ROOT/BFC_LLVM_BIN/ PATH.
See CONTRIBUTING.md for guidelines on contributing to BasicForge.
For questions, issues, or contributions, please open an issue on the project repository.