Hello World
We can now see the famous Hello World program in src/Main.flix
file:
def main(): Unit \ IO =
println("Hello World!")
That's it!
You will immediately notice a few things are different from other programming languages:
- The
main
function has no formal parameters, in particular it does not take an arguments array. Instead the command line arguments are available by calling theEnvironment.getArgs
functions. - The return type of the
main
function isUnit
. - The
main
function has theIO
effect since it prints to the terminal.