Unique type representing a built-in function included within the language.
The bark built-in is used for printing values to the terminal.
obj x = 10;
bark(x); # output: 10
The chew built-in is used for getting standard input (stdin) from the terminal.
obj input = chew("Enter some text: ");
bark("You typed: " + tostring(x));
The isnumber built-in is used for checking if an object is a number (returns true if number otherwise returns false).
obj x = 10;
bark(isnumber(x)); # true
The isstring built-in is used for checking if an object is a string (returns true if string otherwise returns false).
obj x = "a string";
bark(isstring(x)); # true
The islist built-in is used for checking if an object is a list (returns true if list otherwise returns false).
obj x = [1, 2, 3, 4];
bark(islist(x)); # true
The isfunction built-in is used for checking if an object is a function (returns true if function otherwise returns false).
bark(isfunction(type)) # true
The isbuiltin built-in is used for checking if an object is a built-in function (returns true if built-in otherwise returns false).
bark(isbuiltin(type)) # true
The tostring built-in is used for converting any object to it's string representation.
obj x = 10;
bark("x is equal to: " + tostring(x)); # output: x is equal to: 10
The tonumber built-in is used for converting a string to a number.
obj x = "2.14";
obj x = tonumber(x);
bark(x + 1); # output: 3.14
The push built-in is used for adding a value to a list and returning the new copy.
obj x = [1, 2, 3];
obj x = push(x, 4);
bark(x); # output: [1, 2, 3, 4]
The append built-in is used for combining a list with another list and returning the new copy.
obj x = [1, 2, 3];
obj y = [4, 5, 6];
obj new_list = append(x, y);
bark(x); # output: [1, 2, 3, 4, 5, 6]
The remove built-in is used for removing a value at the specified index from a list and returning the new copy.
obj x = [1, 2, 3];
obj x = remove(x, 0);
bark(x); # output: [2, 3]
The retrieve built-in is used for getting a value at the specified index from a list and returning that value.
obj x = [1, 2, 3];
obj value_in_list = retrieve(x, 0);
bark(value_in_list); # output: 1
The reverse built-in is used for reversing a list and returning the new copy.
obj x = [1, 2, 3];
obj reversed_x = reversed(x);
bark(reversed_x); # output: [3, 2, 1]
The reversed built-in is used for returning a copy of a list reversed.
object x = [1, 2, 3]
object y = reversed(x)
bark(x) # output: 1, 2, 3
bark(y) # output: 3, 2, 1
The join built-in is used for combining two strings together and returning the new copy.
obj x = "Hello, ";
obj y = "world!";
bark(join(x, y)); # output: Hello, world!
The clear built-in is used for clearing a list or string and returning the new copy.
# list
obj x = [1, 2, 3, 4];
obj x = clear(x);
bark(x); # output: []
# string
obj x = "This is a string";
obj x = clear(x);
bark(x); # output:
The length built-in is used for returning the length of all the values in either a string or list.
obj x = "this string is long";
obj y = [1, 2, 3];
bark(length(x)) # output: 19
bark(length(y)) # output: 3
The fetch built-in is used for importing values from other .glang files. If you are want to learn more about modules, see our section on modules.
fetch(std_math);
bark(math_pi); # object defined in the math module
The dig built-in is used for retrieving the contents of the specified file name.
obj contents = dig("example.txt");
bark(contents); # output: <contents of example.txt>
The bury built-in is used for writing a string of file contents to the specified file name.
bury("example.txt", "These are some contents in a file");
bark(dig("example.txt")) # output: These are some contents in a file
The uhoh built-in is used for throwing an error to the interpreter with the specified details.
if 1 == 1 {
skip;
} otherwise {
uhoh("math is broken!!");
}