Draft:Pony (programming language): Difference between revisions
No edit summary |
Andy Dingley (talk | contribs) →References: columns are now by default |
||
(37 intermediate revisions by 15 users not shown) | |||
Line 1: | Line 1: | ||
<!-- {{AfC submission|t||ts=20221122223018|u=Ferdinand55|ns=118|demo=}} --> |
|||
{{AFC submission|d|web|u=RealityDysfunction|ns=118|decliner=SwisterTwister|declinets=20170120192920|ts=20170120190503}} <!-- Do not remove this line! --> |
|||
<!-- Note: The following pages were redirects to [[Pony_(programming_language)]] before draftification: |
|||
{{AFC comment|1=This would've needed all major reviews. [[User:SwisterTwister|<font color="green">'''S'''wister'''T'''wister</font>]] [[User talk:SwisterTwister|<font color="green">talk</font>]] 19:29, 20 January 2017 (UTC)}} |
|||
⚫ | |||
-- |
--> |
||
{{Infobox programming language |
{{Infobox programming language |
||
| name |
| name = Pony |
||
| logo = Main-galloping.svg |
|||
| paradigm = [[Actor model]] |
|||
| paradigm = [[Actor model]], [[object-oriented programming|Object-oriented]], [[Imperative programming|Imperative]] |
|||
| designer |
| designer = Sylvan Clebsch |
||
| influenced by = [[E (programming language)|E]], [[Rust (programming language)|Rust]] |
|||
| influenced = |
| 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] |
|||
| latest_release_version = 0. |
| latest_release_version = 0.58.5 |
||
| latest_release_date |
| latest_release_date = {{start date and age|2024|06|01}} |
||
| typing |
| typing = [[strong typing|strong]], [[static typing|static]], [[type inference|inferred]], [[nominal typing|nominal]], [[structural typing|structural]] |
||
| website |
| website = {{URL|http://www.ponylang.org}} |
||
| year |
| year = {{release date and age|2012|11|09}} |
||
| license |
| 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''' ( |
'''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". |
||
This allows Pony to reside somewhere between the strict rules of [[Rust (programming language)|Rust]]'s borrow checker and [[Go (programming language)|Go]]'s flexible structural typing while still being able to make race-free and data sharing guarantees. |
|||
==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. |
|||
==Language design== |
==Language design== |
||
At its core, Pony is a systems language designed around safety and performance. |
At its core, Pony is a systems language designed around safety and performance. |
||
=== Safety === |
|||
* Type |
* Type Safety - Pony is a type safe language.<ref>https://www.ponylang.org/media/papers/fast-cheap.pdf</ref> |
||
* Memory |
* 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 |
* 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<ref>{{cite conference |
|||
* Data-race Free - Pony does not have locks or atomic operations. Instead, the type system ensures at compile time that your concurrent program can never have data races. This allows developers to write highly concurrent code with less change of problems occurring in the use of concurrency primitives. |
|||
| author = Sylvan Clebsch, Sophia Drossopoulou, Sebastian Blessing, Andy McNeil |
|||
* Deadlock-Free - Pony lacks language-level constructs to create locks. It is impossible to write code that compiles that will produce a deadlock. |
|||
| title = Deny capabilities for safe, fast actors |
|||
| book-title = AGERE! 2015: Proceedings of the 5th International Workshop on Programming Based on Actors, Agents, and Decentralized Control |
|||
| date = October 2015 |
|||
| pages = 1-12 |
|||
| publisher = Association for Computing Machinery |
|||
| location = Pittsburgh, PA, USA |
|||
| isbn = 9781450339018 |
|||
| doi = 10.1145/2824815.2824816 |
|||
| editor = Elisa Gonzalez Boix, Philipp Haller, Alessandro Ricci, Carlos Varela |
|||
}}</ref> to ensure (at compile time) that your program is free of data races and deadlocks. |
|||
=== 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 |
||
⚫ | |||
* Compatible with C - Interop with C is enabled through [[Foreign function interface|FFI]] |
|||
⚫ | |||
==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. |
|||
<syntaxhighlight lang="pony"> |
|||
actor Main |
|||
new create(env: Env) => |
|||
env.out.print("Hello, world!") |
|||
</syntaxhighlight> |
|||
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== |
==References== |
||
{{Reflist |
{{Reflist}} |
||
== External links == |
== External links == |
||
Line 46: | Line 67: | ||
* [http://www.ponylang.org Offical website] |
* [http://www.ponylang.org Offical website] |
||
* [https://medium.com/@KevinHoffman/composition-over-inheritance-in-pony-33bbe107914 Composition over Inheritance with Pony] |
* [https://medium.com/@KevinHoffman/composition-over-inheritance-in-pony-33bbe107914 Composition over Inheritance with Pony] |
||
* [https://qconlondon.com/ln2017/presentation/pony-co-designing-type-system-and-run-time QCon London: Co-Designing a Type System and Runtime] |
|||
* [https://www.infoq.com/interviews/clebsch-pony InfoQ Interview: Sylvan Clebsch on the Actor-Model Language Pony, Garbage Collection, Capabilities, Concurrency] |
* [https://www.infoq.com/interviews/clebsch-pony InfoQ Interview: Sylvan Clebsch on the Actor-Model Language Pony, Garbage Collection, Capabilities, Concurrency] |
||
* [https://c7.se/from-go-to-pony/ From Go to Pony] |
|||
* [https://www.infoq.com/news/2016/03/pony-fintech InfoQ: Using the Actor-model Language Pony for FinTech] |
* [https://www.infoq.com/news/2016/03/pony-fintech InfoQ: Using the Actor-model Language Pony for FinTech] |
||
* [https://www.youtube.com/watch?v=KvLjy8w1G_U Pony: Making it easy to write efficient, concurrent, data race free programs] at [http://curry-on.org/2015/sessions/pony-making-it-easier-to-write-efficient-concurrent-programs.html Curry On 2015] associated with [[ECOOP]] [http://2015.ecoop.org/ 2015] |
* [https://www.youtube.com/watch?v=KvLjy8w1G_U Pony: Making it easy to write efficient, concurrent, data race free programs] at [http://curry-on.org/2015/sessions/pony-making-it-easier-to-write-efficient-concurrent-programs.html Curry On 2015] associated with [[ECOOP]] [http://2015.ecoop.org/ 2015] |
||
⚫ |
Latest revision as of 01:36, 21 June 2024
Paradigm | Actor model, Object-oriented, Imperative |
---|---|
Designed by | Sylvan Clebsch |
First appeared | November 9, 2012 |
Stable release | 0.58.5
/ June 1, 2024 |
Typing discipline | strong, static, inferred, nominal, structural |
Implementation language | C |
License | BSD-2.[1] |
Website | www |
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]- ^ https://github.com/ponylang/ponyc/blob/master/LICENSE
- ^ "Verona FAQ". Github.
- ^ https://www.ponylang.org/media/papers/fast-cheap.pdf
- ^ 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)
External links
[edit]- Offical website
- Composition over Inheritance with Pony
- QCon London: Co-Designing a Type System and Runtime
- InfoQ Interview: Sylvan Clebsch on the Actor-Model Language Pony, Garbage Collection, Capabilities, Concurrency
- From Go to Pony
- InfoQ: Using the Actor-model Language Pony for FinTech
- Pony: Making it easy to write efficient, concurrent, data race free programs at Curry On 2015 associated with ECOOP 2015