Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
Show HN: Pony Programming Workshop (github.com/aturley)
55 points by aturley on July 26, 2018 | hide | past | favorite | 5 comments


I'm giving a Pony workshop at ICFP this year (https://icfp18.sigplan.org/event/icfp-2018-tutorials-writing...), this repo represents the material that I'll be covering. I've given early versions of it twice in NYC. I think it kind of works as a stand-alone thing (but you miss the thrill of hearing my voice and asking questions).

I'd love to get some feedback if anybody has any thoughts.


There's also a Pony workshop at CodeMesh in London this November for those who can't make it to ICFP but can make it to London.

https://codesync.global/conferences/code-mesh-2018/training


Could you shed some light on how you made the playground.ponylang.org website work? Do you allow multiple actors to all be run at the same time? How do you coordinate the various outputs of the various actors?


I didn't build the playground website so I can't comment too much on it, but I can try to answer your question since I don't think it is specific to the website (but if my answer doesn't help please let me know, I may have misunderstood the question).

Actors in a Pony program all run within the same operating system process, so in theory there shouldn't be a limit to how many are run. In practice each actor takes up some memory so if you start enough of them you'll crash the process when you run out of memory.

Pony has a scheduler that schedules actors to run on threads. By default a Pony application starts with as many threads as there are CPUs in the system, but that's adjustable so the playground may tune that down. So all the actors are free to be available to be scheduled, but the number that are running at the same time is dependent on how many threads the scheduler has, and how many actors are processing messages at a given time.

Output in Pony is done via two actors: `env.out` is for stdout, `env.err` is for stderr. If you want to print a string you send that string to the actor via a `print(...)` message. Actors only process one message at a time, so each string will be printed in the order in which the output actor received the `print(...)` message.

Hopefully that helps a little. I'm happy to try to clarify or answer other questions.


It's a docker container with the pony compiler in it. The user input is compiled and run. Any output is captured and routed back to the web browser.

There's a timeout on it so it's really only good for running short lived snippets.

It's based on the same code that powers Rust's playground (or rather the code that did at the time that we introduced the playground).

Source is available here:

https://github.com/plietar/pony-playpen




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: