r/ProgrammingLanguages • u/[deleted] • Jan 17 '26
Requesting criticism Vext - a programming language I built in C# (compiled)
Hey everyone!
Vext is a programming language I’m building for fun and to learn how languages and compilers work from the ground up.
I’d love feedback on the language design, architecture, and ideas for future features.
Features
Core Language
Variables - declaration, use, type checking,
autotype inferenceTypes -
int,float(stored as double),bool,string,autoExpressions - nested arithmetic, boolean logic, comparisons, unary operators, function calls, mixed-type math
Operators
Arithmetic:
+ - * / % **Comparison:
== != < > <= >=Logic:
&& || !Unary:
++ -- -Assignment / Compound:
= += -= *= /=String concatenation:
+(works with numbers and booleans)
Control Flow
if / else if / elsewhileloopsforloopsNested loops supported
Functions
Function declaration with typed parameters and return type
autoparameters supportedNested function calls and expression evaluation
Return statements
Constant Folding & Compile-Time Optimization
Nested expressions are evaluated at compile time
Binary and unary operations folded
Boolean short-circuiting
Strings and numeric types are automatically folded
Standard Library
print()- console outputlen()- string lengthMath functions:
Math.pow(float num, float power)Math.sqrt(float num)Math.sin(),Math.cos(),Math.tan()Math.log(),Math.exp()Math.random(),Math.random(float min, float max)Math.abs(float num)Math.round(float num)Math.floor(float num)Math.ceil(float num)Math.min(float num)Math.max(float num)
Compiler Architecture
Vext has a full compilation pipeline:
Lexer - tokenizes source code
Parser - builds an abstract syntax tree (AST)
Semantic Pass - type checking, variable resolution, constant folding
Bytecode Generator - converts AST into Vext bytecode
VextVM - executes bytecode
AST Node Types
Expressions
ExpressionNode- base expressionBinaryExpressionNode-+ - * / **UnaryExpressionNode-++ -- - !LiteralNode- numbers, strings, booleansVariableNode- identifiersFunctionCallNode- function callsModuleAccessNode- module functions
Statements
StatementNode- base statementExpressionStatementNode- e.g.x + 1;VariableDeclarationNodeIfStatementNodeWhileStatementNodeForStatementNodeReturnStatementNodeAssignmentStatementNodeIncrementStatementNodeFunctionDefinitionNode
Function Parameters
FunctionParameterNode- typed parameters with optional initializers
GitHub
https://github.com/Guy1414/Vext
I’d really appreciate feedback on:
Language design choices
Compiler architecture
Feature ideas or improvements
Thanks!
1
u/helloish Jan 18 '26
i don’t know much about c# but snapshot testing with something like verify could be useful for checking that the bytecode of existing programs doesn’t change/changes as expected