5 ms·
Congrats on the release. As someone whose day job is elixir but whose side project passion right now is rust, a high performance, strongly typed, actor model la
by losvedir 8y ago
Congrats on the release. As someone whose day job is elixir but whose side project passion right now is rust, a high performance, strongly typed, actor model language like Pony is right up my alley.
My one hang up right now is the other half of the elixir magic: OTP. In particular supervision trees and genservers.
While Pony has an actor model and message passing for concurrency, I wasn't able to find anything OTP-like. What's more, I read some things that it was even impossible to express in the language since there's no mechanism to block and wait for a message. Is this true? Are there any plans down the line for support of this?
- weberc2 8y agoI hear a lot of hype about supervisor trees from Erlang folks, but very little description about what they do or why they’re useful. Are they applicable to other languages? Could someone point me to a good resource for someone who doesn’t know Erlang or Elixir?
- Zalastax 8y agoThey are very useful if you follow the philosophy of Erlang: let it crash. It's really important to get easy to understand distributed systems. A good introduction: https://learnyousomeerlang.com/supervisors https://learnyousomeerlang.com/supervisors
- vberg 8y agohttps://learnyousomeerlang.com https://learnyousomeerlang.com https://learnyousomeerlang.com/supervisors https://learnyousomeerlang.com/supervisors This book is imho a fantastic read that helped me understand Erlang a lot.
- pdimitar 8y agoIt is basically "whatever thing in your system has an external dependency that's not 100% reliable, isolate it in an actor/process that can crash and be safely restarted". Expand the concept to trees of dependencies and several possible after-crash strategies and you get very resillient apps. But to fully appreciate it, you have to try it. It sounds pretty generic when advocated for but when you code a bit around that, it gets pretty amazing.
- mirceal 8y agoYes. The concepts are applicable basically everywhere. For example: do you know how systemd restarts your service if it crashes? How about how k8s behaves when your health probes fail? It’s everywhere. Build it to crash fast if it has a problem. Have a higher level entity that monitors it and automatically restarts it/does something when it does crash. Now go meta and have supervisors watching supervisors and controllably crash or restart bigger parts of your system. (This is based on the “crash early”, “keep state consistent”, “have you tried turning it off and on” principles. It’s not new and you’re probably already doing it tona certain degree)
- losvedir 8y agoI really like this description[0]. It's broadly about designing programs, and handling robustness and state, so I imagine it would apply to other languages, although it does mention some erlang specific things. [0] http://jlouisramblings.blogspot.com/2010/11/on-erlang-state-and-crashes.html http://jlouisramblings.blogspot.com/2010/11/on-erlang-state-...
- Zalastax 8y agoAs far as I know Pony doesn't yet have a distribution story so supervision might not be priority for the maintainers yet. However, since Pony is an "Active Objects"-language, every actor in Pony is essentially an instance of a genserver - this is what makes it easy to type. Supporting more advanced communication patterns in a strongly typed fashion is rather difficult so for the foreseeable future I believe that a gradual typing approach will be the way to go. Genserver is also very powerful so Pony can likely see good success if they just build in some supervision strategies and make it possible to distribute.
- spooneybarger 8y agoThis is true. There is no distributed Pony at this point. It was a high priority early on but when we looked at everything we thought we needed for a 1.0 release, it didn't make the list. There is Sebastian's thesis which has an approach idea... https://www.ponylang.io/media/papers/a_string_of_ponies.pdf https://www.ponylang.io/media/papers/a_string_of_ponies.pdf And Sylvan and I spent a good amount of time discussing how to implement. Then a lot was learned while building Wallaroo over at Wallaroo Labs, we'd certainly lean on stuff from there as well. If anyone is interesting in working on distributed Pony, we'd be happy to help support you. Come by the IRC or developer mailing list. Let's chat. But, its not something that anyone is working on right now.
- zzzcpan 8y agoI believe you can express those things in Pony via higher order programming. Just like in Rust, although Rust got quite a bit farther on this.
- spooneybarger 8y agoPony core team member here: There are no block and wait patterns. That is true. You need to structure you app as an async one. All communication between actors is async. This has the nice side-effect of making it really hard to write in a deadlock. There are no plans to and wait at this time. It's not something that folks who are using Pony call for. It is something that folks coming from Erlang/Elixir want to see. Perhaps they end up dropping off and we end up with confirmation bias that our approach is right. Perhaps we are on to something. OTP wise, more patterns built into a library would be awesome and anyone who wants to take that one, we'd be happy to help support their effort.
- qaq 8y agoHehe in the same boat (- Elixir being a day job). Pony looks really interesting.
- spooneybarger 8y agoStop by the user mailing list or IRC some time! https://pony.groups.io/g/user https://pony.groups.io/g/user #ponylang on Freenode
- qaq 8y agoThanx will def. check it out