The most epic sauce programming language ever!!! :3
If you find bugs, create an issue!
- Functions, such as
println(n)
, will have parenthesis around arguments. - Functions can be nested nearly infinitely.
- Spp is a zero-indexed language.
- Files in the Ether format will be denoted with the file ending ".etr".
- The Config.json file is necessary for the interpreter to function.
- Line breaks, spaces, and tabs are not neccessary for the program to run.
- An exception to this are comments.
- Enables multiple functionalities meant for debugging purposes.
- If the value of "Debug" is set to 1, the interpreter does the following:
- Prints the whole Config.json file to the console upon loading it.
- Prints the program file's contents to the console upon loading it.
- Prints the length of the file to the console.
- Prints the amount of time it took for the file to be parsed for keywords.
- Denotes when no errors occurred while parsing the file.
- Shows the list of keywords after the file has been parsed.
- Prints to the console when
exit()
is used.
- Enables or disables the file picker that appears when running Interpreter.py
- If the value is set to 0, Interpreter.py uses the file stored in "Default_file"
- Stores the path for the program file that Interpreter.py uses when "File_picker" is set to 0.
- Announces comments in the console when passing over them.
- Determines how many previous keywords are displayed when an error message is displayed.
- Starts with a hashtag.
- Ends with a new line.
- Comments can also go at the end of a file, even without a trailing new line.
- If the "Announce_comments" value of Config.json is set to "1", they will be announced when passed over.
- Instantly exits the program, with n as the exit code.
- Prints the exit index & where
- n = A value of type string or int.
- Prints n to the console in a line.
- n = A value of any type.
- Prints n to the console, without a new line.
- n = A value of any type.
- Prints n to the console, with x as the ending.
- n & x = Values of any type
- Asks the user for an input, then returns that input.
- Uses X as the stem when asking for the input.
- X = A value of any type.
- Raises an error with X as the error code.
- X = a value of type string
- Assigns variables
- x = The name of a variable
- n = A value of any type.
- Spaces are optional.
- Variable reassignments don't need the "Let:" keyword
- Example:
let: x = 7
let: y = x
x = 3
y = add(x, y)
print(y) # 10
- Returns the type of X.
- X = a variable of any type
- Returns the length of X.
- X = a variable of any type.
- Increments var by one.
- Faster when interpreting than saying
i = add(i, 1)
- Decrements var by one.
- Faster when interpreting than saying
i = subtr(i, 1)
- Joins X & Y into one string.
- Returns a string.
- x & y = Values of any type
- Spaces are optional
- Slices X, like the built-in python function.
- X = the value to be sliced, of type string.
- start, end, & step = integers
- Spaces are optional
- Returns the shuffled version of X.
- x = A value of any type.
- Returns the Yth character of X.
- (Zero-indexed)
- X = Value of type string.
- Y = Value of type integer.
- Replaces the Yth character of X with Z.
- (Zero-indexed)
- X & Z = Values of type string
- Y = value of type integer.
- Removes Y from X, and returns the result.
- Y & X = Values of type string.
- Spaces are optional
- Inverts the input & returns the result.
- x = a value of type boolean.
- Returns the logical AND of X & Y.
- x & y = values of type boolean.
- Spaces are optional
- Returns the logical OR of X & Y.
- x & y = values of type boolean.
- Spaces are optional
- Returns the logical XOR of X & Y.
- X & Y = values of type boolean
- Spaces are optional
- Evaluates the mathematical expression inside and returns the result.
- To use variables, use curly braces with the variable name inside, like
{index}
. - Supported symbols:
+
- Addition-
- Subtraction*
- Multiplication/
- Division%
- Modulus^
- Exponentiation()
- Parenthesis{}
- Variable usage
- Adds X & Y, and returns the result.
- X & Y = values of type integer.
- Spaces are optional.
- Subtracts Y from X, and returns the result.
- X & Y = values of type integer.
- Spaces are optional.
- Multiplies X & Y together, and returns the result.
- X & Y = values of type integer.
- Spaces are optional.
- Floor divides X by Y, and returns the result.
- X & Y = values of type integer.
- Spaces are optional.
- Raises X to the power of Y, and returns the result.
- X & Y = values of type integer.
- Spaces are optional.
- Modularly divides X by Y, and returns the result.
- X & Y = values of type integer.
- Spaces are optional.
- Takes the square root of X and returns that value (rounded down).
- X = a value of type integer.
- If X is true, code inside the brackets gets ran.
- Otherwise, skip to the closing bracket.
- Spaces are optional
- Line breaks are possible inside the brackets.
- Checks if both values are equal
- Returns either True or False.
- x & y = Values of any type
- Spaces are optional
- Checks if X is greater than Y.
- Returns either True or False.
- x & y = Values of either int or string.
- Spaces are optional
- Checks if X is less than Y.
- Returns either True or False
- x & y = Values of either int or string
- Spaces are optional
- While X is true, repeat the code inside the loop.
- If X is false, the loop will end when the closing bracket is reached.
- Condition checks are only made when the closing bracket is reached.
- If X is false on the first check, no code inside the brackets will be ran.
- X = A value of type boolean.
- WARNING: Using this can lead to an infinite loop, only able to be broken out of with Ctrl + C.
- Spaces are optional.
- Repeats code inside the brackets X amount of times
- X = a value of type integer
- Spaces are optional.
- Line breaks are possible inside the brackets.
- Breaks out of the highest level loop.
- Does not require any arguments or inputs.
- Defines a function with the name foo.
- Foo will take in two values as its inputs, bar and baz.
- Input variables NEED to be defined before creating the function.
- Input variables also need to be defined as a string in the function definition. (fix this later)
- Returns a value if
-> {type}
is included, otherwise it returns none. - When called, the code inside the brackets will be run.
- This example is called with the format
foo("argument 1", "argument 2")
- This example is called with the format
- Only used inside of functions.
- Returns X out of the function.
- Unless there's no
-> type
included OR if-> none
is included when defining the function, then nothing should be included after it.
- Unless there's no
- Is required for any function to return from itself properly without breaking.
- Cannot be inside of a
while
orfor
loop, as it must be at the function's base level. (fix this later)- You can get around this by using a variable to store the function's return value before actually returning.
- Example: (
rBoolean
is the return value)
let: string = "";
let: character = "";
let: rBoolean = False;
let: indexOfChar = 0;
define isCharInString("string", "character") -> boolean: {
indexOfChar = subtr(0, 1);
rBoolean = False;
fornumb(len(string)): {
indexOfChar++
if(isequal(gtchar(indexOfCharacter, string), character): {
rBoolean = True;
break
}
}
return rBoolean
}
- Pauses the program for n seconds.
- N = A value of type integer.
- Pauses the program for n milliseconds.
- N = A value of type integer
- Starts the timer, which runs until timer.stop() is called.
- Restarts the timer.
- Stops the timer.
- The timer value is frozen at the ending value, so you can still use
timer.get()
after stopping the timer.
- Gets the current timer value.
- Returns the current value as a string.
- Returns a random integer between x & y, including both x & y.