In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Today, I would like to share with you the relevant knowledge of what Pony is. The content is detailed and the logic is clear. I believe most people still know too much about this knowledge, so share this article for your reference. I hope you can get something after reading this article. Let's take a look at it.
Pony is an object-oriented, secure and high-performance programming language based on the AcTor model. Pony provides Sublime and Atom editing plug-ins, as well as VIM and Visual Studio support soon. You can debug using LLDB and GDB.
Pony is compatible with C programs, and its compiler can generate the header files of C from the Pony library, so that the Pony library can be called conveniently by the Candleship + program.
What is Pony?
You can think of Pony as something like "Rust meets Erlang". Pony has the most striking features, which are:
Type-safe storage security exception security no data contention no deadlock in addition it can be compiled into efficient native code developed in an open environment and released under a two-sentence version of the BSD license.
There are a lot of features mentioned above, but here I will focus on those features that are essential for our company to adopt Pony.
Why use Pony?
It is not easy to write fast, secure, efficient, and highly concurrent programs using most of our existing tools. "Fast, efficient, and highly concurrent" is an achievable goal, but with the addition of "security", it is much more difficult. For Wallaroo, we want to achieve four goals at the same time, and Pony makes it easier to achieve them.
High concurrency
Pony makes concurrency easy. This is achieved in part by providing a stubborn concurrency approach. In the Pony language, all concurrency is done through the Actor model.
The Actor model is best known for its implementation in Erlang and Akka. The Actor model appeared in the 1970s, and the details vary depending on how it is implemented. Invariably, all calculations are performed by actor, which communicates through asynchronous messages.
You can look at the Actor model in this way: objects in object orientation are state + synchronous methods, while actor is state + asynchronous methods.
When an actor receives a message, it executes the corresponding method. This method can be run in a state that only the actor can access. The Actor model allows us to use mutable state in a concurrency-secure manner. Each actor is single threaded. Two methods in an actor will never run concurrently. This means that in a given actor, data updates do not cause data competition or other problems that are usually related to threads and mutable state.
Fast and efficient
Pony actor schedules through an efficient work theft scheduler. Each available CPU has a separate Pony scheduler. This concurrency model of one thread per core is part of Pony's attempt to work with CPU to run as efficiently as possible. The Pony runtime tries to take advantage of the CPU cache as much as possible. The less code that interferes with the cache, the better it works. Pony is meant to help your code get along well with the CPU cache.
The runtime of Pony also has a heap for each actor, so there is no "stop everything" garbage collection step during garbage collection. This means that your program can always do at least a little work. So Pony programs end up with very consistent performance and predictable latency.
Safety
The Pony type system introduces a new concept: referencing capabilities, which makes data security part of the type system. The type of each variable in the Pony language contains information about how to share data between actor. The Pony compiler uses this information to confirm that your code is free of data contention and deadlock at compile time.
If it sounds a bit like Rust, it's because it is. Both Pony's reference functionality and Rust's borrowing checker provide data security; they just approach this goal in different ways and have different tradeoffs.
Does Pony suit you?
It is difficult to decide whether to use a new programming language on a non-hobby project. Compared with other methods, you have to weigh the appropriateness and immaturity of the tool. So, does Pony match you?
If you have a difficult concurrency problem to solve, then Pony may be a good choice. Solving the problem of concurrent applications is the reason why Pony exists. If you can do what you need with a single-threaded Python script, you probably don't need it. If you have a difficult concurrency problem, you should consider Pony and its powerful data-free, concurrency-aware type system.
You will get a compiler that will prevent you from introducing many concurrency-related errors and provide you with excellent performance characteristics at run time.
These are all the contents of this article "what is Pony?" Thank you for reading! I believe you will gain a lot after reading this article. The editor will update different knowledge for you every day. If you want to learn more knowledge, please pay attention to the industry information channel.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.