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.
- Build Problems, see FAQ Compiling.
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.
If you want a quick way to test or run code, checkout the Playground.
- Sublime Text: Pony Language
- Atom: language-pony
- Visual Studio: VS-pony
- Visual Studio Code: vscode-pony
- Vim:
- vim-pony
- pony.vim
- currycomb: Syntastic support
- SpaceVim, available as layer for Vim and Neovim. Just follow installation instructions then put
call SpaceVim#layers#load('lang#pony')inside configuration file ($HOME/.SpaceVim.d/init.vim)
- Emacs:
- BBEdit: bbedit-pony
- Micro: micro-pony-plugin
- Nano: pony.nanorc file
- Kate: update syntax definition file: Settings -> Configure Kate -> Open/Save -> Modes & Filetypes -> Download Highlighting Files
Pony supports LLVM 3.9 and on an experimental basis it supports LLVM 4.0 and 5.0. In addition, support for OpenSSL 1.1.0 was recently added for systems such as the Debian Stretch and Arch Linux, see FAQ Compiling for additional information.
Pony's prerequisites for CPU platforms are:
- Full support for 64-bit platforms
- x86 and ARM CPUs only
- See platforms listed in the Circle-CI build list at https://circleci.com/gh/ponylang/ponyc
- Partial support for 32-bit platforms
- The
armandarmhfarchitectures are tested via CI (Continuous Integration testing) - See platforms listed in the Circle-CI build list at https://circleci.com/gh/ponylang/ponyc
- See also: GitHub issues #2836 and #1576 for more information.
- The
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:latestThen 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/ponycIf 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 ./mainIf 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:latestShare 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/ponycNote 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 ./mainTo 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 most Linux distributions released after RHEL 7, the release builds are packaged and available on Bintray (pony-language/ponylang-appimage) as an AppImage.
The AppImage (www.appimage.org) format allow for an easy ability to use applications with minimal clutter added to your system. The applications are available in a single file and can be run after they're made executable. Additionally, AppImages allow for multiple versions of Pony to be used side by with with no conflicts.
To install builds via AppImage, you need to go to Bintray and download the appropriate file for the version you want. After the file is downloaded, you need to make it executable using chmod.
By default, the Pony AppImage package 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, Fedora Linux, or OpenSuSE, the release builds are packaged and available on COPR (ponylang/ponylang).
yum copr enable ponylang/ponylang epel-7
yum install ponycSee https://bugzilla.redhat.com/show_bug.cgi?id=1581675 for why epel-7 is required on the command line.
dnf copr enable ponylang/ponylang
dnf install ponyczypper addrepo --refresh --repo https://copr.fedorainfracloud.org/coprs/ponylang/ponylang/repo/opensuse-leap-15.0/ponylang-ponylang-opensuse-leap-15.0.repo
wget https://copr-be.cloud.fedoraproject.org/results/ponylang/ponylang/pubkey.gpg
rpm --import pubkey.gpg
zypper install ponyczypper addrepo --refresh --repo https://copr.fedorainfracloud.org/coprs/ponylang/ponylang/repo/opensuse-tumbleweed/ponylang-ponylang-opensuse-tumbleweed.repo
wget https://copr-be.cloud.fedoraproject.org/results/ponylang/ponylang/pubkey.gpg
rpm --import pubkey.gpg
zypper install ponycBy 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 and Debian Linux, the release builds are packaged and available on Bintray (pony-language/ponylang-debian).
Install packages to allow apt to use a repository over HTTPS:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-commonInstall builds via Apt (and install Ponylang's public key):
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "E04F0923 B3B48BDA"
sudo add-apt-repository "deb https://dl.bintray.com/pony-language/ponylang-debian $(lsb_release -cs) main"
sudo apt-get update
sudo apt-get -V install ponycBy default, the Pony DEB package is compiled without support for AVX CPU instructions. For optimal performance, you should build your Pony installation from source.
All steps to install Pony in Linux Mint are the same from Ubuntu, but you must use the Ubuntu package base (trusty, xenial, bionic) instead of the Linux Mint release.
Install pre-requisites and add the correct apt repository:
sudo apt-get install \
apt-transport-https \
ca-certificates \
curl \
gnupg2 \
software-properties-commonsudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "E04F0923 B3B48BDA"
source /etc/upstream-release/lsb-release
sudo add-apt-repository "deb https://dl.bintray.com/pony-language/ponylang-debian $DISTRIB_CODENAME main"
sudo apt-get update
sudo apt-get -V install ponycThe same AVX2 support restrictions apply.
layman -a stefantalpalaru
emerge dev-lang/ponyA 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 ponycNixOS Linux or any OS using nix
nix-env -i ponycIf 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 ponycWindows 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 or the Visual C++ Build Tools 2017, install the latest
Windows 10 SDK (10.x.x.x) for Desktopfrom 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.4
- MSVC >= 2015
- XCode Clang >= 6.0
Pony requires LLVM version 3.9.1.
There is experimental support for building with LLVM 4.0.1, 5.0.1 or 6.0.0, but this may result in decreased performance or crashes in generated applications.
NOTE: If LLVM version < 5.0.0 is used, cpu feature avx512f is diabled automagically to avoid LLVM bug 30542 otherwise the compiler crashes during the optimization phase.
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://github.com/ponylang/ponycInstall pony dependencies:
pacman -S llvm make ncurses openssl pcre2 zlib
To build ponyc and compile and helloworld:
cd ~/ponyc/
make default_pic=true default_ssl='openssl_1.1.0'
./build/release/ponyc examples/helloworld
./helloworldAdd the following to /etc/apt/sources:
deb http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.9 main
deb-src http://llvm.org/apt/jessie/ llvm-toolchain-jessie-3.9 main
Install the LLVM toolchain public GPG key, update apt and install packages:
wget -O - http://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.9-devDebian 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://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 installTo build ponyc, compile and run helloworld:
cd ~/ponyc/
make
./build/release/ponyc examples/helloworld
./helloworldInstall pony dependencies:
sudo apt-get update
sudo apt-get install make gcc g++ git zlib1g-dev libncurses5-dev \
libssl-dev llvm llvm-dev libpcre2-devTo build ponyc, compile and run helloworld:
cd ~/ponyc/
make default_pic=true
./build/release/ponyc examples/helloworld
./helloworldAdd the LLVM apt report to /etc/apt/sources.list. Open /etc/apt/sources.list and add the following lines to the end of the file:
deb http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
deb-src http://apt.llvm.org/trusty/ llvm-toolchain-trusty-3.9 main
Add the LLVM repo as a trusted source:
cd /tmp
wget -O llvm-snapshot.gpg.key http://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.keyInstall dependencies:
sudo apt-get update
sudo apt-get install -y build-essential git zlib1g-dev libncurses5-dev \
libssl-dev llvm-3.9Install libprce2:
cd /tmp
wget ftp://ftp.csx.cam.ac.uk/pub/software/programming/pcre/pcre2-10.21.tar.bz2
tar xjvf pcre2-10.21.tar.bz2
cd pcre2-10.21
./configure --prefix=/usr
make
sudo make installClone the ponyc repo:
cd ~/
git clone https://github.com/ponylang/ponyc.gitBuild ponyc, compile and run helloworld:
cd ~/ponyc/
make
./build/release/ponyc examples/helloworld
./helloworldAdd the LLVM apt repos to /etc/apt/sources.list. Open /etc/apt/sources.list and add the following lines to the end of the file:
deb http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main
deb-src http://apt.llvm.org/xenial/ llvm-toolchain-xenial-3.9 main
Add the LLVM repo as a trusted source:
cd /tmp
wget -O llvm-snapshot.gpg.key http://apt.llvm.org/llvm-snapshot.gpg.key
sudo apt-key add llvm-snapshot.gpg.keysudo apt-get update
sudo apt-get install -y build-essential git zlib1g-dev libncurses5-dev libssl-dev libpcre2-dev llvm-3.9Clone the ponyc repo:
cd ~/
git clone https://github.com/ponylang/ponyc.gitBuild ponyc, compile and run helloworld:
cd ~/ponyc/
make
./build/release/ponyc examples/helloworld
./helloworldsudo apt-get update
sudo apt-get install -y build-essential git zlib1g-dev libncurses5-dev libssl-dev libpcre2-dev llvm-3.9Clone the ponyc repo:
cd ~/
git clone https://github.com/ponylang/ponyc.gitBuild ponyc, compile and run helloworld:
cd ~/ponyc/
make default_pic=true default_ssl=openssl_1.1.0
./build/release/ponyc examples/helloworld
./helloworldInstructions for Linux Mint are the same as the appropriate Ubuntu installation. However, an extra llvm-3.9-dev package is required for missing headers.
After installing the llvm package by following the appropriate steps for Ubuntu Trusty (Linux Mint 17), Xenial (Linux Mint 18), or Bionic (Linux Mint 19), install the extra headers:
sudo apt-get install -y llvm-3.9-devdnf check-update
sudo dnf install git gcc-c++ make openssl-devel pcre2-devel zlib-devel \
llvm-devel ncurses-develTo build ponyc, compile and run helloworld:
cd ~/ponyc/
make
./build/release/ponyc examples/helloworld
./helloworlddnf check-update
sudo dnf install git gcc-c++ make openssl-devel pcre2-devel zlib-devel \
llvm3.9-devel ncurses-devel libatomicTo build ponyc, compile and run helloworld:
cd ~/ponyc/
make default_ssl='openssl_1.1.0'
./build/release/ponyc examples/helloworld
./helloworldsudo yum install git gcc-c++ make openssl-devel pcre2-devel zlib-devel \
ncurses-devel libatomicUsing LLVM 3.9.1 from EPEL:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm
sudo yum install ./epel-release-latest-7.noarch.rpm
sudo yum install llvm3.9-devel llvm3.9-staticUsing LLVM 3.9.1 from copr:
sudo yum install yum-plugin-copr
sudo yum copr enable alonid/llvm-3.9.1
sudo yum install llvm-3.9.1 llvm-3.9.1-devel llvm-3.9.1-staticUsing LLVM 5.0.1 from copr:
sudo yum install yum-plugin-copr
sudo yum copr enable alonid/llvm-5.0.1
sudo yum install llvm-5.0.1 llvm-5.0.1-devel llvm-5.0.1-staticUsing LLVM 4.0.1 from llvm-toolset-7 from SCL:
CentOS:
# 1. Install a package with repository for your system:
# On CentOS, install package centos-release-scl available in CentOS repository:
sudo yum install centos-release-sclRHEL:
# On RHEL, enable RHSCL repository for you system:
sudo yum-config-manager --enable rhel-server-rhscl-7-rpms# 2. Install the collection:
sudo yum install llvm-toolset-7 llvm-toolset-7-llvm-devel llvm-toolset-7-llvm-staticEnable the llvm collection before building:
scl enable llvm-toolset-7 bashcd ~/ponyc/
make use="llvm_link_static"
./build/release/ponyc examples/helloworld
./helloworldsudo zypper addrepo http://download.opensuse.org/repositories/devel:tools:compiler/openSUSE_Leap_42.3/devel:tools:compiler.repo
sudo zypper refresh
sudo zypper update
sudo zypper install git gcc-c++ make libopenssl-devel pcre2-devel zlib-devel \
llvm3_9-devel binutils-goldTo build ponyc, compile and run helloworld:
cd ~/ponyc/
make
./build/release/ponyc examples/helloworld
./helloworldNOTE: LLVM 3.9 doesn't seem to be available so these instructions install the default LLVM version available.
sudo zypper install git gcc-c++ make libopenssl-devel pcre2-devel zlib-devel \
llvm-devel binutils-goldTo build ponyc, compile and run helloworld:
cd ~/ponyc/
make
./build/release/ponyc examples/helloworld
./helloworldInstall build tools/dependencies:
apk add --update alpine-sdk libressl-dev binutils-gold llvm3.9 llvm3.9-dev \
pcre2-dev libexecinfo-dev coreutils linux-headersTo build ponyc, compile and run helloworld:
cd ~/ponyc/
make default_pic=true
./build/release/ponyc examples/helloworld
./helloworldYou need to have the development versions of the following installed:
- 3.9.1
- zlib
- ncurses
- pcre2
- libssl
There is experimental support for LLVM 4.0.1 and 5.0.0, but this may result in decreased performance or crashes in generated applications.
If your distribution doesn't have a package for prce2, you will need to download and build it from source:
wget ftp://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 installFinally to build ponyc, compile and run the hello world app:
cd ~/ponyc/
make
./build/release/ponyc examples/helloworld
./helloworldDragonfly has been tested on 64-bit X86 DragonFly 4.8.
First, install the required dependencies:
sudo pkg install gmake
sudo pkg install llvm38
sudo pkg install pcre2This will build ponyc and compile helloworld:
gmake
./build/release/ponyc examples/helloworldFirst, install the required dependencies:
-
FreeBSD 11 for amd64 (64-bit). It is extremely difficult to coordinate the LLVM version, operating system support for atomics, and Pony to work in harmony on FreeBSD 10 or earlier. (See additional info below that mentions problems with 32-bit executable support.)
-
The following packages, with their installation commands:
sudo pkg install gmake
sudo pkg install llvm38
sudo pkg install pcre2
sudo pkg install libunwindThis will build ponyc and compile helloworld:
gmake
./build/release/ponyc examples/helloworldOpenBSD has been tested on OpenBSD 6.4.
First, install the required dependencies:
doas pkg_add gmake libexecinfo llvm pcre2This will build ponyc and compile helloworld:
gmake verbose=true default_pic=true bits=64
./build/release/ponyc examples/helloworldIf you are on a 32-bit platform (e.g., armv7), change bits=64 to bits=32.
You'll need llvm 3.9.1 and the pcre2 library to build Pony. You can use either homebrew or MacPorts to install your dependencies.
There is experimental support for LLVM 4.0.1 or 5.0.0, but this may result in decreased performance or crashes in generated applications.
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 or the Visual C++ Build Tools 2017, install the latest
Windows 10 SDK (10.x.x.x) for Desktopfrom 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 make.bat configure 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 (releaseis the default).--llvm <version>: the LLVM version to build against (3.9.1is 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.
Link-time optimizations provide a performance improvement. You should strongly consider turning on LTO if you build ponyc from source. It's off by default as it comes with some caveats:
-
If you aren't using clang as your linker, we've seen LTO generate incorrect binaries. It's rare but it can happen. Before turning on LTO you need to be aware that it's possible.
-
If you are on MacOS, turning on LTO means that if you upgrade your version of XCode, you will have to rebuild your Pony compiler. You won't be able to link Pony programs if there is a mismatch between the version of XCode used to build the Pony runtime and the version of XCode you currently have installed.
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=yesIf 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.soRefer to your compiler documentation for the plugin to use in your case.
If you're compiling with Clang, you can build the Pony runtime as an LLVM bitcode file by setting runtime-bitcode to yes in the build command line:
make runtime-bitcode=yesThen, you can pass the --runtimebc option to ponyc in order to use the bitcode file instead of the static library to link in the runtime:
ponyc --runtimebcThis functionnality boils down to "super LTO" for the runtime. The Pony compiler will have full knowledge of the runtime and will perform advanced interprocedural optimisations between your Pony code and the runtime. If your're looking for maximum performance, you should consider this option. Note that this can result in very long optimisation times.
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=armv7To get a complete list of acceptable architecture names, use the gcc command:
gcc -march=noneThis will result in an error message plus a listing off all architecture types acceptable on your platform.