Earlier quoted context omitted.
I am not an expert in Rust's mechanics and only looked at it superficially, but I got the impression that shared references can't be guaranteed (to not exist in mutable ways) all the way through an object graph. I am not surprised if I am wrong about that. It wasn't the main deciding factor for me... My primary factor was "Actor Model" and I was struggling with Erlang's lack of static types, so that put Pony in the f…
There are some escape hatches to get shared mutable reference. But in general those are impossible in rust.
Pony – High-Performance Safe Actor Programming
91–100 of 159 posts
Re: Pony – High-Performance Safe Actor Programming
#92Would Pony be a good choice for writing a backend for a web app? What's it like talking to a DB?
That really depends on your idea of what makes something a good choice. Most web apps generally need a lot of libraries to be "a good choice". Pony is lacking in libraries for "web development", so you'd need to do a lot of work that you wouldn't in other languages. That's the case with most areas with Pony. You'll invest time in developing libraries you wouldn't in many other languages. In return, you get the nice l…
It sounds like there is not (yet!) a package like Cowboy for Erlang for Pony? There is TCP server support but not HTTP and Rails-like stuff, eh?
If you don't mind me asking, what about using SQLite from Pony?
Re: Pony – High-Performance Safe Actor Programming
#93I'm sure that's true in some domains, but I think they're pretty narrow. E.g., if I were building an internal API that managed money, I might buy that. But I think the vast bulk of software is essentially exploratory. We ship something minimal and see what we next need. In that context, learning what we really need to do is far more valuable than doing the not-quite-right thing with provable correctness.
Re: Pony – High-Performance Safe Actor Programming
#94Earlier quoted context omitted.
This sounds a lot like someone learning Rust. Both languages solve similar problems with very different solutions that come with complexity overhead.
Pony and Rusts' solutions to the concurrency problem are almost identical - forbid shared mutability through the type system. In what way are they very different?
Pony is a completely new language based on the actor model where "threading" is a first-class operation and the type system is formally designed to make guarantees that make threads safer.
Pony really wants you to think differently about your problem and solution.
Re: Pony – High-Performance Safe Actor Programming
#95I don't know exactly how it works, but at some point it writes things to some memory address. This is the point where the Rust compiler starts complaining about the situation if you try to use the bindings from something that can potentially be sent between threads. So you use some mutex, or a lock, and maybe wrap the whole thing in an atomic reference counted entity.
What would be the Pony way of solving a situation like this? It does say that it is possible to directly call C or C++ libraries.
I'd really appreciate if someone from the Pony community can elaborate a bit on such use cases.
Re: Pony – High-Performance Safe Actor Programming
#96I just spent 5 min going through the website reading about pony and its goals and use cases. I still have no idea what actual Pony code looks like and I'm not sure where to click to find it. I even clicked the link "learning pony." Of all the places to see at least a hello world, I'd like one there please. When I am checking out a language for the first time, I like to at least see a sample of what I'll be committing…
https://playground.ponylang.io/
...but the example isn't very enlightening.
Here's a networking example:
https://github.com/ponylang/ponyc/tree/master/examples/net
with the Main being in net.pony and the rest being the infrastructure.
And here's the start of an HTTP 1.1 app server (basically, just the HTTP parser at this point).
Re: Pony – High-Performance Safe Actor Programming
#97Huh. This is something I don't think I agree with: "Incorrectness is simply not allowed. It’s pointless to try to get stuff done if you can’t guarantee the result is correct." I'm sure that's true in some domains, but I think they're pretty narrow. E.g., if I were building an internal API that managed money, I might buy that. But I think the vast bulk of software is essentially exploratory. We ship something minimal…
Clearly, the sentence you quote is making an unqualified absolute statement, which are usually easy to pick apart and tear down. After reading the whole philosophy, I'm not really sure what they mean by "guarantee" and "pointless" here. I doubt they're saying that all programming in "unsafe" languages is "pointless."
I suspect they could just reword that sentence to say something more clear. E.g. what kinds of correctness they weigh most heavily. Does Pony protect me from all classes of all possible bugs? No? Because that is impossible? Agreed. Then which kinds of bugs?
Just before, it also says: "The Pony philosophy is neither “the-right-thing” nor “worse-is-better”. It is “get-stuff-done”." This is admitting some sort of balance is being struck here...
Re: Pony – High-Performance Safe Actor Programming
#98I never saw Pony described as high performance. Now I'm interested
Re: Pony – High-Performance Safe Actor Programming
#99Earlier quoted context omitted.
> And many times the borrow checker is completely inadequate at preventing data races (frequently the case with distributed computing). The borrow checker (in safe rust) always[0] prevents data races. It can't, however, prevent race conditions (but neither can pony do[1]) [0] https://doc.rust-lang.org/nomicon/races.html [1] https://www.ponylang.io/faq/#data-race
Right, I should have said "race conditions"; it hadn't occurred to me that the two weren't synonymous. My point wasn't that Pony does prevent race conditions, but rather that non-data-race race conditions are much more common in my domain (distributed computing) or really any domain where multiprocess architectures are common so I don't benefit much from the static guarantees that Rust affords.