August 2026 - August 2026
KTNLang
Kompiles To Nothing Lang - My first foray into writing interpreters
JavaKTNLangInterpreters
About this project
KTNLang is a project built without AI assistance as I learnt to about building interpreters. I followed the book Crafting Interpreters for the concepts.
KTNLang is a dynamically typed language with the following features:
- Numbers, strings, booleans, and
nil - Arrays
- Arithmetic operators
- Comparison and equality operators
- Unary operators
- Comma operator
- String concatenation
- Variables and assignment
- Lexical scoping and variable shadowing
- Nested blocks
if / else- Short-circuiting
and / or whileloopsforloopsbreak- Functions with parameters
- Return values
- Recursion
- Closures
- Native functions:
clock()andlen() _ARCHglobal variable- Array literals
- Array indexing
- Array mutation
- String indexing
- Array concatenation with
+ - Classes and instances
- Instance fields
- Methods
- Constructors via
init this- Inheritance
- Method overriding
super- Static lexical resolution
- Semantic error detection
- Parser and runtime error handling
- File execution
- Interactive REPL
Gallery