Pony
Pony is one of a number of language whose main goal is to make parallel programming easier and less error-prone. It is based on an "actor model", where each part of your program is independent from other parts, and the different parts communicate by sending messages.
This is sort of similar to object-oriented programming, but the idea is that, instead of "calling" a method on some class, your actors send messages to each other. And the key idea is that those messages might not get a response right away! Of course, you can have your actor wait for a response, and then it's just like normal single-threaded programming. But your actor might not need a response to its message, or might do something else instead of waiting.
Keep in mind, Pony programs can do everything just like a Java or C++ program would, if you want to write them that way. But the idea is to encourage good comcurrent programming because of the way the language is designed. The language wants to make good parallel programming easier than it is in those other languages, by eliminating the possibility to have lots of shared state and race conditions.
Useful Links
- Home page
- Tutorial
- Playground - try Pony programming in your browser
- 99 bottles of beer program. (Go for the recursive version!)
Tools
We will use the current release of the reference ponyc
compiler, available
on github.
Everything you need is already installed on CS department lab machines
in the /courses/roche/413/bin
folder, which should be in your
PATH.
To install on your virtual machine, follow these steps:
-
Install
ponyup
by running:
(If you get an error about the path, do what it tells you.)sh -c "$(curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ponylang/ponyup/latest-release/ponyup-init.sh)"
- Tell ponyup what operating system you have in case it couldn't figure that out. In the lab
machines and probably your VM or WSL, it should be Ubuntu 20.04, so do
ponyup default ubuntu20.04
-
Then use ponyup to install the pony compiler:
ponyup update ponyc release
How I will run your code
The programs you submit should be in a single file
called proj.pony
, for either part of the project.
I will test your code by running the following commands,
assuming that I download your code into a folder called proj
:
ponyc
./proj
Phase 1 Requirements
For this language, you need to implement modifications A,B,C,D,E,F,G,H, and I. See the Phase 1 page for details on what this means.
Phase 2
See the Phase 2 Page for the list of suggested
problems. Of the ones listed, I recommend the following as being most
well-suited for LANGUAGE:
- Compiler
- Make
- Matrix Calculator
- Image Creator
- Game Scheduler
- Hangman
- TODO list
- Vending Machine
- Game with hidden agenda
- Frequency count
- Guess the language
- Find the missing digits
- Sports Ticker
- Rock, Paper, Scissors
- ??? (you choose!)