Tinh Linh is a modern programming language developed by the Sao Tin Developer Team, aiming for simplicity, modern syntax, and extensibility.
This repository (https://github.com/TinhLinhLang/TinhLinh) contains the complete Tinh Linh language implementation:
📝 Note: For complete development history and repository evolution details, see REPOSITORY_HISTORY.md.
- Tinh: AOT (Ahead-of-Time) compiler with LLVM backend - optimized for production deployment
- Linh: Interpreter implementation - provides fast development and testing capabilities
- Shared Components (
TinhLinh/Compile/): Common code used by both Tinh and Linh- Lexer, Parser, AST
- Semantic analysis
- Module system
- Type system
- Lithium (.li): The language specification - defines syntax and semantics
TinhLinh/
├── Compile/ # Shared components (Lexer, Parser, AST, Semantic)
│ ├── Parsing/ # Lexer, Parser, AST
│ ├── Semantic/ # Semantic analysis
│ ├── Module/ # Module system
│ └── TypeInfo/ # Type information
├── Tinh/ # Compiler-specific (LLVM CodeGen, AOT compilation)
│ └── (CodeGen, Runtime, etc.)
├── Linh/ # Interpreter-specific (Bytecode, VM, etc.)
│ └── (Interpreter implementation)
└── README.md # This file
- Dual execution modes: Compile (Tinh) or Interpret (Linh)
- LLVM-based compilation: High-performance native code generation (Tinh)
- Fast interpretation: Quick iteration and development (Linh)
- Static typing with type inference: Catch errors at compile time
- Module system: Organize code with imports and exports
- Self-hosting compiler: ✅ Achieved! Tinh can compile itself
- Modern syntax: Clean and intuitive language design
- Variable declarations: Supports
let,const, andvarkeywords - Switch-case statements: Pattern matching support
// Variables with static typing
let x: int32 = 42
let name: str = "Tinh Linh"
// Constants
const PI: float32 = 3.14159
// Functions
func add(a: int32, b: int32): int32 {
return a + b
}
// Control flow
if (x > 0 and x < 100) {
print("In range")
}
while (x > 0) {
x = x - 1
}
// Switch-case
switch (x) {
case 1: print("One")
case 2: print("Two")
default: print("Other")
}
// Modules
import "path/to/module.li"
export func public_function(): int32 {
return 42
}
- CMake >= 3.15
- C++17 compiler (MSVC, GCC, Clang)
- LLVM 14+ (for Tinh compiler)
- Clang (for linking compiled programs)
mkdir build
cd build
cmake ..
cmake --build . --config ReleaseThe build will create:
MiniTinhCompiler.exe- Bootstrap compiler (C++ implementation)- Runtime library for linking
- (Linh interpreter - if enabled)
Compile a Lithium (.li) source file to native code:
# Compile to LLVM IR
tinh your_program.li output.ll
# Compile LLVM IR to object file
llc -filetype=obj output.ll -o output.obj
# Link with runtime
clang -o your_program.exe output.obj runtime.obj
# Run
./your_program.exe(Documentation coming soon)
✅ Self-Hosting Achieved! (March 11, 2026)
The Tinh compiler can now compile itself:
- Boolean type handling fixed
- LLVM IR generation validated
- All type checks passing
- Ready for production use
See SELF_HOSTING_VERIFIED.md for details.
🚧 In Development
Apache License 2.0 - See LICENSE file for details.
- Repository: github.com/TinhLinhLang/TinhLinh
- Website: tinhlinhlang.github.io OR linh.kesug.com / tinh.kesug.com
- Email: linhprogramminglanguage@gmail.com
- Facebook: Tinh Linh Lang
Contributions, bug reports, and ideas are welcome! Please open an issue or pull request on GitHub.
For questions or support, please:
- Open an issue on GitHub
- Email us at linhprogramminglanguage@gmail.com
- Visit our website
© 2025-2026 Sao Tin Developer Team. All rights reserved.