Skip to content

Latest commit

 

History

History
93 lines (73 loc) · 1.79 KB

README.md

File metadata and controls

93 lines (73 loc) · 1.79 KB

YAIPL - Yet Another Interpreted Programming Language

Written in Rust so its 🚀 blazingly fast 🚀


Types

YAIPL aims to be a dynamically typed language. Supported types are: Integer, Float, Boolean, String, Array.

Syntax and Keywords

Keyword Description
while Loop through a block of code as long as a specified condition is true
for Loop through a block of code a specified number of times
if Execute a block of code if a specified condition is true
return Explicitly return a value

Assignment

Creating and reassigning variables is done using the = operator.

# Assignining variables
my_variable = 5

# Reassigning variables
my_variable = 10

You can also create and REASSIGN functions using the = operator.

# Defining a function
my_function = (param) {
    param + 5 # Implicit return
}

# Reassigning a function
my_function = (param) {
    param * 5
}

# Calling the function
print(my_function(5)) # returns 25

Built-in Functions (Native Functions)

Function Description Returns
print(arg) Prints the value of the argument to the console "void"
println(arg) Same as print, but appends a '\n' at the end for a new line "void"
typeof(value) Returns the type of the value "int" | "float" | "bool" | "string" | "function" | "nfunction" | "void"