__red__
That's fine, we all have our preferences :D
try
somearray(outofboundindex)?
// stuff
else
errorlog.write("some message")
error
end
Sure you can make it propogate all the way up if you really want, but ugh… what a terrible idea for instrumentation.Pony doesn't force you to deal with errors a specific way. Pony forces you to make a choice so you can't just ignore it.
As with all things, we should use the correct language / runtime for the domain problems it's designed to solve.
The pony runtime makes other decisions (such as non-preemptable schedulers) which would have more of an effect on your use-case methinks.
Thank you for the discussion and your interest!
I think of pony actors in the same way as I think of erlang actors. They have a "mailbox", and when they receive a message, they wake up, execute some amount of code, and then go back to sleep.
This is how I think about it. This is not how it is actually implemented.
Here's the key that I think many people miss about pony.
Referential Capabilities DO NOT EXIST at runtime.
So let's talk passing a String iso from Actor A, to Actor B. (iso is the capability that guarantees that this is the only reference to this object):
// This is code in Actor A
actorB.some_behaviour_call(consume myisostring)
The "consume myisostring" completely removes myisostring from Actor A. Any reference to it after this point will result in an "unknown variable myisostring" error from the compiler.The reference to myisostring then gets sent to Actor B via its mailbox.
If ActorB was idle, then the message receive will cause Actor B to be scheduled and it will receive the reference to that String iso - completely isolated.
Now, if we're going to measure "performance of passing data between threads" as latency per transaction, then actor contention on a scheduler is going to be a bigger factor.
If you're measuring performance across an entire system with millions of these actions occurring, then I would argue that this approach would be faster as there is no spinning involved.
1. One scheduler per core. 2. Schedulers run one actor behaviour at a time. 3. When a scheduler has an empty work queue, they will steal work from other schedulers. 4. The number of schedulers will scale up and down with the amount of work (but never more than number of cores).
There are various parameters you can change to alter scheduler behaviour should your pattern of use need it.
The vast majority of people I discuss it with understand the value and the problems it is designed to solve, but they either don't have domain-problems that require pony's approach more than any other language - or the lack of supporting libraries makes them nervous over adoption.
As a pony developer for 5+ years, it can be frustrating - but I do understand.
For example, the OpenFile API returns you either a valid pony File object, or why it failed (FileEOF, FileBadFileNumber, FileExists, FilePermissionDenied, etc…).
What partial functions do is ensure that all of the error cases are actively addressed by the programmer, so you don't get panics or SEGVs.
This pony paper here describes the pony GC algorithms and compares their performance under various scenarios to other language GCs.
https://www.ponylang.io/media/papers/orca_gc_and_type_system...
The charts you want to look at are on pages 19-21.
It shows that ORCA (pony's GC) has extremely low jitter and is highly performant compared to the other industry leaders at the time of publication.
That is indented to assist the human reader, not the compiler.
The switched because they changed their business focus from one of their products to another.
I'm sure we'd all agree that the best language to use is the language the best fits your problem domain.
Rust was a better fit for that new product than pony. That's not a reflection on the language.
The main feature is its ability to safely share or move data around between actors in a way that is data-race and deadlock free. Pony doesn't use locks anyways :-)
A high level as to how it achieves this:
i. All variables have a "reference capability" - which is a description of what you can and cannot do with the variable alias (pointer) you have.
ii. The references to the data (think pointer) are passed in messages.
iii. As references are made and removed, actors send messages to the originating actor updating the count of references. When the count reaches zero, that data can be GC'd.
It's nice, because unlike some other language runtimes, it doesn't have to stop the world to work out what can and can't be GC'd. It's all done on-the-fly as it were.