Need help? Not to worry, we have you covered.
We have a couple resources designed to help you learn, we suggest starting with the tutorial and from there, moving on to the Pony Patterns book. Additionally, standard library documentation is available online.
- Tutorial.
- Pony Patterns cookbook is in progress
- Standard library docs.
If you are looking for an answer "right now", we suggest you give our IRC channel a try. It's #ponylang on Freenode. If you ask a question, be sure to hang around until you get an answer. If you don't get one, or IRC isn't your thing, we have a friendly mailing list you can try. Whatever your question is, it isn't dumb, and we won't get annoyed.
Think you've found a bug? Check your understanding first by writing the mailing list. Once you know it's a bug, open an issue.
- Sublime Text: Pony Language
- Atom: language-pony
- Visual Studio: VS-pony
- Visual Studio Code: vscode-pony
- Vim:
- Emacs:
- BBEdit: bbedit-pony
- Micro: micro-pony-plugin
Want to use the latest revision of Pony source, but don't want to build from source yourself? You can run the ponylang/ponyc
Docker container, which is created from an automated build at each commit to master.
You'll need to install Docker using the instructions here. Then you can pull the latest ponylang/ponyc
image using this command:
docker pull ponylang/ponyc:latest
Then you'll be able to run ponyc
to compile a Pony program in a given directory, running a command like this:
docker run -v /path/to/my-code:/src/main ponylang/ponyc
If you're unfamiliar with Docker, remember to ensure that whatever path you provide for /path/to/my-code
is a full path name and not a relative path, and also note the lack of a closing slash, /
, at the end of the path name.
Note that if your host doesn't match the docker container, you'll probably have to run the resulting program inside the docker container as well, using a command like this:
docker run -v /path/to/my-code:/src/main ponylang/ponyc ./main
If you're using docker-machine
instead of native docker, make sure you aren't using an incompatible version of Virtualbox.
Pull the latest image as above.
docker pull ponylang/ponyc:latest
Share a local drive (volume), such as c:
, with Docker for Windows, so that they are available to your containers. (Refer to shared drives in the Docker for Windows documentation for details.)
Then you'll be able to run ponyc
to compile a Pony program in a given directory, running a command like this:
docker run -v c:/path/to/my-code:/src/main ponylang/ponyc
Note the inserted drive letter. Replace with your drive letter as appropriate.
To run a program, run a command like this:
docker run -v c:/path/to/my-code:/src/main ponylang/ponyc ./main
To compile and run in one step run a command like this:
docker run -v c:/path/to/my-code:/src/main ponylang/ponyc sh -c "ponyc && ./main"
By default, the Pony Docker image is compiled without support for AVX CPU instructions. For optimal performance, you should build your Pony installation from source.
For Red Hat, CentOS, Oracle Linux, or Fedora Linux, the release
builds are packaged and available on Bintray (pony-language/ponyc-rpm).
To install builds via DNF:
wget https://bintray.com/pony-language/ponyc-rpm/rpm -O bintray-pony-language-ponyc-rpm.repo
sudo mv bintray-pony-language-ponyc-rpm.repo /etc/yum.repos.d/
sudo dnf --refresh install ponyc
Or via Yum:
wget https://bintray.com/pony-language/ponyc-rpm/rpm -O bintray-pony-language-ponyc-rpm.repo
sudo mv bintray-pony-language-ponyc-rpm.repo /etc/yum.repos.d/
sudo yum install ponyc
By default, the Pony RPM package is compiled without support for AVX CPU instructions. For optimal performance, you should build your Pony installation from source.
For Ubuntu or Debian Linux, the release
builds are packaged and available on Bintray (pony-language/ponyc-debian).
To install builds via Apt (and install Bintray's public key):
sudo apt-key adv --keyserver hkp:https://keyserver.ubuntu.com:80 --recv-keys "8756 C4F7 65C9 AC3C B6B8 5D62 379C E192 D401 AB61"
echo "deb https://dl.bintray.com/pony-language/ponyc-debian pony-language main" | sudo tee -a /etc/apt/sources.list
sudo apt-get update
sudo apt-get -V install ponyc
You may need to install ponyc
(current) instead of ponyc-release
(deprecated). And if you have issues with package authentication you may need to comment out the deb
line in /etc/apt/sources.list
, do an update, and uncomment it again. Feel free to ask for help if you have any problems!
By default, the Pony DEB package is compiled without support for AVX CPU instructions. For optimal performance, you should build your Pony installation from source.
pacman -S ponyc
layman -a stefantalpalaru
emerge dev-lang/pony
A live ebuild is also available in the overlay (dev-lang/pony-9999) and for Vim users there's app-vim/pony-syntax.
Linux using Linuxbrew
$ brew update
$ brew install ponyc
NixOS Linux or any OS using nix
nix-env -i ponyc
If you get an error when trying to use ponyc
to compile pony source
that looks like this:
collect2: fatal error: cannot find 'ld'
you might have to install the ld-gold
linker. It can typically be
found by searching your distro's package repository for binutils-gold
or just ld-gold
.
Mac OS X using Homebrew
$ brew update
$ brew install ponyc
Windows users will need to install:
- Visual Studio 2017 or 2015 (available here) or the Visual C++ Build Tools 2017 or 2015 (available here), and
- If using Visual Studio 2015, install the Windows 10 SDK (available here).
- If using Visual Studio 2017, install the
Windows 10 SDK (10.0.15063.0) for Desktop
from the Visual Studio installer.
Once you have installed the prerequisites, you can download the latest ponyc release from bintray.
First of all, you need a compiler with decent C11 support. The following compilers are supported, though we recommend to use the most recent versions.
- GCC >= 4.7
- Clang >= 3.3
- MSVC >= 2013
- XCode Clang >= 6.0
Pony requires one of the following versions of LLVM:
- 3.7.1
- 3.8.1
- 3.9.1
Compiling Pony is only possible on x86 and ARM (either 32 or 64 bits).
Get Pony-Sources from Github (More Information about Set Up Git https://help.github.com/articles/set-up-git/ ):
$ sudo apt install git
$ git clone git:https://github.com/ponylang/ponyc
pacman -S llvm make ncurses openssl pcre2 zlib
To build ponyc and compile helloworld:
$ make
$ ./build/release/ponyc examples/helloworld
If you get errors like
/usr/bin/ld.gold: error: ./fb.o: requires dynamic R_X86_64_32 reloc against
'Array_String_val_Trace' which may overflow at runtime; recompile with -fPIC
try running ponyc
with the --pic
flag.
$ ./build/release/ponyc --pic examples/helloworld
Add the following to /etc/apt/sources
:
deb https://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main
deb-src https://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.8 main
Install the LLVM toolchain public GPG key, update apt
and install packages:
$ wget -O - https://llvm.org/apt/llvm-snapshot.gpg.key|sudo apt-key add -
$ sudo apt-get update
$ sudo apt-get install make gcc g++ git zlib1g-dev libncurses5-dev \
libssl-dev llvm-3.8-dev
Debian Jessie and some other Linux distributions don't include pcre2 in their package manager. pcre2 is used by the Pony regex package. To download and build pcre2 from source:
$ wget ftp:https://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2
$ tar xvf pcre2-10.21.tar.bz2
$ cd pcre2-10.21
$ ./configure --prefix=/usr
$ make
$ sudo make install
To build ponyc, compile and run helloworld:
$ cd ~/ponyc/
$ make
$ ./build/release/ponyc examples/helloworld
$ ./helloworld
$ sudo apt-get update
$ sudo apt-get install -y build-essential git zlib1g-dev libncurses5-dev libssl-dev libpcre2-dev
You should install LLVM 3.7.1, 3.8.1, or 3.9.1 from the LLVM download page under Pre-Built Binaries. Then you can extract that LLVM to /usr/local
, for example, like so:
tar xJf clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-16.04.tar.xz \
--strip-components 1 -C /usr/local/ \
clang+llvm-${LLVM_VERSION}-x86_64-linux-gnu-ubuntu-16.04
where ${LLVM_VERSION}
is whatever version of LLVM you've downloaded the .xz
file for.
To build ponyc, compile and run helloworld:
$ cd ~/ponyc/
$ make
$ ./build/release/ponyc examples/helloworld
$ ./helloworld
You need to have the development versions of the following installed:
- LLVM 3.7.1, 3.8.1, or 3.9.1
- zlib
- ncurses
- pcre2
- libssl
If your distribution doesn't have a package for prce2, you will need to download and build it from source:
$ wget ftp:https://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2
$ tar xvf pcre2-10.21.tar.bz2
$ cd pcre2-10.21
$ ./configure --prefix=/usr
$ make
$ sudo make install
Finally to build ponyc, compile and run the hello world app:
$ cd ~/ponyc/
$ make
$ ./build/release/ponyc examples/helloworld
$ ./helloworld
First, install the required dependencies:
sudo pkg install gmake
sudo pkg install llvm38
sudo pkg install pcre2
sudo pkg install libunwind
This will build ponyc and compile helloworld:
$ gmake
$ ./build/release/ponyc examples/helloworld
Please note that on 32-bit X86, using LLVM 3.7.1 or 3.8.1 on FreeBSD currently produces executables that don't run. Please use LLVM 3.9.1. 64-bit X86 does not have this problem, and works fine with LLVM 3.7.1 and 3.8.1.
You'll need llvm 3.7.1, 3.8.1 or 3.9.1 and the pcre2 library to build Pony. You can use either homebrew or MacPorts to install your dependencies. Please note that llvm 3.9.1 is not available via homebrew. As such, the instructions below install 3.8.1
Installation via homebrew:
$ brew update
$ brew install [email protected] pcre2 libressl
Installation via MacPorts:
$ sudo port install llvm-3.9 pcre2 libressl
$ sudo port select --set llvm mp-llvm-3.9
Launch the build with make
after installing the dependencies:
$ make
$ ./build/release/ponyc examples/helloworld
Note: it may also be possible (as tested on build 14372.0 of Windows 10) to build Pony using the Ubuntu 14.04 instructions inside Bash on Ubuntu on Windows.
Building on Windows requires the following:
- Visual Studio 2017 or 2015 (available here) or the Visual C++ Build Tools 2017 or 2015 (available here), and
- If using Visual Studio 2015, install the Windows 10 SDK (available here).
- If using Visual Studio 2017, install the
Windows 10 SDK (10.0.15063.0) for Desktop
from the Visual Studio installer.
- Python (3.6 or 2.7) needs to be in your PATH.
In a command prompt in the ponyc
source directory, run the following:
> make.bat configure
(You only need to run this the first time you build the project.)
> make.bat build test
This will automatically perform the following steps:
- Download some pre-built libraries used for building the Pony compiler and standard library.
- Build the pony compiler in the
build-<config>-<llvm-version>
directory. - Build the unit tests for the compiler and the standard library.
- Run the unit tests.
You can provide the following options to make.bat
when running the build
or test
commands:
--config debug|release
: whether or not to build a debug or release build (debug is the default).--llvm <version>
: the LLVM version to build against (3.9.1 is the default).
Note that you need to provide these options each time you run make.bat; the system will not remember your last choice.
Other commands include clean
, which will clean a specified configuration; and distclean
, which will wipe out the entire build directory. You will need to run make configure
after a distclean.
You can enable LTO when building the compiler in release mode. There are slight differences between platforms so you'll need to do a manual setup. LTO is enabled by setting lto
to yes
in the build command line:
$ make lto=yes
If the build fails, you have to specify the LTO plugin for your compiler in the LTO_PLUGIN
variable. For example:
$ make LTO_PLUGIN=/usr/lib/LLVMgold.so
Refer to your compiler documentation for the plugin to use in your case.
Pony binaries can trigger illegal instruction errors under VirtualBox 4.x, for at least the x86_64 platform and possibly others.
Use VirtualBox 5.x to avoid possible problems.
You can learn more about AVX2 support.
On ARM platforms, the default gcc architecture specification used in the Makefile of native does not work correctly, and can even result in the gcc compiler crashing. You will have to override the compiler architecture specification on the make command line. For example, on a RaspberryPi2 you would say:
$ make arch=armv7
To get a complete list of acceptable architecture names, use the gcc command:
gcc -march=none
This will result in an error message plus a listing off all architecture types acceptable on your platform.