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
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.
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
Or via Zypper:
sudo zypper install gcc6 binutils-gold \
zlib-devel libopenssl-devel pcre2-devel
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/zypp/repos.d/
sudo zypper 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://keyserver.ubuntu.com:80 --recv-keys "D401AB61 DBE1D0A2"
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.
Make sure you have a gcc installed:
sudo apt-get install build-essential
Set the CC
environment variable:
echo "export CC=`which gcc`" >> ~/.profile
export CC=`which gcc`
Install ponyc via bintray:
sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys "379CE192D401AB61"
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
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 or the Visual C++ Build Tools 2017, install the latest
Windows 10 SDK (10.x.x.x) 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.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 or 5.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.
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://github.com/ponylang/ponyc
Install 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
./helloworld
Add 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-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://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