For the past few months, I've been building my own programming language called W-Language.
The primary goal of this project is to learn how programming languages work internally by implementing every major component myself instead of relying on existing compiler frameworks.
Version 0.2 has just been completed, marking the biggest update since the project began.
✨ Features
- 64-bit Runtime
- Custom Virtual Machine (W-VM)
- Custom Bytecode Format (WVM2)
- Recursive Descent Parser
- Lexer written from scratch
- Abstract Syntax Tree (AST)
- Bytecode Compiler
- Bytecode Loader
- Foreign Function Interface (FFI)
- Integer Support
- Floating Point Support
- Boolean Support
- String Support
- Variables
- Functions
- Function Calls
if / elsewhilereturn- Built-in
print()
🏗 Architecture
Source Code
│
▼
Lexer
│
▼
Parser
│
▼
AST
│
▼
Code Generator
│
▼
WVM2 Bytecode
│
▼
Loader
│
▼
Virtual Machine
│
▼
Program Execution
🔥 What's New in v0.2
This release was almost a complete rewrite.
Major improvements include:
- Full migration to a 64-bit runtime
- Replaced the old runtime representation with
std::variant - Improved Virtual Machine architecture
- New WVM2 binary format
- Improved parser
- Improved code generation
- Better runtime diagnostics
- Cleaner project structure
- Migrated from
.hto.hpp - Better FFI implementation
📦 Technologies
The project is written entirely in Modern C++17.
Main concepts used:
std::variant- Smart pointers
- Recursive Descent Parsing
- Bytecode Compilation
- Virtual Machine Design
- Stack Frames
- Runtime Value System
- Binary Serialization
🎯 Why I Built It
This project is mainly for learning.
Instead of using existing compiler frameworks, I wanted to understand how programming languages actually work internally.
During development I learned about:
- Lexical Analysis
- Parsing
- AST Construction
- Compiler Design
- Bytecode Generation
- Virtual Machines
- Runtime Systems
- Binary File Formats
🚀 Roadmap
Planned features for v0.3:
- Arrays
- Objects
- Additional operators
- Expanded Standard Library
- VM optimizations
- More native functions
- Performance improvements
📂 GitHub
The project is fully open source.
Repository:
https://github.com/austrian1painter/W_lang
Feedback, suggestions and code reviews are always welcome.
I'm still learning compiler and language implementation, so constructive criticism is greatly appreciated.
Thanks for reading! 🚀
Top comments (0)