Jump to content

Pony (programming language)

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Wukuendo (talk | contribs) at 13:45, 30 December 2024 (Added reference, which was previously under the external link section.). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.


Pony
File:Main-galloping.svg
ParadigmActor model, Object-oriented, Imperative
Designed bySylvan Clebsch[1]
First appeared28 April 2015; 10 years ago (2015-04-28)[2]
Stable release
0.58.7 / November 30, 2024; 6 months ago (2024-11-30)
Typing disciplinestrong, static, inferred, nominal, structural
Implementation languageC
LicenseBSD-2.[3]
Websitewww.ponylang.org
Influenced by
E
Influenced
Project Verona

Pony (also referred to as ponylang) is a free and open source, object-oriented, actor model, capabilities-secure, high performance programming language.[4][5] Pony's reference capabilities allow even mutable data to be safely passed by reference between actors. Garbage collection is performed concurrently, per-actor, without the need to "stop the world".[6][7][8] Sylvan Clebsch is the original creator of the language.[9][10] It is now being maintained and developed by members of the Pony team.[11]

Language design

At its core, Pony is a systems language designed around safety and performance.

Safety

  • Type Safety - Pony is a type safe language.[12][5]
  • Memory Safety - There are no dangling pointers and no buffer overruns. There is no null but optional types can be safely represented using unions with the None type.[4]
  • Exception Safety - There are no runtime exceptions. All exceptions have defined semantics and they are always caught.[13]
  • Concurrency Safety - The type system employs reference capabilities to ensure (at compile time) that your program is free of data races and deadlocks.[14][15][16]

Performance

  • Lock-Free - By design, Pony avoids the need for traditional locking mechanisms, which eliminates the overhead and contention associated with locks.[5][17]
  • Native Code - Pony is an ahead-of-time (AOT) compiled language. There is no interpreter or virtual machine[14]
  • Concurrent Garbage Collection - Each actor's heap is collected separately and concurrently, avoiding the need to "stop the world" for global collection.[9][10]

Examples

A few examples of idiomatic Pony follow.

Hello World

In Pony, instead of a main function, there is a main actor. The creation of this actor serves as the entry point into the Pony program.

actor Main
  new create(env: Env) =>
    env.out.print("Hello, world!")

There are no global variables in Pony, everything must be contained within an instance of a class or an actor.[17][18] As such, even the environment that allows for printing to stdout is passed as a parameter.

References

  1. ^ "Creator of Pony". Google Scholar.
  2. ^ "First public release". GitHub. 28 April 2015.
  3. ^ https://github.com/ponylang/ponyc/blob/master/LICENSE
  4. ^ a b Allen 2024.
  5. ^ a b c Alex Lashkov (26 July 2023). "The New Wave of Programming Languages: Pony, Zig, Crystal, Vlang, and Julia". Hackernoon. Retrieved 24 December 2024.
  6. ^ Sylvan Clebsch; Juliana Franco; Sophia Drossopoulou (12 October 2017). "Ownership and Reference Counting Based Garbage Collection in the Actor World". ACM Digital Library. doi:10.1145/3133896. Retrieved 24 December 2024.
  7. ^ "Introduction to the Pony Programming Language". LinkedIn. Society 5 Solutions. 15 October 2024. Retrieved 28 December 2024.
  8. ^ Daniel Caccamo (2018). "GoA: Actors with Locally Managed Memory for Go". UWSpace. Retrieved 28 December 2024.
  9. ^ a b Charles Humble (14 March 2016). "Using the Actor-model Language Pony for FinTec". InfoQ. Retrieved 24 December 2024.
  10. ^ a b Sophia Drossopoulou (14 September 2020). "Pony, Actors, Causality, Types, and Garbage Collection". InfoQ. Retrieved 24 December 2024.
  11. ^ "Team Pony". GitHub. Retrieved 28 December 2024.
  12. ^ https://www.ponylang.org/media/papers/fast-cheap.pdf
  13. ^ MCStone 2023.
  14. ^ a b Mölle 2017.
  15. ^ Sean T Allen (30 May 2018). "Introduction to the Pony programming language". opensource. Retrieved 28 December 2024.
  16. ^ Sylvan Clebsch; Sophia Drossopoulou; Sebastian Blessing (October 2015). "Deny capabilities for safe, fast actors". In Elisa Gonzalez Boix, Philipp Haller, Alessandro Ricci, Carlos Varela (ed.). AGERE! 2015: Proceedings of the 5th International Workshop on Programming Based on Actors, Agents, and Decentralized Control. Pittsburgh, PA, USA: Association for Computing Machinery. pp. 1–12. doi:10.1145/2824815.2824816. ISBN 9781450339018.{{cite conference}}: CS1 maint: multiple names: editors list (link)
  17. ^ a b Kristoffer Grönlund (22 January 2018). Everyone gets a pony!. archive. Linux Conference Australia 2018 (LCA2018). Retrieved 28 December 2024.
  18. ^ Peter Hellberg. "From Go to Pony". c7. Retrieved 28 December 2024.

Further reading

  • Mölle, Andreas (Dec 2017). "Developing concurrent programs with Pony". Linux Magazine (205). ISSN 1536-4674.
  • MCStone, Maverick (Dec 2023). Pony Playbook: Mastering the Basics of Concurrent Programming. Independently Published. ISBN 979-8870768175.
  • Allen, Corby (Jul 2024). Pony Programming: The Complete Guide to Building High-Performance, Concurrent, and Secure Applications with Pony. Independently Published. ISBN 979-8332662072.