22 ms·
“What Alan Kay Got Wrong About Objects”
- bitwize 7y agoKay was at least as inspired by biological processes -- bacteria transmitting chemical signals to one another, for instance -- as he was by computer networks. 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.
- macintux 7y agoI love Erlang; it would be fascinating (and an astronomical level of effort) to create an Erlang environment with the same powerful UX as Smalltalk.
- ProfHewitt 7y agoYes, Erlang dearly needs an IDE comparable to the one for Java Studio.
- dnautics 7y agoProgramming in elixir with vscode and elixir-ls is a fantastic experience.
- ProfHewitt 7y agoVisual Studio Code and and Elixir with Language Server Protocol are are good start but still have a long way to go reach the level of Android Studio with plugins.
- mercer 7y agocould you elaborate? I've never worked with Android Studio...
- mpweiher 7y agoAs far as I can tell, synchronous operation was not a necessary component of his model, but a pragmatic implementation mechanism in order to make at least some of the vision usable. 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.
- ProfHewitt 7y agoMessage passing of Smalltalk-72 was quite complex [Kay 1975]. Code in the language was viewed by the interpreter as simply a stream of tokens. According to [Ingalls 1983]: "The first (token) encountered (in a program) was looked up in the dynamic context, to determine the receiver of the subsequent message. The name lookup began with the class dictionary of the current activation. Failing there, it moved to the sender of that activation and so on up the sender chain. When a binding was finally found for the token, its value became the receiver of a new message, and the interpreter activated the code for that object's class." 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.
- mpweiher 7y agoWell, and classes were "really" just sort of switch-statements matching that instruction stream, with the "methods" specific cases of that switch. All seems a bit distant from the conceptual model.
- ProfHewitt 7y agoThe Actor conceptional model had not yet been developed when SmallTalk-72 was designed following on SmallTalk-71. Later versions of SmallTalk after SmallTalk-72 adopted the Simula object model. Actors were developed for concurrency, which was entirely lacking from Simula. Also, Simula had procedures attached to the class hierarchy instead of Actor message handlers, which initially seemed like a subtle distinction that grew in importance.
- orthoxerox 7y agoThe earliest Smalltalk versions used actor-like communication, but then Alan Kay learned about Simula and was seduced by the promise of straightforward low-overhead implementation.
- ProfHewitt 7y agoThere is a unique up to isomorphism axiomatization of Actors here: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3459566 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3459566
- edejong 7y agoSeduced sounds like it had a viable alternative. At the time, machines were mostly single-threaded, especially in the learning environment he was trying to conceive. In that case, there is no need for actor-like communication, except for mindset of it.
- esfandia 7y agoActalk [1] provided actor-like asynchronous communication on top of Smalltalk. [1] Briot, Jean-Pierre. “Actalk: A Testbed for Classifying and Designing Actor Languages in the Smalltalk-80 Environment.” ECOOP (1989).
- ProfHewitt 7y agoActalk was a useful early simulation. However, it did not provide a region of mutual exclusion for an Actor with facets. See the following: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003
- alankay 7y agoThis is a quite inaccurate comment. The catalysts (in 1966) for the ideas I had included Sketchpad (especially), Simula I (a few days later), the ARPAnet (under discussion), operating systems inter-process communications (especially Project Genie), the Burroughs B5000, my old biology and mathematics majors. All these are mentioned in "The Early History of Smalltalk" that I wrote for the ACM History of Programming Languages" 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.
- imode 7y agoWhat's interesting is that there's no "destination" for these chemical signals, they're just emitted into the void. There's no sense of sender/receiver, which has some correspondence to the blackboard model[1,2]. 1. https://en.wikipedia.org/wiki/Blackboard_system https://en.wikipedia.org/wiki/Blackboard_system 2. https://en.wikipedia.org/wiki/Blackboard_(design_pattern) https://en.wikipedia.org/wiki/Blackboard_(design_pattern)
- agumonkey 7y agoMaybe not directly but I'm sure these organisms has knowledge of context which influence hormone release. I'd be surprised if it was totally or near totally blind.
- chongli 7y agoYeah, exactly. The synchronous, one-to-one method calls of C++ or Java bare basically no resemblance at all to bacteria chemical signals. The former are essentially functions which dispatch on the first parameter. 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.
- imode 7y agoSomething like a "place-based" tuple space would be more accurate, yeah.
- GuiA 7y agoSee also: membrane computing/P systems https://en.wikipedia.org/wiki/P_system https://en.wikipedia.org/wiki/P_system
- edejong 7y agoThe original ideas behind Smalltalk did allow a void, as in modern day Kafka would be a void or a multi-cast IP address would be a void. There is no clear receiver, there can be multiple receivers or there can be none. Communication is ephemeral. Also, even with the single dispatch system of Smalltalk, we can easily model something similar to the Blackboard system.
- dnautics 7y agoIf by "done right" you mean "the working programmer's smalltalk". Erlang and, probably even more by philosophy, Elixir, pushes you towards Kay's model, but the underlying BEAM gives you enough "cheats" to let you be incredibly productive. Especially in elixir those cheats are sufficiently ugly (as in code esthetics, nothing more) that you don't really want to use them unless you must, and when you do use them it's reasonably good practice wrap it in a macro so that the implementation details can be hidden away. In some cases where your using a non-kayish cheat (like it only helps to make your test parallelize over stateful services) you can make your macro no-op in prod.
- ProfHewitt 7y agoThe Actor Model has been used in many important large applications [Bonér and Reisz 2017, Cesarini 2019]. In order to implement next generation Reusable Scalable Intelligent Systems [Hewitt 2019], the following extensions to Erlang are needed: * 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.
- tines 7y ago> For example, an Erlang process can be orphaned if its Process Identifier becomes inaccessible. 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.
- dragonwriter 7y ago> As I've seen it said, Erlang is Smalltalk done right. 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.)
- yesco 7y agoIsn't that exactly what Erlang's gen_server does or am I missing something?
- regulation_d 7y agoseems like OTP to me
- cuddlecake 7y agoA process is simply a function that runs independent of other functions in the system + a mailbox + a handle + own memory. 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.
- ProfHewitt 7y agoThe Actor Model attempts to be as general as possible to support direct modeling and efficient implementation of all digital computation. For example, an Actor is not required to have an external mailbox, which is required for communication in Erlang [Armstrong, et. al. 1992]. Requiring an external mailbox is problematical for Actors because the mailbox would itself necessarily be another Actor thereby immediately leading to an infinite regress. Also, requiring the use of external mailboxes can slow requests between Actors because it would always be necessary to first deposit a request in an Actor’s external mailbox so that the request could later be retrieved. That a request is almost always sent and received without ever residing in persistent storage, where it can be left and later retrieved, is an important engineering goal for Actors.
- ProfHewitt 7y agoIn Logic Programming, Actors continue processing. See the following: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3428114 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3428114
- triska 7y agoOne very interesting development in this direction is Web Prolog by Torbjörn Lager: https://github.com/Web-Prolog/swi-web-prolog/raw/master/book/web-prolog.pdf 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."
- ProfHewitt 7y agoUnfortunately, Actors cannot be efficiently implemented in browsers because of the way that they implement concurrency.
- 7thaccount 7y agoWhen you say "they", I assume you mean "browsers"? Sorry for the dumb question. I know precious little about web programming and concurrency.
- Izkata 7y ago
- mistrial9 7y agoI assert that the mental model held by the programmer, reducing complexity and making effective toolbox choices, is a significant benefit, too.
- jlokier 7y agoThis whole subthread about asynchronous objects, and the actor model, made me think of "background" processing where objects have a running life of their own, and it reminded me of a recent HN comment about almost the opposite approach, where nothing is allowed to be spawned off in the "background". 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.
- nurettin 7y agoThe "structured concurrency" pattern, simply amounts to starting some async jobs (concurrent or parallel) and collecting all of them at the end of some context. 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.
- wwright 7y agoI believe the structured concurrency article is written by the author of Trio (I could be wrong.)
- matheusmoreira 7y ago> 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! 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_Metabolism_-_Pathways.jpg 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.
- senderista 7y agoI agree that message-passing should be asynchronous by default, but I disagree that message-passing "maps nicely" onto procedure calls in general. Only a particular subset of procedure calls can be naturally interpreted as message-passing: those with a distinguished receiver. Many mathematical functions lack such a distinguished argument, and Smalltalk and other OOP languages are unnecessarily awkward by forcing them to have one. IMO Erlang got it right by keeping a separate notion of function that doesn't involve message-passing.
- ProfHewitt 7y agoActor message passing "maps nicely" for use in procedure calls. For example Factor.[3] sends the message [3] to Factorial which sends back the return value 6. The procedural functions of Erlang are much more limited.
- senderista 7y agoSure, if functions are modeled as Actors. But I don't see the point of modeling the evaluation of a total mathematical function as asynchronous message passing (other than theoretical minimalism).
- ProfHewitt 7y agoAn Actor procedure need not be a mathematical function. For example, Random.[ ] could return a different result each time that it is invoked.
- sriku 7y agoI didn't think that Kay's thinking was exactly the Smalltalk model. It is just that it was one feasible implementation with some key compromises thrown in. I don't think he missed asynchronicity. Just that the machines of his time would've made it next to impossible to be purist about that. He is smart enough to see that the biological systems he was inspired by are asynchronous. In other words, the synchronicity of Smalltalk is somewhat accidental, with good benefits reaped from the idea of reified messages, which Smalltalk does have and C++ etc. don't. 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.).
- specialist 7y ago"REST principles used within a single computer in the AppleScript system and protocol" In contrast to DLLs, shared data, COM+, ActiveX, plugins, and so forth. Terrific observation. Thank you.
- smabie 7y agoI’ve never used Erlang but have shipped production Akka+Scala systems and let me tell you, it’s hard. A big part of the problem is that Akka only supports cooperative multi-tasking: No blocking operations allowed (unless you pin the actor to a thread). This causes a big problem with the code: all implicit state must be made explicit. This creates a lot of boilerplate and makes some problems very difficult, especially with regards to TCP/UDP connections. Even with Erlang that doesn’t have these problems, debugging and writing actor systems are some of the hardest programming problems I’ve ever come across. 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.
- diroussel 7y agoCould you imagine a layer that compiles down to actors? If that it too much of a stretch maybe something that can lint the protocol flows between actors. So you can have proof that fragmentation and re-assembly is done correctly. Or that message sizes are bounded. Or some other higher level property is proven true?
- smabie 7y agoOne thing I’ve thought of is that instead of messages, each actor exports a list of functions that it provides. Then other actors can call these functions and everything looks synchronous but under the hood each actor is calling other actors functions transparently. This would eliminate message bloat (too many kinds of messages) and would end up looking kind of like OO. So instead of sending the message: Sum(x, y) and eventually getting the response: SumReturn(x), I could just do something like: actorA.sum(x, y) that would look and act like a regular function call. Then actorA could implement sum like: 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.
- bad_user 7y ago> Erlang is Smalltalk done right 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.
- 0xcde4c3db 7y agoIt's not precisely the same distinction, but this reminds me of a CS professor who talked about "blocking send" and "non-blocking send" message systems. He wasted no time in abbreviating them to "BS" and "non-BS".
- raghava 7y ago>> As I've seen it said, Erlang is Smalltalk done right. 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-joe-armstrong/ https://softwareengineeringdaily.com/2015/11/02/erlang-with-...
- deleted 7y ago[deleted]
- ganitarashid 7y agoTitle assumes that Alan did in fact get anything wrong, which is incorrect
- thewarrior 7y agoInteresting post OP. From reading your paper about storage combinators it seems to suggest that this has been used in the Wunderlist app. 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.
- mpweiher 7y agoThanks! 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 https://github.com/mpw/MPWFoundation (The lively project also has a version https://lively-web.org https://lively-web.org) The Stores/Storage Combinator base implementation is in the Stores subproject, so https://github.com/mpw/MPWFoundation/tree/master/Stores.subproj https://github.com/mpw/MPWFoundation/tree/master/Stores.subp... There are quite a few more stores in Objective-Smalltalk (http://objective.st http://objective.st, https://github.com/mpw/Objective-Smalltalk 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.
- frozenport 7y agoHistory needs to reevaluate Alan Kay as most of what he said was wrong. 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. https://m.youtube.com/watch?v=oKg1hTOQXoY https://m.youtube.com/watch?v=oKg1hTOQXoY
- jerhewet 7y ago> History needs to reevaluate Alan Kay 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.
- t-h-e-chief 7y agoAh. Alan Kay himself said that he feels they got the boundaries/sizing wrong when designing OO, so there really shouldn't be any mention of 'blind worship'. As far as I am aware, Kay has never been caught up in his own hubris.
- mgummelt 7y agosource?
- mpweiher 7y agoBlind worship is always wrong. However, most admiration for Alan Kay's work is by knowledgeable people and for good reasons. Including the committee that decides on Turing awards... 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.
- mgummelt 7y ago> where he claims the internet is disfunctional because it nit standalone Can you quote this or link to a timestamp? Searching these words in the transcript yields nothing.
- Animats 7y agoKay was into discrete-event simulation. There's a nice example of that on an Alto, a little hospital queuing simulation, in "Personal Dynamic Media". That concept comes from Simula-67, a variant of Algol-60 used for simulation. 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] [1] https://www.themagical.nl/simulations https://www.themagical.nl/simulations
- Aperocky 7y agoYou maybe right about discrete event simulation, having created one for my academic research years ago, I had the feeling it wasn't as useful (there are so many things you might tune to make it spit out what you want), but the same model is fun for making random simulations (games).
- mgummelt 7y agoCan you briefly describe what you mean by "In-Process REST" and what the benefits are? I tried to read your slides but couldn't understand them. Are these new in-process interfaces asynchronous? Or are they synchronous interfaces that adhere to REST principles?
- mpweiher 7y agoI talk about this in the Storage Combinators paper[1] 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/WeiherHirschfeld_2019_StorageCombinators_AcmDL_Preprint.pdf https://www.hpi.uni-potsdam.de/hirschfeld/publications/media... [2] https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90.2858&rep=rep1&type=pdf https://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.90...
- mgummelt 7y agoI'll check out the paper, but at a glance, "a few well-defined verbs" seems to just mean you've introduced a set of standard storage interfaces, right? If so, calling this REST, to the extent which that word means anything at all, seems a bit of a stretch.
- superdude264 7y agoI just finished reading the paper and that’s what it looks like to me. It’s a CRUD interface w/ multiple implementations (proxy, cache, route, serialize, filesystem store, memory store), which they create pipelines out of using some syntactic sugar in the Objective-Smalltalk language. This syntactic sugar, discussed in their paper on ‘polymorphic identifiers’, allows you to use the same syntax for writing content to a file as you would writing to a key in a map or a field in an object. If you look at the pictures / tables in this paper, you get a general idea of what they are doing (e.g. replacing the filesystem store with a memory store while running tests). These dynamically dispatched processing pipelines are powerful, but can be hard to follow (which is true of dynamically dispatched processing pipelines in general). The power/obfuscation is multiplied by the convenient syntax of the language. 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’.
- mgummelt 7y ago> each Smalltalk object is a recursion on the entire possibilities of the computer. 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.
- ProfHewitt 7y agoObjects as originally conceived in Simula left out concurrency, i.e., region of mutual exclusion of an Actor. See the following: https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003 https://papers.ssrn.com/sol3/papers.cfm?abstract_id=3418003
- mgummelt 7y agoI'm unsure what this has to do with my comment.
- ProfHewitt 7y agoSimula originated the terminology "object", which was then adopted in later versions of SmallTalk. Objects differ in fundamental ways from Actors.
- mgummelt 7y agoWhat does this have to do with Kay's claim that objects are "mini-computers"?
- ProfHewitt 7y agoWhat is your precise definition of "object"?
- mgummelt 7y ago
- ghjnut 7y agoActor-based programming really interests me. The concepts behind erlang and smalltalk seem to be the closest to an ideal model for the amount of distributed computing power we have today. 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.
- ProfHewitt 7y agoAbove all allude to good ideas that need to be formalized, designed, implemented, and deployed.
- mgummelt 7y agoDoesn't scaling network interfaces down to be used in local processes present all the same problems as scaling procedure interfaces up? You still have to be aware of which objects are remote and which are local.
- ProfHewitt 7y agoRuntime system knows approximate latency to intended recipient Actor of a message, e.g., this core, nearby core, nearby chip on the package, nearby chip in the same server, nearby server in the same rack, nearby server in the same datacenter, another datacenter, another IoT, etc. However, Actors can dynamically move and so the answer can change over time.
- mgummelt 7y agoLatency differences aren't just a difference in degree. They're a difference in kind. Some interactions have to be sufficiently fast or they shouldn't happen at all. A runtime that minimizes global latency guarantees isn't sufficient. You also need to guarantee that certain individual Actor interactions are sufficiently fast, which is only possible through colocation. You could add a colocation constraint to your Actor scheduler, but now you're pretty much back to where you started. 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.
- ProfHewitt 7y agoDo you think that the "difference in kind" should be frozen in application source code? I agree that latency needs to be carefully controlled. But the software engineering can be complex!
- mgummelt 7y agoOften, yes. Parameterization adds complexity, so for interactions I know must always be colocated, it makes sense to hard code the provisioning of a local actor.
- crimsonalucard 7y agoOOP feels right because it's an imitation of reality. In the reality we live in... a verb cannot exist without a noun. Think about it: how can there be "movement" without the "thing that moves." OOP makes sense from this perspective. 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 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.
- fmakunbound 7y agoIn-process REST sounds horrible inefficient.
- paulddraper 7y agohttps://en.wikipedia.org/wiki/Microkernel https://en.wikipedia.org/wiki/Microkernel
- abernard1 7y agoWhile it's always dangerous to criticize a computer legend, I would add one more thing that I believe Alan Kay "got wrong about objects": objects are extremely bad at representing most types of problems in business software. 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.)
- paulddraper 7y ago> most business problems involve _data_ processing 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.
- wildster 7y agoThey should not have class variables.
- signa11 7y agoquestion: would you consider STL (standard-template-library) closer (in some sense of the word) "philosophically" to theory of objects than 'vanilla' OO ? 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...
- di4na 7y agoCough cough. Seems someone has not really looked at the reality of the field. Erlang is right there, i advise a look :)
- mpweiher 7y agoThe "reality of the field" is that the WWW was/is built with Erlang? I definitely did miss that. Back to the drawing board, I guess... ;-)
- butterisgood 7y agoBit of a clickbait title... reasonable discussion.
- ProfHewitt 7y agoThe title of this post is very unfair to Alan, who has made important contributions. For example the SmallTalk browser was extremely innovative leading to modern Integrated Development Environments that have taken over software development. Also, SmallTalk was the first to use Simula class hierarchies for graphics, which are now used everywhere. 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=3428114
- mpweiher 7y agoHello Professor Hewitt, Hmm...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.
- carapace 7y agoFWIW, in re: distributed Smalltalk, check out Croquet. > 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. https://en.wikipedia.org/wiki/Croquet_Project https://en.wikipedia.org/wiki/Croquet_Project