ilang is designed to be a new type of programming lanuage that supports different types of programming paradimes with a focus towards artificial inteligence
-h this help document -f [file] the start file -v # debug level –version dispay version -d set location of database files
In a typical programming lanuage, nearly everything created has a name given to it, for example consider the following C++ code:
class Name {
};
In this code, the class is created under the name Name.
In ilang, the consepts are vastly different, class, objects, function, anything is created without a name. The name/scope system is mearly provided to give a programmer a means of accessing something that was created else where. In this since everything can be considered to be name-less and assigned to variables which function as pointers.
// Points_to_a_class points to a class, a new class can be created by using this class Pointer Points_to_a_class = class { }; // something would be an instance of an anonymous class // NOTE: running this multiple times would create a new instance of the anonymouse class and then create the object based off that new class // The reason for this is because everytime that this is called, it _might_ depend on some local variables that have changed value something = new(class { });
Function_name = { // function body };
Function_name = {|argument1, argument2| // funciton body };
See Type system for more information
Function_name = {|Int int_type, String string_type| // int_type will throw an error if the argument is not of type int, same with String // Return types are not checked/defined inside the function return string_type + "something more"; }; main = { String some_var = Function_name(0, "aaa"); // the system will check that the value of some_var is set to a String, so if the function returns anything else it will be an error };
The type system is by default typeless allowing for any type like more standard scripting lanuages. The system uses type ‘qualifiers’ to performe special actions on the variables. Type qualifiers range from anything to Checking the type of variable to saving data into a persistent database.
Variable_name = 1;
By defualt types are not enfored in the system
Int int_name = 1; String String_name = "Something"; Float fLoAt_NaMe = .43; Class Class_type = class {}; Object Object_type = object {}; Array Array_type = []; Function Function_type = {};
A type can be specified before then name of the variable.
Const Int int_name = 1;
The Const type means that a variable can only be set once. Note: The syntax of the lanuage does not allow for variables to be created without having a value set as a default
Function_name = {|Const variable| };
The variable argument can not be modified inside the body of the function. Note: Classes and objects are passed as pointers and thus their internals can be modified even if it is Const
Db Int counter = 0;
More information is inside the Database
Database variables are saved into a seperate database file in the current directory, these variables are recalled when the program is relaunched
Class_name = class { };
Class_name = class { member_name: default_value, second_member_name: another_value };
From_class = class { }; Class_name = class (From_class) { };
Object_name = object { };
<<Database root>>
main = { Print("Hello world"); };
main = { for(a = 0; a < 10; a = a + 1) { Print("the loop\n"); } };
Class animal = class { say_what: { return "default say thing"; }, say: { Print("The animal says: ", say_what(), "\n"); } }; Class cow = class (animal) { say_what: { return "Mooo"; } }; Class cat = class (animal) { say_what: { return "Mow"; } }; main = { Cat = new(cat); Cow = new(cow); Cat.say(); Cow.say(); };