Create a /tmp/helloworld
directory and put the following in main.pony
:
actor Main
new create(env: Env) =>
env.out.print("Hello, world!")
Now compile it like this (the Docker image will be downloaded if necessary):
docker run -v /tmp/helloworld:/src/main ponylang/ponyc
This will compile a main
binary - but executing it directly in OS X will not work:
$ ./main
-bash: ./main: cannot execute binary file
Instead, run it like this:
$ docker run -v /tmp/helloworld:/src/main ponylang/ponyc ./main
Hello, world!
See also the documentation for the container, which covers this exact issue: https://hub.docker.com/r/ponylang/ponyc/