241 points · by mpweiher · 7y ago · 231 comments
I think the big thing that Kay missed was asynchronicity. What Kay was thinking of when he coined the term "object oriented" -- rather than C++ -- was a sort of synchronous actor model in which the actor would always wait for a response after sending a message. This maps nicely onto function calls, but considerably more power can be had by letting the actor optionally continue doing stuff while awaiting a response. Bacteria continue to metabolize after sending chemical signals to their brethren after all!
As I've seen it said, Erlang is Smalltalk done right.
The author contends that Go's "go" (and indeed async blocks in a number of languages) which launch new concurrent objects which the parent block doesn't have to wait for, are a form of badly structured programming.
https://vorpus.org/blog/notes-on-structured-concurrency-or-go-statement-considered-harmful/
https://news.ycombinator.com/item?id=21537706
The structured concurrency described there reminds me of "par" blocks in some languages (Occam, Handel-C, XMOS XC), where each statement inside the block runs in parallel and the whole block waits until all statements inside have completed.They do have asynchronous request/response patterns, but things can't be started and left to carry on running how they want, like you might think of bacteria.
One antidote to unstructured concurrency is to use something like trio in order to make async job spawning a function of a context manager (called nursery in trio) so all job results will be collected when the nursery block ends.
* Automatically reclamation of storage of an unreachable future [Baker and Hewitt 1977] (e.g. process in Erlang). For example, an Erlang process can be orphaned if its Process Identifier becomes inaccessible.
* Language support for holes in the region of mutual exclusion of an Actor implementation. For example, in Erlang it is necessary for application programmers to explicitly code a message handler for each re-entry into the region of mutual exclusion potentially enabling cyberattacks from outside the process.
* Automatic cancellation of requests that have taken too long. For example, in Erlang it is necessary for application programmers to explicitly code a time-out for each message send that might take too long.
Has this ever actually happened? Surely with as many deploys as erlang has, it would have been observed. A casual google search of "orphaned erlang process" shows the parent comment in the top four results, and no other results that mention orphaned erlang processes.
My point about erlang is that it's great precisely because, like all great systems, it doesn't dogmatically adhere to the academic design, and rather makes compromises and is refined by practitioners.
> re-entry into the region of mutual exclusion potentially enabling cyberattacks from outside the process
Typically you run your erlang actors inside of a trusted system. The only way to give untrusted actors access to your system, is explicitly (so no one does it). There are warning signs all over the place around every place where that might happen (for example distributed erlang) and in prod you really really shouldn't deploy distributed erlang without tons of security in depth in a deeply buried vLAN, or, TLS (instructions provided in the standard libs).
The only realistic vectors of attacks on your actor system is by compromising the entry points, like the actors which live to process your TCP or TLS entry points, but you can bet that ericcson has taken a lot of effort to harden those systems and, in fact, the ericcson SSL system was not vulnerable to the Heartbleed attack (despite using OpenSSL) because there are some very smart engineers at ericcson, and also the language generally doesn't have buffer overflows.
BTW, thanks for coming to my stanford ee380 talk a couple of Februaries ago -- unfortunately I wasn't aware of what you looked like, so I didn't get that you were in the audience at the time.
Determining this property of a program seems to me to be about as hard as the halting problem, since (1) an Erlang process can send its Pid to another process in a message, and (2) the VM/compiler can't tell a priori whether an erlang process will access its own Pid, or even send a message, in the future. I haven't read the paper you linked though, so I'm sure they found a way around this.
> Automatic cancellation of requests that have taken too long. For example, in Erlang it is necessary for application programmers to explicitly code a time-out for each message send that might take too long.
https://hexdocs.pm/elixir/GenServer.html#call/3
> timeout is an integer greater than zero which specifies how many milliseconds to wait for a reply, or the atom :infinity to wait indefinitely. The default value is 5000. If no reply is received within the specified time, the function call fails and the caller exits.
I consider bullet 2 to be a feature of Erlang, not a bug. If a module implements a behavior you know it implements those functions, there's no checking needed. Yes, it increases your attack surface, but outside apps should not be messaging Erlang processes directly.
Bullet 3 seems like sugar. You can wrap the call in your own code that specifies a default timeout.
I'm not saying your concepts are wrong, they are interesting and a more complete/accurate Actor model implementation in Erlang could be a good thing. However, the points you specifically made about Erlang do not seem to me to be needed adds to the language.
There is still no credible evidence that the actors system is better than the more traditional way of writing distributed apps, especially now that more and more languages offer an increasing amount of asynchronous approaches.
Erlang is indeed Smalltalk done right, but, as the OP wrote on the blog, it is not only about messaging and is about the additional constraints.
We've seen REST principles used within a single computer in the AppleScript system and protocol, for example, where you could think of applications running on a single computer as being individual computers in their own right and you need to be able to manipulate them using messages that talk using representations of objects in these applications. For example, "window 1" could be a representation for the first window in an application according to some internal ordering in it.
We also see REST-like interfaces at various system boundaries - for example, addressing textures on a GPU when preparing instructions on the host CPU. Databases too provide tables as resources and produce/consume representations of these tables to perform their functions. So it isn't surprising to see connectors to APIs exposed via ODBC or REST APIs to RDBMS tables as with PostgREST.
So the "InProcess-REST" is in principle understandable as an application architecture pattern, though with the caveat that I haven't gone into the specifics of the OP's work on this (expensive book, etc.).
In contrast to DLLs, shared data, COM+, ActiveX, plugins, and so forth.
Terrific observation. Thank you.
https://github.com/Web-Prolog/swi-web-prolog/raw/master/book...
Quoting from the introduction:
"In particular, we pick the features that make Erlang into an actor programming language, and on top of these we define the concept of a pengine – a programming abstraction in the form of a special kind of actor which closely mirrors the behaviour of a Prolog top-level."
And quoting from Section 1.3 of the current draft:
"Is the actor programming model compatible with the logic programming model, and does the combination of the two models make sense? Yes, we will try to show that the actor programming model of Web Prolog is able to co-exist harmoniously with its logic programming model, and that both models are usable in the same program, with actors used for modelling the reactive, deterministic interfaces to the user and other external entities, and with the non-deterministic component behaving as an actor, encapsulating the non-determinism."
Chapter 3 cites your work directly:
"Actors, as specified in (Hewitt et al., 1973), involve entities that have their own mailbox."
If you look at the various histories, it seem like Smalltalk 76 was the point at which the system was made practical, and Smalltalk 80 was a refinement of that. Alan himself has repeatedly said that he was not very happy with that version.
Thus the message passing model in Smalltalk-72 was closely tied to a particular machine model and programming language syntax that did not lend themselves to concurrency. SENDER was retained as part of the message-passing protocol, which is problematical for distributed systems. Also, although the system was bootstrapped on itself, the behavior of language constructs was defined (like Lisp) by an interpreter instead by their response to eval messages.
Actors appeared after I gave a talk at MIT about the very first Smalltalk.
There were several later ideas that were discussed at Parc but not taken up because of the whirl that was already going on. One of these was derived from McCarthy's "fluents" and "situations" (essentially a labeled states/layers idea for allowing concurrencies without race conditions -- this was done very well in David Reed's 1978 MIT thesis.
Another was not waiting for replies. This was in the original set of ideas -- via biology and OS techniques -- but never got implemented in a deep way. The hardware we had at Parc was tiny and Smalltalk was expressive enough to fit a lot into a little.
Another set of ideas that were completely missed appeared in LINDA by Gelernter. This (and the larger ideas around it) are very good ways to deal with larger scalings, etc.
Additional important influences in addition to SmallTalk-72 [Kay November 1972] were Petri nets, Planner [Hewitt 1969], capability systems [Dennis and van Horn], semaphores [Dijkstra], the lambda calculus, and Scott-Strachey semantics failure to integrate everything using the lambda calculus.
1-way message passing is most important for hardware systems in which there is near certainty that a message will be delivered and there is no need to wait for an acknowledgement of receipt.
[1] Briot, Jean-Pierre. “Actalk: A Testbed for Classifying and Designing Actor Languages in the Smalltalk-80 Environment.” ECOOP (1989).
See the following: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003
Also actor systems are fundamentally stateful and don’t mesh well with FP. Are they better than threads? Of course, but it’s a low bar. Hopefully some abstraction will be discovered that offer significant improvement over actors, but I wouldn’t hold my breath. Stuff like futures are great and can solve some problem, but are not general enough to replace actors or threads.
def sum(x: DbInt, y: DbInt) = DbActor.get(x) + DbActor.get(y)
With Akka, none of this is possible. Once actorA received the Sum message, first it would have to send the Get messages to DbObject and update some record indicating I’m waiting for two Get responses while also saving who I’m supposed to send the data to. Then I need to have a big match statement and update the record whenever I get that specific response. Once I finally have received the two responses, I look up where to send my message, and then finally send my SumReturn() message.
It’s a total nightmare and it sucks big-time. A lot of Akka code just ends up being maintaining these large dictionaries keeping track of all the unfinished stuff I eventually need to send various actors when I finally receive all the ingredients.
And it starts to get really bad when you have hierarchical actor structure and one of the terminal actors needs some information held by the top nodes. Then I either need to forward the message up one by one maintaining state along the way, or find the parent of the parent of the parent and send the message directly. And if I do that, now my root actors are talking to everyone else, and the information partitioning advantages of the hierarchy are broken.
There’s one actor topology that really shines though: directed acyclic graphs. If I only send information one way, like a waterfall, actors work really really well. Great for bioinformatics or other ML/data science pipelines.
I was just listening to this today morning, where I heard Joe mention in the podcast something similar on those lines (though I believe he even mentioned about prolog+concurrency was wat led to Erlang and Plex)
https://softwareengineeringdaily.com/2015/11/02/erlang-with-...
I disagree ...
In the Erlang model the messages are no longer just function calls with single dispatch. Imagine for example that method calls on String values would be asynchronous actor messages. That would be absolutely awful.
OOP isn't just about the actor model. OOP is also about encapsulation and polymorphism. In a static language, we're talking about row or subtyping polymorphism, i.e. methods of "ad hoc polymorphism".
And polymorphism and encapsulation transcend the actor model. I actually really hate the actor model, because asynchrony makes everything harder and actors are too low level, whereas OOP in general is passable as a paradigm in the right context.
> Bacteria continue to metabolize after sending chemical signals to their brethren after all!
I absolutely love the metabolism metaphor but it doesn't map directly to computer programs as we write them today.
Metabolic pathways form an intricate system:
https://upload.wikimedia.org/wikipedia/commons/a/a8/Human_Me...
Glycolysis, for example: starting from glucose at the top, we can follow its decomposition in the cell all the way to the mitochondrion.
This is similar to Unix pipelines. However, on Unix we must manually construct the pipeline:
find ~/notes | grep TODO
In a metabolism-like system, the mere existence of these programs would be enough to provoke computation. I'd write "~/notes" somewhere and the find and grep programs would somehow know the data was meant for them and automatically execute themselves.Enzymes are analogous to programs running in parallel. They are completely independent and don't interface directly with each other. They implement a process just like functions do. However, they don't explicitly call upon each other to perform a task.
Substrates and products are analogous to data of highly specific types. Catalysis occurs when substrate and enzyme come close enough to interact. The enzyme takes the substrate from a shared environment and releases the product into the same environment where the process repeats with other enzymes. This environment is most commonly the cytoplasm.
Enzymes determine whether their substrates are compatible by their chemical structure. This points towards structural typing. When glucokinase phosphorylates glucose, it becomes a different substrate: glucose 6-phosphate. Likewise, when a function adds a property to an object, it's structure changes and so does its type.
For example, let's take the following functions:
f : A -> B
g : B -> C
h : C -> D
In a metabolic system, there is no need to explicitly write code like: a = A(input())
h(g(f(a)))
Rather, they would immediately consume values of type A when they enter the system and the output would be a value of type D in the environment. The computer would fully metabolize data whenever it becomes available and go idle afterwards. As if the programming language's virtual machine was constantly processing all objects in the system: for object in objects:
for function in functions:
if function.argument.type == object.type:
result = function(object)
objects.add(result)
objects.remove(object)
break
It would be like polymerase chain reaction: throw DNA polymerase, nucleotides, some ions, the target DNA and its matching primers in a reaction tube, heat it up in a thermal cycler and the copying will begin happen because all the pieces are in place.1. https://en.wikipedia.org/wiki/Blackboard_system 2. https://en.wikipedia.org/wiki/Blackboard_(design_pattern)
The blackboard model isn't quite accurate though. Chemical signals have spatial locality, propagation delay, and half-lives. An asynchronous, peer-to-peer mesh network of actors would be a closer approximation to the bacterial signal model.
As I see it, It's not, but it’d be a decent platform to build an asynchronous smalltalk on top of. One key thing it is missing is a convenient syntax for defining processes (either via instantiable templates equivalent to “class” in many OOPLs or as singletons equivalent to “object” in Scala) in terms of the message handlers and local state (volatile state of the kind that would be held in the process dictionary and the kind of “transactionally updated” state that, in Erlang, would be carried in function args.)
So the convenient Syntax to define a process is a function declaration. Plus, calling "spawn" to start the process.
Of course, as other responders pointed out, there is also OTP, an established framework (not syntax) to define processes with predefined, battle-tested behaviours.
I mean this in regards to the "true" message-passing type of actor objects, and not OO as it came to be post-C++ and Java. The reason being is that actors 1) fundamentally involve themselves with state and time, and 2) connect subject and recipient together directly.
In relation to 1), most business problems involve _data_ processing, and the thing about data is it is immutable. It's essentially a solid state type of activity, and bears no resemblance to the organic, messy world of biology where things are changing. For problems like these, you really want to avoid state in your program, and persist state after data transformation in an actual database. Concepts like stateful actor supervision hierarchies, and what to do with clearing mailbox state when something goes wrong are fundamentally complex. Those concepts are also broadly unnecessary (and arguably harmful) for most request/response or async pub-sub type software. I can't count the amount of time I've wasted redoing systems on an actor model to be a simple "stateless" request model. On all of those occasions, the model that didn't persist state in-app was more reliable, easier to understand, less code, and more maintainable.
With respect to 2), actors basically violate all concepts of dependency injection. Actors need to know exactly where they're going (or you can add a proxy, and now your state graph is even more complicated), and even with message passing, program flow is dependent upon _time_ and the order in which a program is run. This is a large step backwards in my opinion.
I feel that languages like Elixir that pride themselves on stateless, immutable functions, have a deep contradiction internally embracing the actor model, because it is none of those things. Sadly, I also predict that this generation of Elixir programmers will learn the lessons of the Waldo paper the hard way: you can't just throw an actor model over the network and have it work great. (I think it's especially interesting that most of the success stories around modern day actor systems involve problems that can withstand data loss: telephones, IOT, content, media streaming, games, etc.)
To quote two other computer legends, Fred Brooks and Linus Torvalds are right: data not behavior is the more crucial part of programming.
Actors focus on the behavior, whereas the data is the part that is really important.
What `git log` does isn't all that important relative to how the git object model is structured, as the latter dictates the former.
> I can't count the amount of time I've wasted redoing systems on an actor model to be a simple "stateless" request model.
So much this. So often people forget that "it's just code". It can run on a toaster, or a mainframe, or a VPS, or a Docker container, or a Lambda function. The lion's share of code should be structured as input => output in the most straightforward way possible.
The actor model of "actors as services" and "messages as API calls" that has practically won in the real world. It also has the advantage of not being tied to one particular VM and it's polyglot by nature. It also isn't something that can be "scaled down" to language level constructs, and maybe that's for the best. Cells aren't made up of organs or of other smaller cells (mythocondria are quite exceptions, and the pattern goes only one level deep).
I think the deeper truth here is that truly good architectures are emergent/evolved, not designed/architected... only problem is that they tend to emerge/evolve on time scales longer than the lifetime of most businesses, so you can't take the approach of "let's evolve the right architecture" and actually be able to ship anything on time. Don't know a "solution" for this other than staying humble and mentally flexible.
Quite zen-ish ironical to think that the deepest wisdom we got so far in distributed may be the "PHP + MySQL" model of statelessness, short live isolated processes and business-valuable state kept in specialized storage systems :) The language you use for message processing is largely irrelevant as long as you keep the processing of messages isolate and transient (eg. throw away everything, including leaked/overflowed memory, after processing a message and replying - most systems besides PHP still fail at this!), the data store is also irrelevant as long as it support some basic transactional guarantees and you can easily back it up and import/export data from it to other systems better suited for other tasks.
PHP + MySQL was necessitated for a class of computer programs that process durable, broadly distributed information.
And the "deepest wisdom" is to ignore the distributed nature as much as possible. Yes there is a primitive actor-like model but that is because we more or less have to meet business requirements. If it were possible to scrap the distributed nature of it, we would.
You talk about supervision trees as if they are an avoidable source of complexity. Well if you're going to design a stateless request system you'll still need systems to manage dns lookups, elastic load balancing, and what is going to happen when a backhoe cuts the fibre to the data center where your code resides. That complexity will exist no matter what, it's just that when you use the beam you do it mostly in one language instead of having to wrangle reams of YAML with a tee ruler.
Have you ever deployed anything in Elixir? Your commentary makes it seem like you only have a superficial and incorrect understanding of the relationship Elixir has with statefulness and statelessness.
Hell, your primary complaint, is addressed right in the Elixir Documentation: "When not to use a GenServer" https://hexdocs.pm/elixir/GenServer.html#module-when-not-to-...
> If you don't need a process, then you don't need a process. Use processes only to model runtime properties, such as mutable state, concurrency and failures, never for code organization.
I strongly recommend you watch "boundaries" by Gary Bernhardt. This talk (which precedes elixir) exemplifies the programming philosophy that elixir has attained, though I don't know if that evolved organically or not. The point is, you have to accept that some parts of the universe are going to be stateful. You model those parts carefully, and then encapsulate it in a stateless core which precisely does only data transformations.
While actors definitely are a powerful mechanism for reasoning about stateful systems, most business systems are better off without having to design their own _technical_ distributed systems or in-app persistent state model. There is a reason that dedicated systems like Zookeeper, Redis, squid, relational databases, etc. exist, and that's because those things are insanely hard. Those systems also do not need to know about your business problem.
The actor model, and Elixir w/ OTP subtly encourage coupling of technical, distributed systems problems in the same application scope as the business problem. This is where that thorny state comes into play, and I believe it's a fundamentally wrong instinct. (It is also an instinct that is relatively vocal within the Elixir community: "throw OTP at it!", "once you need to scale, you can just add more machines to your problem!", etc.).
I have a rule on design reviews. I ask the team "is this system a technical system or a business system?" If they say "both", I ask them to make it into two systems, one technical and one business. Most likely, a "simple" technical system that does what they want already exists, and we can use it. While OTP and actors are good at designing interfaces or protocols for distributed systems, writing bespoke error handling for your business code with actors is going to be buggy and wrong. Make the business code pawn off state coordination or storage problems to systems with known, provable properties and a remote interface. (That interface will also be usable by other languages, and not tied to the Erlang VM).
I disagree that Elixir encourages coupling those systems. While erlang comes with no such help, in Elixir, you should be decoupling your distribution problems from your business logic by putting them into different applications within the same umbrella. Sure, there will be a coupling in the sense that they will live in the same VM, but that is abstractly similar to "our microservices all live in {AWS/GCP/K8s}", especially given the level of process isolation that the BEAM affords you.
But for all intents and purposes (program design, testing, heck you can even pick and choose components for deployment) they are decoupleable.
Of course, many business Actors never change their behavior. For example, a quarterly report to the SEC never changes although additional reports to the SEC may correct information in previous reports.
Of course, you know that Factorial is an Actor that never changes behavior :-) Also, the (infinite) list of prime numbers is an Actor that never changes behavior.
It turns out that discrete-event simulation isn't used much, and that async model isn't all that useful for other things. If you've never seen a discrete-event simulation, here are some in Flash, of Disney ride line management.[1]
It seems like we should be able to formalize a generic meta-programming language that describes discrete components. 'actors' would be concepts close to functions that receive inputs and return outputs, everything inside would be generally considered synchronous. These actors speak to other actors via addresses. That idea was all outlined by alan kay. Furthermore, these actors can live anywhere. They can be running on a single CPU, live across multiple threads, cores, processors. Ideally you just throw more processors or remove processors from the mix and the system distributes.
Where the rubber meets the road is all the communication mediums. The lowest abstraction is your actor return address is a stack pointer. The highest is the return address is another system (what we currently do with RESTful communications).
Once all the inter-actor controls are sorted out, there would need to be a system of dynamic resource distribution. The profiler/scheduler should be able to identify things like - this actor is handling 85% of traffic, distribute the actor to 6 cores - the cost of the route from a core to a core on the same processor is X, the cost of the route to a core across a network is Y - distribute actors that have the most cross communication as closely as possible - payload size would also need to come into account
on top of that, tooling that identifies workload-specific needs could also be identified: - this set of actors should be considered critical and available on % processors - take into account things like inter-region availability.
A lot of these concepts have already been hashed out and you notice the parallels to things like network architecture. Ideally in the end a 'system' would simply be a pool of usable resources e.g. SYSTEM1: my laptop, an AWS server, my phone, my watch. Computation work is unevenly distributed to the system based on route costs, computational power...even storage capabilities and peripheral access (printers, cameras, etc). A new actor would get initialized in the network and it could be scheduled on your desktop or your tablet. Eventually your system would just become an amorphous workload.
My desktop might begin distributing subsets of things that currently run locally to my AWS server because it's closer to the public API i'm accessing. If actors were generic enough they might be identified and made a reusable pool for multiple applications.
Sorry for the stream of consciousness.
It's not that simple. Objects that can assume locality are written differently than those that can't. The optimize for fate sharing, low latency, etc. If you have just have a mesh of floating objects, you must remove all of those optimizations.
Objects as conceived in Simula-67 are not universal primitives of digital computation. However this was remedied in 1972 with the invention of Actors.
It is very important that Actors rigorously formalize the rules for digital computation. See the following:
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003
https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3459566
In this way, computer systems themselves can participate in discourse with humans about the nature of digital computation and associated software systems.Every important scientist (including Einstein) made numerous errors. Fermi received the 1938 Nobel prize [Fermi 1938] for the discovery of the nonexistent elements “Ausonium” and “Hesperium”, which were actually mixtures of barium, krypton and other elements. I have made quite a number of errors myself, although I am certainly not of the caliber of Einstein or Fermi! It is important to find and rectify errors ASAP. In order to make progress, we must make errors.
Reusable Scalable Intelligent Systems cannot be implemented using the current common programming practice of stateless sever code + relational data base. See the following:
https://papers.ssrn.com/abstract=3428114Hmm...I don't quite understand your criticism, particularly as you yourself point out that "every important scientist (including Einstein) made numerous errors", and go on to describe some of those errors.
The fact that Alan is a towering figure who has contributed more to this field than I (and most people) can ever hope shouldn't mean that we cannot point out where we believe such an error was made, should it? That's not how science, even computer science, is supposed to work.
As a matter of fact, it seems even more important in the case of such an influential figure.
Of course the article points out that it was (a) a "brilliant" (quote from the article) construction and (b) the fact that it was wrong wasn't really Alan's fault, because he didn't have any large computer networks to look at, so (c) using the same brilliant construction with up-to-date inputs gets you a better answer.
The claims you make about the impossibility of things that are clearly being done seem a bit strange.
And latency is only one of the problems. Partial failure is another. It's often convenient for authors of colocated actors to assume fate sharing. If they can't, they have to handle a much wider set of failure modes.
I agree that latency needs to be carefully controlled. But the software engineering can be complex!
It sounds quite promising in theory but more people would need to try it before we know how beneficial it is.
Would it be possible to open source the library or be able to read an actual code sample ?
Might help popularize it better than if this knowledge were in a paper.
The paper actually talks a little about results: reports were of code size and productivity improvements in the 50% / 2x region.
I actually met one of the guys who had provided that written feedback a little later, and he told me that although he had written 2x, the actual results were more like 10x. The reason he wrote 2x was that he thought 10x would not be believable/believed. I have a feeling he is right about that ;-)
The libraries are open source, at https://github.com/mpw/MPWFoundation (The lively project also has a version https://lively-web.org)
The Stores/Storage Combinator base implementation is in the Stores subproject, so https://github.com/mpw/MPWFoundation/tree/master/Stores.subp...
There are quite a few more stores in Objective-Smalltalk (http://objective.st, https://github.com/mpw/Objective-Smalltalk), which provides linguistic support for stores/storage combinators with Polymorphic Identifiers.
The Objective-Smalltalk project also has a number of example compositions, but I do need more sample code.
> Implemented in Squeak Smalltalk, Croquet supports communication, collaboration, resource sharing, and synchronous computation among multiple users. Applications created with the Croquet software development kit (SDK) can be used to support highly scalable collaborative data visualization, virtual learning and problem solving environments, 3D wikis, online gaming environments (massively multiplayer online role-playing games (MMORPGs)), and privately maintained or interconnected multiuser virtual environments.
> Since release of the Croquet SDK in 2007, the SDK has not been under active development. All further development of the technology has occurred under the Open Cobalt effort.
I've heard Kay say this a few times, but it's always seemed wrong. Self similarity is a powerful scaling mechanism, yes, but Smalltalk objects and computers aren't self-simlar. Computers are Turing complete. They can become any machine. That's what they're good for. Objects can't.
See the following: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003
In-Process REST essentially means applying the applicable mechanisms of REST in-process:
1) URIs
2) a few well-defined verbs
Benefits:
1) Common, concise and familiar API for talking about storage. (Check how much API surface there is for talking about storage variations in typical OO libraries. In Cocoa, for example, it's atrocious).
2) Paths. For some of the benefits of paths in general purpose programming, see The Programming Language Aspects of ThingLab [2]
3) Avoidance of the architectural mismatch between storage-oriented problem domains (most of them), and procedurally-based implementation technologies.
4) Composability: this is the heart of the Storage Combinators paper, you can plug these things together to obtain the desired functionality.
5) Performance, at least compared to other ways of getting similar benefits, such as (over-)used of filesystems, FUSE, Microservices for architectural reasons etc.
...
[1] https://www.hpi.uni-potsdam.de/hirschfeld/publications/media...
[2] https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90...
My opinion is that the actual innovation is the ‘polymorphic identifiers’ they introduced in their previous paper, which is definitely worth a read as my one line description of it can’t really do it justice. It’s kind of like being able to overload the assignment operator. Once you have that kind of feature, it’s sort of a no-brainer to say ‘Hey, all I/O (variables in memory, filesystems, etc) should use the same interface’.
However, the In-Process REST paper[1] has a section listing the constraints of the REST architectural style, and we actually match those constraints very well, apart from the obvious bit of not being a distributed system.
The constraints (from Fielding's dissertation) are:
1. Client Server
That one's the obvious miss, as long as you define client and server as being separate computers.
2. Stateless
If you follow the model, then any state mutation is done via the "verbs", so yes. No more or less enforceable by the mechanism than in real REST.
3. Cacheable
Yes.
4. Layered System
See Storage Combinators. Yes.
5. Codee on demand (optional)
Doesn't make sense, so no. Optional, so no big deal.
6. Uniform Interface
This is the one with the URIs and verbs, so yes.
HATEOS was at least partially adhered to in the system we built, but again not enforceable by the model and also widely not adhered to in the wild.
[1] https://link.springer.com/chapter/10.1007%2F978-1-4614-9299-...
i mean, _i_ always find it intriguing that in OO, world can be decomposed in terms of interfaces that vary on a single type, whereas, imho, what you _really_ need is to parameterize your program by the structure of data that it manipulates i.e. a notion of bunch of interfaces spanning across multiple types...
Erlang is right there, i advise a look :)
I definitely did miss that.
Back to the drawing board, I guess... ;-)
If however we think of abstractions outside of reality as we know it. Things like imaginary numbers, negative numbers and non-euclidean geometry appear.
Outside of reality an Object can be further divided into two things that don't really exist in the real world: pure state and pure action (from certain perspectives, ... technically the function still occupies state and can be thought of as an object). In CS it feels as if the discovery came backwards the real world analogue (OOP) came after the abstraction that doesn't exist in reality (mathematical functions and numbers).
Anyway, I'm taking this somewhere that has a relation to the parent article so hear me out. Function and State as separate entities is a smaller organizational subdivision then Objects which are Functions With State. Separating Function and State solves a big problem that is central to Designing Systems. The problem is associated with modularity problems grouping two primitives together into a single entity. What happens is more often then not we don't fully understand the true nature of the thing we are building. So in the initial designs of an OOP system we unionize a certain function with a certain state and it seems like the correct thing to do at the time, but over time as requirements change or we gain greater knowledge of the problem we're solving we realize that the function/method is better used in a separate context. But it's too late... at this stage the method that we want to pull out is dependent on the object and that object is a dependency for multitudes of other objects. Thus we either end up rewriting code or creating a hack, thereby inventing technical debt.
If that method was never unionized with state, if we used smaller subdivisions in our code where state and functions are separate entities then this would be much less of a problem. The function would not be tied to state and that function can be executed in the context of anything.
This metaobject post talks about the isomorphism between OOP and HTTP/REST/Servers and talks about the success of that model and how we should bring it down to the process level. I'm thinking what's the point? JAVA and smalltalk and a bunch of other languages fill that role you're just changing the semantics, but the structure is still the same.
He also fails to talk about the problems we have with concept of HTTP, REST and servers taken to the max. We have a term for this it's called "microservices." The problems we have with microservices are exactly the same problems that I just described. I described a problem with OOP and microservices are an OOP model. The difference here is rather then unionizing action and state with Code it unionizes state and action with real cold hard metal. The actual machine that holds state and "does stuff" is the object. So all the problems of realizing how to divide or unionize services and state in microservices are exact same problems that existed when trying to figure out what methods belong with what object in OOP, only when the actual machine is your abstraction barrier, things are much harder to change. The problem is well described even by OOP advocate martin fowler: https://martinfowler.com/bliki/MonolithFirst.html. His solution for this problem is less then ideal... basically... build it wrong first then tear it apart and mutate it into something else... I don't even know if martin fowler realizes that he's also talking about OOP as the design structure of microservices and OOP are isomorphic.
Anyway, I digressed... and I'm still disagreeing with the OPs conclusion. It makes no sense to me why we should bring this server/HTTP model down into code given the fact that it has all these problems and that it's basically already done with JAVA. The way forward is actually movement in the opposite direction. Don't abstract code into a server model rather abstract the server model into code. Basically code that doesn't compile into assembly language but compiles into apps that are automatically networked across a constellation of servers. It's a very hard thing to implement but being allowed to separate function and state at the server level like we do in code is, in my opinion, the way forward.
It also sort of exists in a minor way with the whole infrastructure as code thing and aws lambdas.
Non-OOP functions are still written against the interface of their parameters, so they remain tied to state.
Technically, the function body itself is a form of state but I addressed this technicality above.
Emphatically: no, it does not. It makes the point that these are not isomorphic, at all.
What I interpreted as what the author means by "what Alan Kay got wrong" is that Alan was just looking at the wrong isomorphism. The wrong aspect of essentially the same concept.
Outside of the OPs opinion though. I personally believe that there is an isomorphism between infrastructure and OOP.
> I disagree. He says ...
Hmmm..."he" (check my bio) might disagree with your assessment of what "he" said . ;-)
> the REST model could be better then message passing when scaled down
Yes. That's because it is not isomorphic to objects+messages (but built on top).
> then "he" says Alan Kay is right about messaging but that it's just one aspect of his storage combinator concept
Neither of those. It think he's right about generalising from "messages" to "interstitial/ma", which to me (and possibly only to me) means "connectors". That's the general concept (connectors define architectural styles, REST and objects/messages are specific architectural styles). Now of course "messaging" is closer than most other attempts.
> Alan was just looking at the wrong isomorphism.
Not really, he was scaling down the wrong thing, because the scaled up thing did not actually exist, so he had to imagine it, and when it did come into existence it did not match what he imagined it to be (and scaled down).
scaled up | scaled down
------------------------------------------------------------------
1. imagined computer network | objects and messages
2. real global network (WWW/REST) | In-process REST
And my evidence for (1) being wrong is that scaling objects and messages back up did not actually work. scaled down | scaled back up
------------------------------------------------------------------------
1. objects and messages | CORBA/SOAP (Note on Distributed Computing)
2. In-process REST | WWW/REST
Anyway, thanks for reading and thinking it through!Here is a cringe worth talk from 1997 where he claims the internet is disfunctional because it nit standalone and that all developers should build their own tools and compilers.
This is the fundamental reason the modern internet is centralizing to a couple of entities.
"This has to be one of the worst ideas since MS-DOS."
Yes, the modern browsers have taken us back at least 20 years when it comes to UI design, component based programming and distributed systems. The web is an endless stack of kludges, held together by duck-tape. I can back this up, in case you don't believe me.
But, we should ask ourselves how it became such a stack of kludges. And I think Alan hits the nail on the head.
"At the very least, every object should have a URL. I believe every object on the internet should have an IP. It represent much better what the actual abstracts are of the physical hardware to the bits. "
Beautiful insight. The URL does not scale from a systems perspective. In my designs, I see myself often using UUIDs and negotiation to transfer knowledge about entities. The URL (and RESTful communication) is an annoyance. It fixates the location to something arbitrary. I can only use one hierarchy to denote the same object. I cannot easily renegotiate how the same things are named in my systems. And, the worst: the type of the object is often included in the url. `https://foo.bar/person/123` fixes the type 'person' to the object 123.
URLs nowadays are an abomination. Most are not durable, contain excess information and suffer from projecting the information against an arbitrary axis.
Finally, all developers should at least once have implemented their own compiler. It is not a hard experience at all and can be done in around 100 hours by someone with a medium skill in programming using a good text-book. It gives a truly fundamental insight into systems design and should simply not be skipped.
W.r.t. tools: I assume any programmer worth his salt has build at least some of their tools! Perhaps I should start asking this at interviews. If you don't understand how your tools are built, how can you even begin thinking about building tools for others? And how can you understand, without attempting a crude build yourself? All the hard things are already done, the literature is there, the books are written.
So, anyways, you make a bold claim: "most of what he said was wrong." This is awfully vague, I am afraid. Lets make it a challenge. Except for him making predictions, I challenge you to come up with a couple of statements from Alan Kay, and we'll discuss it.
The reason Google and Facebook dominate the internet has little to do with technology and much to do with economics, namely scale economies and network effects.
> Yes, the modern browsers have taken us back at least 20 years when it comes to UI design.
I'll grant that CSS is a mess. What else?
> I can only use one hierarchy to denote the same object.
You can create multiple URLs that point to the same object.
And the network effects can only happen because there is a tight coupling between the data (contained and scrambled within the HTML page) and the presentation. Had data and presentation be decoupled, I could have combined network information from various providers and present it to me in one overview.
> I'll grant that CSS is a mess. What else?
Everything. The security model, the fact that the user has limited control over their identity (and it is not build into the protocols), the multi-threaded nightmare, no component standardization, very limited integration with low-level OS systems, the 'one-tab is one context' metaphor, the box-model, the misfit of page-to-interaction (and the history API), the non-existent voice interaction, the color-model, the DPI/pixels/ems transformations, the invisible local storage we barely manage, the resource utilisation, the lack of uniformity in the programming model, the peer-to-peer communication (WebRTC does not count, since it is not standardized and has quite some flaws), the lack of (easy) customization abilities (high-contrast websites), the limited math-rendering, the enourmous complexity... I could go on.
> You can create multiple URLs that point to the same object.
Yes, but they would not denote equivalence. I could use a redirect, but then one system needs to know the representation of the other. It would be fundamentally asymmetric.
Also, it would contradict the term Unique Resource Locator.
In other words, you want to be able to walk into any library and use ISBN as the underlying identifiers, instead of the Dewey system, which is not broadly applicable. You might get the Dewey number from the ISBN and vice versa, but the ISBN resource assigned to a book resource is the fundamental linking pin.
So, when we link from an article, we want to be able to say: "it is this specific article I am linking to, you figure out how to get access to it." This will be much more durable than an ephemeral URL.
Can you quote this or link to a timestamp? Searching these words in the transcript yields nothing.
You're being downvoted (as I expect I will be, for agreeing with you), but having lived through the time when people blindly worshiped Alan Kay, I could not agree more with this statement.
I am quite certain that my admiration for the man and his work is not blind.
And do note that I described his construction as "brilliant" in my post, despite the fact that he ultimately got that part wrong.