Package: exo-language
ExoThe is a programming language designed to be simple and fast, written in pythonInstallationThis project was built on Python 3
To install Exo, (after you install python) run the command:pipinstallexoUsageRunning the Exo codeexopath/to/file.exoLanguage SpecificationNote: Comments start with a #, similar to python. There are no multiline commentsData TypesThere are four data types that the user can use: integer, float, string and function. In general, the following is true for operations:an Int and an Int will result in an Inta Float and a Float results in a Floata Float and an Int will result in a Floatany number type and a String will result in a stringLiteralsLiterals are values like5, "hello", 6.6. A number is considered a float if it has a decimal point; otherwise it is taken as an int. String literals are surrounded in quotation marks.VariablesVariables are dynamically typed (data types can be changed). There is type inference, but you can explicitly state the type of the variable if you want the type to be explicit. Once you set the type explicitly, it cannot be changed.var x = 5 + 3.0 # 5 + 3.0 = 8.0 so x is a float
string y = "Hello" + " World" # y is now a string
var y = "Hi" # y is now 'Hi'
int y = 1 # This will throw an error
var y = 1 # This will also throw an errorvar x = 5
var x = 3The syntax for initialization and assignment is identical.var a = 6.0
var a = a + 1If StatementsIf statements follow the following format:if (condition){
  statements  #indents are optional
} elif (condition){
  statements
} else{
  statements
}The elif clause is optional or can also be used as many times as necessary in a single if statement.if statements can be nested. The else statement is also optional and can be ommited entirely:if (condition){
  statements
}There is no boolean type in the language. Therefore the condition can also be an integer. If its value is 0, it will qualify as false, otherwise as truex > 3
x + 1 < 40/x
5While LoopsA while loop can be represented like so:while (condition){
   statements
}While statements can also be nested inside one another and combined with If statements flexibly.int a = 1
while (a < 5) {
  int a = a + 1
  print(a)
}For LoopsA for loop can be represented like so:for type(int / float) identifier in (initial, final, step){
  statements
}Note that initial is inclusive and final is exclusive
For example:for int a in (1, 5, 1){
  print(a)
}Will output:1
2
3
4These will not work:for var b in (1, 5, 2){
  print(b)
}

for string c in ("hi", "hiiiii", "i"){
  print(c)
}ListsList usagevar x = [1, 2, 3]
var y = [4, 5, 6]List ElementsList elements can be accessed through the square bracket notation:var y = x[1] + 6  # x[1] gives the 2nd element of the list xThey can be assigned to just like variables, and there are no type checks on the element added to the array:var x[10] = 345 + 3PrintThe print statement prints whatever it is given to the screen.print("Hello World")It can be given variables, expressions, and array indices.print(5 + (4.0 * 3))
print(x + y[1])
print("Hello" + " " + "World")InputThe input statement takes user input. There are 2 types: input, and input_intvar x = input() #This will be stored as a string value
var y = input_int() #This will be stored as an int valueIt can only take String and Int inputs.FunctionsFunctions are defined like so:fun (type) name(type arg1, type arg2){
  statements
  (return statement)
}Providing a type to the function is optional. If no type is provided, no type checks are performed on the return value
Providing a type to the argument is mandatory. If you do not wish to perform type checks, you can use the type 'var'fun double(int a){
  int b = a * 2
  return b
}

fun int triple(int a){
  return a * 3
}

fun concat_print(string a1, string a2){
  var a3 = a1 + " " + a2
  print(a3)
}

fun float double_2(int a){
  int b = a * 2
  return b
} # This will throw an error, since the output is always an int

fun triple_2(int a){
  return a * 3
}

triple_2(1.0) # This will throw an error, since a is supposed to be of type int

fun concat(string a1, var a2){
  return a1 + " " + a2
}

concat("Hello", "World") # This will run fine
concat("Hello", 1) # This will also run fine
concat(1, 1) # This will throw an error, since a1 is supposed to be of type stringIf there is no return statement, the function will return 0
IMPORTANT NOTE: Nested return statements are not supported as of v0.1.x
Support will be added for these in the futureThis is the syntax to call a function:function(arg, arg2, ...)The function call can be used just like a normal variable. For example:var z = list1[add(x,y) - 2]