#26 Hello World and Fan launcher

brian Sun 8 Jan 2006

John was having trouble figuring out how to bootstrap a program. I've always used the test suite as my entry point, but I wanted a clear illustration of how I was expecting fan and nfan to work. I've created a very simple hello world Fan program:

class HelloWorld
{
  static Void main() { echo("Hello World!") }
}

The code is in the hello pod and may be compiled using:

fanc src\hello

Then you can use the following to run it in Java:

fan hello::HelloWorld.main

The .NET fan.exe launcher should work just the same:

nfan hello::HelloWorld.main

Eventually once we add a manifest to pods, we can provide a default "main" method for pods so that you can just say "fan podname".

Login or Signup to reply.