t, for some type t; which is usually IO (). IO is a monad, which organizes side-effects in terms of purely functional code. The main value represents the side-effects-ful computation done by the program. The result of the computation represented by main is discarded; that is why main usually has type IO (), which indicates that the type of the result of the computation is (), the unit type, which contains no information. main :: IO () main = putStrLn "Hello, World!" Command line arguments are not given to main; they must be fetched using another IO action, such as System.Environment.getArgs. Java Java programs start executing at the main method of a class, which has one of the following method headings: public static void main(String[] args) public static void main(String... args) public static void main(String args[]) Command-line arguments are passed in args. As in C and C++, the name "main()" is special. Java's main methods do not return a value directly, but one can be passed by using the System.exit() method. Unlike C, the name of the program is not included in args, because it is the name of the class that contains the main method, so it is already known. Also unlike C, the number of arguments need not be included, since arrays in Java have a field that keeps track of how many elements there are. The main function must be included within a class. This is because in Java everything has to be contained within a class. For instance, a hello world program in Java may look like: public class HelloWorld { public static void main(String[] args) { System.out.println("Hello, world!"); } } To run this program, one must call java HelloWorld in the directory where the compiled class file HelloWorld.class) exists. Alternatively, executable JAR files use a manifest file to specify the entry point in a manner that is filesystem-independent from the user's perspective. LOGO In FMSLogo, the procedures when loaded do not execute. To make them execute, it is necessary to use this code: to procname ... ; Startup commands (such as print [Welcome]) end make "startup [procname] The variable startup is used for the startup list of actions, but the convention is that this calls a procedure that runs the actions. That procedure may be of any name. OCaml OCaml has no main function. Programs are evaluated from top to bottom. Command-line arguments are available