Skip to content

venti is an simple programming languange that made with rust, i made it because i love venti lol

Notifications You must be signed in to change notification settings

mornsoltice/venti

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Venti

venti is an simple programming languange that made with rust

TODO

  • Printing and Variable Creation
  • Looping
  • Function Definitions
  • Error Handling
  • Compiler Integration with LLVM
  • Data Structures(e.g., array, lists)
  • Control Flow Statements(e.g., conditionals)
  • Basic Math Operation
  • Type System Implementation
  • Memory Management
  • Foreign Function Interface (FFI)
  • Concurrency and Parallelism Features
  • Standard Library Functions
  • Documentation and Examples

Example

Basic Syntax

# venti nama_variabel = data_type;
venti contohString = "I Love Venti";
venti contohInteger = 69;
venti iLoveVenti = true;

printventi(contohString);
printventi(contohInteger);
printventi(iLoveVenti);

venti myArray = ["i", "love", "venti"];
printventi(myArray);

venti myNestedArray = [[1, 2], [3, 4], [5, 6]];
printventi(myNestedArray);

Type Annotations

venti x: int = 5;
venti y: float = 3.14;
venti z: bool = true;

funcVenti add(a: int, b: int) {
    venti result: int = a + b;
    print(result);
}

add(5, 10);

Basic Math Operations

venti operasi = (4 + 4 * 2)/2;
print(operasi);

venti faktorial = factorial_venti(5);
print(faktorial);

Looping (For Loop & While Loop)

for_venti i in 100 {
    venti myString = "I Love Venti 100x";
    print(myString);
}

while_venti(true) {
    venti myString = "I Love Venti";
    print(myString);
}

Function

funcVenti myFunction(a, b) {
    venti result = a + b;
    printventi(result);
}

venti x = 10;
venti y = 20;
myFunction(x, y);

Conditionals

venti x = 1;
if_venti(x > 1) {
    venti result = "i love venti";
    printventi(result);
} else_venti {
    venti result = "i really love venti";
    printventi(result);
}

Variable & Functions With Memory Management

venti str: string = "I Love Venti!";
print(str);

venti arr: array = [1, 2, 3];
print(arr);

funcVenti append(arr: array, val: int) {
    arr.push(val);
}

append(arr, 4);
print(arr);

Installation

  1. Clone the repo and cd into it
  2. Run cargo build to build it from source
  3. Then you execute the compiled binary using the command below:
target/debug/venti -h

Compiling

Write some valid venti code like the following:

printventi("i love venti");

Now compile it using

lli ~/output.ll

NOTE: Venti is currently on development mode. At the moment, it only supports basic features like printing, making variable, data types, looping, etc. I plan to add more features. And venti doesn't generate executable binaries yet, it generates LLVM IR in a file called output.ll in the same folder as the source file that you can run with the lli command that comes with your LLVM installation.

About

venti is an simple programming languange that made with rust, i made it because i love venti lol

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages