Pony Tutorial (original) (raw)

Welcome to the Pony tutorial! If you’re reading this, chances are you want to learn Pony. That’s great, we’re going to make that happen.

This tutorial is aimed at people who have some experience programming already. It doesn’t really matter if you know a little Python, or a bit of Ruby, or you are a JavaScript hacker, or Java, or Scala, or C/C++, or Haskell, or OCaml: as long as you’ve written some code before, you should be fine.

What’s Pony, anyway?

Pony is an object-oriented, actor-model, capabilities-secure programming language. It’s object-oriented because it has classes and objects, like Python, Java, C++, and many other languages. It’s actor-model because it has actors (similar to Erlang, Elixir, or Akka). These behave like objects, but they can also execute code asynchronously. Actors make Pony awesome.

When we say Pony is capabilities-secure, we mean a few things:

Pony can’t stop you from writing logical bugs, but it can remove entire classes of bugs from being possible. The Pony compiler prevents you from unsafely accessing memory concurrently. If you’ve ever done concurrent programming, you know how hard such things can be to track down. With Pony, poof, don’t worry about it; concentrate on “your logic”. We think that makes Pony awesome and we hope you come to agree with us.

We’ll talk more about capabilities-security, including both object capabilities and reference capabilities later.

The Pony Philosophy: Get Stuff Done

In the spirit of Richard Gabriel, the Pony philosophy is neither “the-right-thing” nor “worse-is-better”. It is “get-stuff-done”.

The “get-stuff-done” approach has the same attitude towards correctness and simplicity as “the-right-thing”, but the same attitude towards consistency and completeness as “worse-is-better”. It also adds performance as a new principle, treating it as the second most important thing (after correctness).

Guiding Principles

Throughout the design and development of the language the following principles should be adhered to.

More help

Working your way through the tutorial but in need of more help? Not to worry, we have you covered.

If you are looking for an answer “right now”, we suggest you give our Zulip community a 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 to the “beginner help” stream in Zulip. Once you know it’s a bug, open an issue.

Help us

Found a typo in this tutorial? Perhaps something isn’t clear? We welcome pull requests against the tutorial: Pony Tutorial.

Be sure to check out the contribution guidelines before opening your PR.