Hacker News new | comments | ask | show | jobs | submit login

Perhaps, one should borrow message-passing as a standard language idiom, actors and pattern matching on receive from Erlang, the way Akka did, instead of copying hat async/await ugly hacks.

Message passing as a core concept of a language is fundamental and necessary (given that interlop with ObjC is important), and having that and macros gives related control structures for free.




Message passing unfortunately means everything is copied rather than pointed at. Which, in the case of a smartphone is always the beginning of performance or memory related problems.

I think rust approach of having strong guarantees over memory ownage, and thus being able to share memory in a safe way, is a better direction for swift.


Message passing, it seems, is the basis for implementation of protocols, be it communication between objects in a hierarchy or between actors/processes in a system or nodes in a network.

It is not coincidence that message passing is the core concept in the original OO paradigm and in design of fault-tolerant distributed systems. Cells do message passing too.

I am not sure what is being copied here. Messages are just structured data (a molecule) in otherwise share-nothing architecture.


>It is not coincidence that message passing is the core concept in the original OO paradigm and in design of fault-tolerant distributed systems. Cells do message passing too.

This is not about "fault-tolerant distributed systems" though, but for "performance-first" for very CPU and memory expensive programs (video and audio processing, number crunching, etc).


Joe Armstrong thinks it is.


I doubt Joe Armstrong said anywhere that message passing can be as fast as shared memory for those kinds of applications.


He advocates "fail-fast" and "share-nothing" as fundamental principles - that's the point. With no sharing a failure of a single process affects no other, unlike threads with shared stack and state. For the same reasons Erlang is functional language with single bindings. Sharing of immutable data is OK, so message passing might be implemented using OS shared memory services.


>He advocates "fail-fast" and "share-nothing" as fundamental principles - that's the point.

He advocates those for totally different use cases.


[citation needed]


doesn't copy on write + "immutable" solve the copying problem?


The whole problem is that for speed you DO need the "write".

So copy on write ends up being copy.


It does not solve the problem if one needs to write or mutate data with any regularity.


I could maybe agree with you on the message-passing thing (was about to upvote you). But then you mentioned macros.


The macros he mentioned is the same the Swift team mentions -- hygienic modern macros, not some C-like crude text replacement system.




Applications are open for YC Summer 2019

Guidelines | FAQ | Support | API | Security | Lists | Bookmarklet | Legal | Apply to YC | Contact

Search: