================
Welcome to the Ven Engine, an interpreted virtual machine designed to process the extremely fast Ven language. Below is a detailed overview of the project, its components, and its functionalities.
Ven is an interpreted language that offers high efficiency and speed, suitable for various programming tasks. The Ven Engine reads .ven files, tokenizes the input, parses it into an Abstract Syntax Tree (AST), and then optimizes and executes the AST.
The tokenizer in Ven is ultra-fast with minimal overhead, ensuring rapid processing of the input files.
The parser converts tokens into an AST, handling variable declarations, input, and output operations, as well as mathematical expressions.
The optimizer refines the AST by removing unused variables and combining consecutive print statements for improved performance.
Comprehensive error messages guide users in debugging their Ven scripts by providing detailed explanations of any issues encountered.
The project is organized into several key modules, each responsible for a specific aspect of the language processing:
The entry point of the application. It handles command-line arguments, reads input files, and initiates the tokenization and parsing processes.
Contains the tokenizer logic, converting raw input into a sequence of identifiable tokens.
Implements the parsing logic, transforming tokens into an AST while handling syntax rules.
Houses optimization passes that enhance the AST by simplifying operations and removing redundancies.
Provides error messages for common issues like type mismatches and undeclared variables.
Provides different transpilers allowing conversion of Ven's code to other languages
Ven language features a straightforward syntax designed for clarity and efficiency:
Use @ for static and @@ for mutable declarations.
| Declaration | Example |
|---|---|
@ name str "jay" |
Static declaration |
@@ age str 16 |
Mutable declaration |
To output expressions, use >> for stdout with support for placeholder substitution.
| Syntax | Description | Example |
|---|---|---|
>> expression |
Print to stdout with placeholders replaced | >> Hello {name}! |
>>> expression |
Print to stderr with placeholders replaced | >>> Error: {error_message} |
Placeholders within curly braces {} are replaced with the corresponding variable values.
Perform basic arithmetic with * for operations like addition, subtraction, multiplication, and division.
| Operation | Example |
|---|---|
* age + 2 |
Addition |
* age - 2 |
Subtraction |
* age * 2 |
Multiplication |
* age / 2 |
Division |
Ven is licensed under Ven License
Any contributions to Ven Engine are governed by the same license. By contributing to Ven Engine, you agree to the terms of the license. Any contributions are prohibited from editing the SHELL.md file under any scenarios.