TokenVector Language Support

Official VS Code language support for TokenVector (.tkv, .tv) — an Ahead-Of-Time (AOT) compiled, statically-typed programming language targeting .NET CIL with unboxed scalar types, zero external runtime dependency, and zero-allocation memory performance.

⚡ Quick Start (3 Easy Steps)
Get up and running with TokenVector in less than 2 minutes:
1. Install Extension
Search for TokenVector Language Support in the VS Code Extensions Marketplace (Ctrl+Shift+X) and click Install.
2. Write Your First Program (hello.tkv)
Create a new file hello.tkv and type tkv-entry + Tab (or write the code below):
# -*- coding: utf-8 -*-
# hello.tkv - First Native TokenVector Application
def calculate_sum(a: "i32", b: "i32") -> "i32":
return a + b
def run() -> "str":
print("=== TokenVector Native Application Initialized ===")
a = 15
b = 25
c = calculate_sum(a, b)
print("Computed Result a + b = " + str(c))
return "SUCCESS"
3. Download Compiler tkvc.exe & Run Native Binary
Clone the official TokenVector repository to obtain tkvc.exe and standard libraries (stdlib):
git clone https://github.com/nguyenhungtran18/TokenVector.git
Compile directly to a standalone native PE executable (.exe):
# Compile standalone source code
./tkvc.exe hello.tkv --out hello.exe --entry run
# Or compile with numerical tensor library TokenVector.Numerics
./tkvc.exe main.tkv -r TokenVector.Numerics.dll -o main.exe
Run standalone binary:
.\hello.exe
Console Output:
=== TokenVector Native Application Initialized ===
Computed Result a + b = 40
SUCCESS
- Binary Footprint: Only 8.5 KB with zero external Python runtime dependencies and True No-GIL multithreading.
✨ Features
🎨 Rich Syntax Highlighting:
- Keywords & Control Flow:
def, class, return, if, elif, else, for, while, import, from, with, yield, async, await, lambda, raise, try, except, finally, pass, break, continue.
- Unboxed Scalar Types:
i8, i16, i32, i64, u8, u16, u32, u64, f16, f32, f64, str, int, float, bool, void, TkvInt, TkvStr.
- Compiler Identifiers:
__name__, __file__, self.
- Functions, Classes & Records: Full lexical highlighting for definitions, method calls, typed class fields, and inheritance.
- Operators & Literals: Arithmetic, in-place assignments, comparison, arrow notation (
->), hex and floating-point numbers.
⚡ Productivity Code Snippets:
tkv-entry → Boilerplate application entry point (run() function).
tkv-func → Function declaration with unboxed type annotations.
tkv-class → Class definition with typed fields and methods.
📐 Smart Indentation & Bracket Matching:
- Automatic 4-space indentation following block headers (
def, class, if, elif, else, for, while, try, except).
- Auto-closing pairs for
{}, [], (), "", ''.
💻 Code Example: Object-Oriented Class with Typed Fields
# -*- coding: utf-8 -*-
# vector.tkv - 2D Vector Calculation in TokenVector
class Vector2D:
x: "f64"
y: "f64"
def __init__(self, x, y):
self.x = x
self.y = y
def magnitude_squared(self) -> "f64":
return self.x * self.x + self.y * self.y
def run() -> "str":
v = Vector2D(3.0, 4.0)
mag_sq = v.magnitude_squared()
print("Vector2D magnitude squared: " + str(mag_sq))
return "SUCCESS"
🏛️ Ecosystem & Official Repositories
📋 Scope & Configuration
🤝 Contributing & Feedback
Contributions, bug reports, and syntax suggestions are welcome on the TokenVector GitHub Repository.
📄 License
MIT License © 2026 TokenVector Project / Nguyen Hung Tran.
| |