Live data from Hacker News

Pony – High-Performance Safe Actor Programming

ponylang.io

71–80 of 159 posts

Re: Pony – High-Performance Safe Actor Programming

#71
If you are going to create a new language in 2021 please make it use scoped + name-spaced module imports. Everything becomes difficult if you can't even know which variables are used where and what it is / originate from. Global variables are evil.

Re: Pony – High-Performance Safe Actor Programming

#72

I 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…

I agree, but for anyone who's looking, here's the Hello World page. https://tutorial.ponylang.io/getting-started/hello-world.htm...

Good thing we had you here or there'd have been no world to say hello to.

Re: Pony – High-Performance Safe Actor Programming

#73

Earlier quoted context omitted.

> It's also safe, much safer than rust. Can you give an example of this? How is Pony "much" safer than Rust?

As a member of the pony core team, I'm not comfortable saying Pony is safer than Rust. The approach of the two is different; each with their own trade-offs. Given how easy it is to use c-ffi from Pony, it can be hard with existing tooling to feel confident in what your Pony code might do. Once you call out via C-FFI, all safety guarantees are off. In this way, the c-ffi in Pony is as problematic for reasoning about s…

Is not the Pony c-ffi, while allowing theoretically the same unsafety, more uncontrolled than rust's "unsafe"? As in the latter case, as I have understood it, you get all the normal rust type checking, except for some pointer ownership exceptions. I have not explored either of the languages too the extent that I needed to use either.

Re: Pony – High-Performance Safe Actor Programming

#74

Earlier quoted context omitted.

Do you have some examples of programming language websites you do like?

Go is probably the best for this, it gives you a REPL on the homepage itself: https://golang.org/

And Rust has https://play.rust-lang.org/ - not a REPL, but a chance to kick the tyres before downloading anything.

Re: Pony – High-Performance Safe Actor Programming

#75
post #45

As a regular Pony user, and coding seriously in it for a few months, this is what I think; I rather fight the Reference Capabilities (easily the hardest aspect of Pony and probably the number one reason people give up) than to spend endless amount of time CHASING concurrency problems, or even worse, HOPING that I didn't forget some lock/mutex/whatever and ending up having data corruption. Pony is forcing me to do the…

This sounds a lot like someone learning Rust. Both languages solve similar problems with very different solutions that come with complexity overhead.

^ seconded

Re: Pony – High-Performance Safe Actor Programming

#76
post #16

it's really frustrating seeing these programming languages websites where you have to click in a million place before you can even see what the code looks like

Do you have some examples of programming language websites you do like?

the few that come to mind : Elvish : https://elv.sh/ Flix : https://flix.dev/ Crystal : https://crystal-lang.org/ Nim : https://nim-lang.org/

Re: Pony – High-Performance Safe Actor Programming

#77
post #50

Earlier quoted context omitted.

One thing that reference capabilities allow you to do is pass data between actors without copying. Erlang is very eager in copying almost everything you put in a message to a process (with the expection of big binaries, etc). Whether this is has a big impact on running systems remains to be seen, Erlang is very good at quickly collecting data. Another thing that I would say Pony has that Erlang doesn't is an easy FFI…

> Another thing that I would say Pony has that Erlang doesn't is an easy FFI mechanism (Disclaimer, self-promotion): It doesn't get easier than this: https://hexdocs.pm/zigler/Zig.html (I'll be dropping direct c support in there in the next release)

Zigler looks interesting! I've given it a look before, would be very nice if it could support Erlang too, but I imagine Elixir macros are doing a lot of work for you.

I think the biggest hurdles when writing NIFs are:

* Interacting with Erlang terms from C/Rust/Zig. Admittedly both zigler and rustler help in this regard, by wrapping Erlang terms. Pony is able to expose raw pointers and structs to C, which I've felt easier to work with.

* Dealing with the Beam's preemptive scheduler. This isn't as big of a problem now with dirty schedulers but still a mismatch compared to normal Erlang code. Pony uses a cooperative scheduler everywhere, so you'll already be used to splitting long tasks in different steps by the time you need to use the FFI, which makes the transition easier.

Re: Pony – High-Performance Safe Actor Programming

#78
post #70

Earlier quoted context omitted.

I agree, but for anyone who's looking, here's the Hello World page. https://tutorial.ponylang.io/getting-started/hello-world.htm...

Hmm > Pony doesn’t care about filenames other than that they end in .pony. But it might matter to you! By giving files good names, it can be easier to find the code you’re looking for later I cannot imagine anyone is going to be learning to code from the first time from this Hello World page. Although, the rest of the page is very much not for beginners, so maybe this was a fluke. Often with new programming languages…

That comment might be for programmers coming from languages where filenames do matter to the compiler, or languages like Java where the convention is so universally followed that many programmers don't know you can break it. Someone programming for the first time already "knows" that filenames don't matter, so it's probably not for them.

Re: Pony – High-Performance Safe Actor Programming

#79
post #45

As a regular Pony user, and coding seriously in it for a few months, this is what I think; I rather fight the Reference Capabilities (easily the hardest aspect of Pony and probably the number one reason people give up) than to spend endless amount of time CHASING concurrency problems, or even worse, HOPING that I didn't forget some lock/mutex/whatever and ending up having data corruption. Pony is forcing me to do the…

This sounds a lot like someone learning Rust. Both languages solve similar problems with very different solutions that come with complexity overhead.

At least with Rust, very few domains involve so much parallelism that one benefits from the overhead that the borrow checker adds to the development process. And many times the borrow checker is completely inadequate at preventing race conditions (frequently the case with distributed computing). Of course, Rust can recoup those losses elsewhere, by having better tooling or competing in domains where performance matters a lot, but I’ve not found the safety to be worthwhile in my domain.

EDIT: s/data races/race conditions

Re: Pony – High-Performance Safe Actor Programming

#80

Earlier 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.

At least with Rust, very few domains involve so much parallelism that one benefits from the overhead that the borrow checker adds to the development process. And many times the borrow checker is completely inadequate at preventing race conditions (frequently the case with distributed computing). Of course, Rust can recoup those losses elsewhere, by having better tooling or competing in domains where performance matte…

> 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

Post reply on HN