Earlier quoted context omitted.
Pony does not prevent race conditions. Two actors can wait forever for the other to send a message, deadlocking.
Is deadlock considered a race condition? I typically think of a race condition an issue with concurrency where data might be modified by another thread which causes the program to return incorrect results.
Pony – High-Performance Safe Actor Programming
111–120 of 159 posts
Re: Pony – High-Performance Safe Actor Programming
#112Earlier quoted context omitted.
I don't know enough about ZMG to answer this. What little I know about it is mostly from a pure Pony version that a member of the core team worked on quite some time ago. Joe is probably the best person to talk to if you want to use ZMG as a reference point, you can find him on the Pony Zulip. https://ponylang.zulipchat.com/#
It's sort of a general question though. What happens if I use a C library from Pony that does or can potentially do unsafe things. I'm not sure I understand how such situations can be solved without some kind of a locking mechanism. I mean, the answer can be 'just rewrite the underlying library in Pony'. Which would be fair enough.
"It depends on the specifics" would be the general answer.
Once you use FFI, there's no guarantee of memory safety as the C code has access to the entire address space of the process. There is no sandboxing of foreign code at this time.
If the code you are calling isn't thread safe and you run your Pony program with more than 1 scheduler thread (pony actors get run on 1 or more scheduler threads- generally 1 per scheduler thread per CPU) then "bad things canhappen". Becaue you are running unsafe code that can be accessed from multiple threads- but... well, maybe you can structure the Pony API so that you don't do that.
It really depends.
Re: Pony – High-Performance Safe Actor Programming
#113I've only done hobby stuff with pony, but love the idea of it, and would love an opportunity to use it in production. I've found the community welcoming and helpful in my limited interactions. The standard library code is pretty easy to read, which somewhat mitigates the dearth of tutorials, howtos on the internet. The reference capability stuff can be a bit hard to wrap your mind around, but mostly in a good way, an…
Re: Pony – High-Performance Safe Actor Programming
#1144 months ago https://news.ycombinator.com/item?id=24398469 (thanks threatofrain!)
2019 https://news.ycombinator.com/item?id=20370448
2018 https://news.ycombinator.com/item?id=18212633
2018 https://news.ycombinator.com/item?id=17195580
2018 https://news.ycombinator.com/item?id=16768706
2018 https://news.ycombinator.com/item?id=16264845
2017 https://news.ycombinator.com/item?id=15558051
2017 https://news.ycombinator.com/item?id=14999899
2017 https://news.ycombinator.com/item?id=14676505
2017 https://news.ycombinator.com/item?id=13846063
2016 https://news.ycombinator.com/item?id=12331458
2016 https://news.ycombinator.com/item?id=10902906
2015 https://news.ycombinator.com/item?id=9482483
related from 2019 https://news.ycombinator.com/item?id=19241427
Re: Pony – High-Performance Safe Actor Programming
#115If curious see also 4 months ago https://news.ycombinator.com/item?id=24398469 (thanks threatofrain!) 2019 https://news.ycombinator.com/item?id=20370448 2018 https://news.ycombinator.com/item?id=18212633 2018 https://news.ycombinator.com/item?id=17195580 2018 https://news.ycombinator.com/item?id=16768706 2018 https://news.ycombinator.com/item?id=16264845 2017 https://news.ycombinator.com/item?id=15558051 2017 https:/…
Re: Pony – High-Performance Safe Actor Programming
#116Earlier quoted context omitted.
There are some escape hatches to get shared mutable reference. But in general those are impossible in rust.
Are they really "escape hatches"? Shared mutable state is as simple as `Rc::new(RefCell::new(x))`, or `Arc::new(Mutex::new(x))` for thread safety.
`RefCell` is one "escape hatches".
Re: Pony – High-Performance Safe Actor Programming
#117If curious see also 4 months ago https://news.ycombinator.com/item?id=24398469 (thanks threatofrain!) 2019 https://news.ycombinator.com/item?id=20370448 2018 https://news.ycombinator.com/item?id=18212633 2018 https://news.ycombinator.com/item?id=17195580 2018 https://news.ycombinator.com/item?id=16768706 2018 https://news.ycombinator.com/item?id=16264845 2017 https://news.ycombinator.com/item?id=15558051 2017 https:/…
i hope you have a tool that pulls all those links together for you.
Re: Pony – High-Performance Safe Actor Programming
#118For anyone wondering "Why Pony?" - they have a section called just that: https://www.ponylang.io/discover/#why-pony
There still isn't anything there that Erlang doesn't already have, excepting the theoretically-strong reference capabilities...which is what got me watching pony for a couple years. Pony needs to have something that shows how it's references are more/differently useful in a multi-actor program. I suspect that's a tall order.
Re: Pony – High-Performance Safe Actor Programming
#119Earlier quoted context omitted.
Is deadlock considered a race condition? I typically think of a race condition an issue with concurrency where data might be modified by another thread which causes the program to return incorrect results.
I think this might help: Data race vs race condition: https://blog.regehr.org/archives/490
Re: Pony – High-Performance Safe Actor Programming
#120Earlier quoted context omitted.
Thanks for taking the time to reply. (FWIW, I'm in the market for a new language. I've been mostly using Python in the past, but now I want something like Erlang or Pony, or maybe Nim, or Zig or D or OCaml or ...?) 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 Po…
There's an http server and a small "sinatra" like web framework. - https://github.com/ponylang/http_server - https://github.com/theodus/jennet Someone might have done SQLite for Pony, but I'm not aware of it. Writing network protocol stuff in Pony is usually pretty easy and the C-FFI is usually pretty easy which generally makes writing database connectivity (for at least happy path basics) fairly easy. (Add lots of c…