Live data from Hacker News

Pony: An actor-model, capabilities-secure, high-performance programming language

ponylang.io

61–70 of 284 posts

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#61
post #36

> The standard way to avoid these problems is to use locks to prevent data updates from happening at the same time. This causes big performance hits […] No. Modern mutex implementations [1] are extremely efficient, require only 1 byte of memory (no heap allocation), and are almost free when there's no contention on the lock – certainly much faster and much lower latency than sending messages between actors. [1] Like…

Sending a message between Actors can be just moving a pointer to a piece of shared memory. I think sending messages is more about the way you think about concurrency, more than the implementation. I have always found the "one thread doing "while True receive message, handle message" much easier to reason about than "remember to lock this chunk of data in case more than one thread should access it"

Unless you have NxN queues across actors[1], which is done on some specialized software but is inherently not scalable, queues will end up being more complex than that.

[1] at the very least you will need one queue for each cpu pair, but that's yet another layer of complication.

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#62
post #19

>This is a type declaration. The keyword actor means we are going to define an actor, which is a bit like a class in Python, Java, C#, C++, etc. Pony has classes too, which we’ll see later. > The difference between an actor and a class is that an actor can have asynchronous methods, called behaviours. We’ll talk more about that later. Who wrote this[1]? The Doctor? [1] https://tutorial.ponylang.io/getting-started/how…

I personally thought it was pretty well-written. It sticks to the details that are relevant in the moment so it doesn't detract or get bogged down, but it does let you know what other things are there so it doesn't feel limited or barebones.

This is my pet peeve. "We'll get back to that later" is almost never a useful thing to say, particularly not in writing, and it often just increments the mental burden of the reader by adding another loose end. Instead, outline the concepts you need within context and provide a "Read more" link.

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#64

As always with the languages, I think about what the ecosystem looks like. What libraries exist? Seems there is a list of available packages on their website: https://www.ponylang.io/use/packages/

I clicked one at random (net_ssl) to get a sense of what a package looked like in this ecosystem and how to install it, but it takes you straight to a github page which says it's deprecated and to use a different package (ssl) instead, which is not listed on the packages page. Not a great look, although it looks like it was only deprecated 2 weeks ago, so I'll give them a pass.

With such sanctified list of libraries, I think it is not unlikely, that more packages exist out there, that are simply not listed, or that there are repos out there, showing how to do things, but are not isolated libraries.

Maybe a third-party awesome list or so would be interesting.

Other than that, I guess one could get involved in the community to ask questions about things one needs for some project, or search more specifically for things one needs and hope to then find them.

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#65
post #59
post #20

Earlier quoted context omitted.

The syntax is the least interesting thing about the language, and hello-world examples demonstrate almost none of the syntax. This bit from the About page is notable: "never write a programming language. That’s like rule #1. Everybody will just tell you it isn’t needed and then argue about syntax."

The designer's syntax decisions tell you a lot about their semantic decisions, which languages they take inspiration from, and the language's philosophy about things like flexibility, correctness, and opinionatedness.

Or not. Mostly not in this case.

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#66

Earlier quoted context omitted.

You mean this executor[0] which is linked right there on the page we are discussing here? [0]: http://playground.ponylang.io/

They should probably put more than three lines of code in there?

The rust and golang versions are exactly the same.

Printing hello world is the default of the industry for this sort of thing.

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#67
post #65
post #59

Earlier quoted context omitted.

The designer's syntax decisions tell you a lot about their semantic decisions, which languages they take inspiration from, and the language's philosophy about things like flexibility, correctness, and opinionatedness.

Or not. Mostly not in this case.

I agree, in the case of Pony the interesting stuff is mentioned on this page:

https://www.ponylang.io/discover/why-pony/

Syntax doesn't really come into it.

Edit: I'm as fond of discussions of the design of programming language syntax as everyone else - just in this case the apparent novelty of Pony is at a more fundamental level.

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#69
post #17

I wish these language websites would put an example of some code right there on the homepage so I can see what the language "feels" like. I finally found some code in the tutorials https://tutorial.ponylang.io/getting-started/hello-world

Honestly, I get it. The document wants to tell you what's new and different under the hood, not what the language looks like superficially. Code examples don't actually tell you what the language feels like in production. It's kinda like judging a person's character by how they dress. I would be torn if I had to write intro documentation like this. On the one hand, people demand code examples, but on the other hand,…

In a way, leading with the core ideas and not with the syntax also shows what this language is about, and selects for people who are more interested in the PL concepts than its looks. After all, syntax is the bikeshed of programming language.

Re: Pony: An actor-model, capabilities-secure, high-performance programming language

#70

Earlier quoted context omitted.

Sending a message between Actors can be just moving a pointer to a piece of shared memory. I think sending messages is more about the way you think about concurrency, more than the implementation. I have always found the "one thread doing "while True receive message, handle message" much easier to reason about than "remember to lock this chunk of data in case more than one thread should access it"

Unless you have NxN queues across actors[1], which is done on some specialized software but is inherently not scalable, queues will end up being more complex than that. [1] at the very least you will need one queue for each cpu pair, but that's yet another layer of complication.

I think you only need one queue per actor? And then one worker per CPU core? I believe that how Erlang does it, and do millions of actors without any issues...
Post reply on HN