Jump to content

Draft:Pony (programming language): Difference between revisions

From Wikipedia, the free encyclopedia
Content deleted Content added
m Reference to ACM paper.
References: columns are now by default
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{AfC submission|t||ts=20221122223018|u=Ferdinand55|ns=118|demo=}}
<!-- {{AfC submission|t||ts=20221122223018|u=Ferdinand55|ns=118|demo=}} -->


<!-- Note: The following pages were redirects to [[Pony_(programming_language)]] before draftification:
<!-- Note: The following pages were redirects to [[Pony_(programming_language)]] before draftification:
Line 6: Line 6:


{{Infobox programming language
{{Infobox programming language
| name = Pony
| name = Pony
| logo = Main-galloping.svg
| logo = Main-galloping.svg
| paradigm = [[Actor model]], [[object-oriented programming|Object-oriented]], [[Imperative programming|Imperative]]
| paradigm = [[Actor model]], [[object-oriented programming|Object-oriented]], [[Imperative programming|Imperative]]
| designer = Sylvan Clebsch
| designer = Sylvan Clebsch
| influenced by = [[E (programming language)|E]]
| influenced by = [[E (programming language)|E]]
| influenced = {{URL|https://www.gitbook.com/book/stw/the-encore-programming-language/details|Encore}}, [[Project Verona]]<ref>{{cite web |title=Verona FAQ |url=https://github.com/microsoft/verona/blob/master/docs/faq.md |website=Github}}</ref>, [https://github.com/savi-lang/savi Savi], [https://inko-lang.org/ Inko]
| influenced = {{URL|https://www.gitbook.com/book/stw/the-encore-programming-language/details|Encore}}, [[Project Verona]]<ref>{{cite web |title=Verona FAQ |url=https://github.com/microsoft/verona/blob/master/docs/faq.md |website=Github}}</ref>, [https://github.com/savi-lang/savi Savi], [https://inko-lang.org/ Inko]
| latest_release_version = 0.58.5
| latest_release_version = 0.58.5
| latest_release_date = {{start date and age|2024|06|01}}
| latest_release_date = {{start date and age|2024|06|01}}
| typing = [[strong typing|strong]], [[static typing|static]], [[type inference|inferred]], [[nominal typing|nominal]], [[structural typing|structural]]
| typing = [[strong typing|strong]], [[static typing|static]], [[type inference|inferred]], [[nominal typing|nominal]], [[structural typing|structural]]
| website = {{URL|http://www.ponylang.org}}
| website = {{URL|http://www.ponylang.org}}
| year = {{release date and age|2012|11|09}}
| year = {{release date and age|2012|11|09}}
| license = [[BSD licenses|BSD]]-2.<ref>https://github.com/ponylang/ponyc/blob/master/LICENSE</ref>
| license = [[BSD licenses|BSD]]-2.<ref>https://github.com/ponylang/ponyc/blob/master/LICENSE</ref>
| programming_language = [[C (programming language)|C]]
| programming_language = [[C (programming language)|C]]
}}
}}


'''Pony''' (sometimes referred to as '''ponylang''') is a [[Free software|free]] and [[open-source|open source]], object-oriented, actor model, capabilities-secure, high performance programming language. Pony's "reference capabilities" allow even mutable data to be safely passed between actors ''by reference''. Garbage collection is based on the ORCA protocol which leads to independent and concurrent garbage collection across actors, without the need to "stop the world".
'''Pony''' (sometimes referred to as '''ponylang''') is a [[Free software|free]] and [[open-source|open source]], object-oriented, [[actor model]], capabilities-secure, high performance programming language. 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".


==Language design==
==Language design==
Line 29: Line 29:
* 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.
* 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.
* Exception Safety - There are no runtime exceptions. All exceptions have defined semantics and they are always caught.
* Exception Safety - There are no runtime exceptions. All exceptions have defined semantics and they are always caught.
* Concurrency Safety - Pony does not have locks or atomic operations. Instead, the type system employs reference capabilities<ref>{{cite conference
* Concurrency Safety - The type system employs reference capabilities<ref>{{cite conference
| author = Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, Andy McNeil
| author = Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, Andy McNeil
| title = Deny capabilities for safe, fast actors
| title = Deny capabilities for safe, fast actors
Line 42: Line 42:
}}</ref> to ensure (at compile time) that your program is free of data races and deadlocks.
}}</ref> to ensure (at compile time) that your program is free of data races and deadlocks.
=== Performance ===
=== Performance ===
* Lock-Free - By design, Pony avoids the need for traditional locking mechanisms, which eliminates the overhead and contention associated with locks.
* Native Code - Pony is an ahead-of-time (AOT) compiled language. There is no interpreter or virtual machine
* Native Code - Pony is an ahead-of-time (AOT) compiled language. There is no interpreter or virtual machine
* Concurrent Garbage Collection - Each actor's heap is collected separately and concurrently, avoiding the need to "stop the world" for global collection.
* Concurrent Garbage Collection - Each actor's heap is collected separately and concurrently, avoiding the need to "stop the world" for global collection.
Line 58: Line 59:


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

==History==
In 2011, Sylvan Clebsch created a C-based actor library in order to solve some real problems for software he was creating. Ultimately this library became the first implementation of Pony in 2012.


==References==
==References==
{{Reflist|30em}}
{{Reflist}}


== External links ==
== External links ==

Latest revision as of 01:36, 21 June 2024


Pony
ParadigmActor model, Object-oriented, Imperative
Designed bySylvan Clebsch
First appearedNovember 9, 2012; 12 years ago (2012-11-09)
Stable release
0.58.5 / June 1, 2024; 6 months ago (2024-06-01)
Typing disciplinestrong, static, inferred, nominal, structural
Implementation languageC
LicenseBSD-2.[1]
Websitewww.ponylang.org
Influenced by
E
Influenced
Encore, Project Verona[2], Savi, Inko

Pony (sometimes referred to as ponylang) is a free and open source, object-oriented, actor model, capabilities-secure, high performance programming language. 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".

Language design

[edit]

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

Safety

[edit]
  • Type Safety - Pony is a type safe language.[3]
  • 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.
  • Exception Safety - There are no runtime exceptions. All exceptions have defined semantics and they are always caught.
  • Concurrency Safety - The type system employs reference capabilities[4] to ensure (at compile time) that your program is free of data races and deadlocks.

Performance

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

Examples

[edit]

A few examples of idiomatic Pony follow.

Hello World

[edit]

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. As such, even the environment that allows for printing to stdout is passed as a parameter.

References

[edit]
  1. ^ https://github.com/ponylang/ponyc/blob/master/LICENSE
  2. ^ "Verona FAQ". Github.
  3. ^ https://www.ponylang.org/media/papers/fast-cheap.pdf
  4. ^ Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, Andy McNeil (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: authors list (link)
[edit]