157 points · by mpweiher · 2y ago · 88 comments
I much prefer my programs to have a sort of top down structure, more like a military instead of an economy. Obviously late-binding and dynamic behavior is many times necessary, but I would not lean in to it, in the same way I would not say, make all my variables global just because sometimes you need it.
Erlang appeared 15 years later, and was / is quite successful in certain niches, more recently also as Elixir.
The problem he was proposing we solve is computing with heterogenous “machines”. This doesn’t preclude the regimented organization you are favoring, above.
Please see my other comment on call-by-meaning.
This is different now with black box systems like LLMs and other neural networks (transformer-based or not) that we don't understand because they were never actually designed from a blueprint that lends itself to an understanding by others that approaches the understanding of the originator(s).
There's an argument to be made that our avoidance of systems that call for actual science and our attraction to focusing on the smaller subset consisting of grokkable systems, out of a larger set of possible ones, is an indication of immaturity. It's parochial and blinkered. We are big fish in a small pond.
Science is description and explanation on top of empiricism. It is the first means by which people understand things, not the last, as formal methods came way late.
This drive to properly name things also gets into the somewhat similar debate of whether math is discovered or invented. And somewhere someone is trying to determine whether it's appropriate to call math as science, art, or engineering.
I don't think that's at odds with what the parent comment said; the reason we use empiricism and description for analyzing reality is because we didn't create it and we don't know the rules beforehand. When designing a software system, you _choose_ the rules of which things interact and which things don't, and how those interactions occur; there's no need for empiricism in order to discover these interactions. We don't necessarily need to use science to understand our software systems because we rule over them by fiat and can choose to design them in ways that make it easier for us to understand them.
Remember that Alan Kay, his team and his colleagues had a lot to do with this thing you are using to rant here :)
The internet has certainly grown and does certain things reliably, but it's also extremely difficult to control or change. For most business purposes, producing something like the internet would be a failure.
> Remember that Alan Kay, his team and his colleagues had a lot to do with this thing you are using to rant here :)
Given how difficult his ideas apparently are to convey and how little the programming paradigms that actually get used to make things embody them, I find that pretty dubious. E.g. didn't he explicitly disavow C++?
It's like asking Bezos to care about the Internet as a technical concept ("Internet? Schminternet? I don't care as long as it delivers the best customer experience!").
Kay was and still is a dedicated researcher - and he has had great influence on people like Jobs/Bezos as well - behind the scenes. There are very few parts of modern technology untouched by his ideas. He's a Turing Award winner for a reason, you know.
Re C++ - Kay's job as a researcher is not to defend whatever sh*t humans have figured out & are content with but to paint a picture of the future, build teams around it and demonstrate prototypes. He has done that exceedingly well I'd say.
Hence its success.
It is controllable and changeable exactly in the manners that are appropriate by those who should be able to control it and change it.
The internet is as distributed and decentralised as it is because it was made by a distributed and decentralized entity (thousands of companies and individuals).
Had most of them been willing to coordinate and cooperate with each other we would have a very different internet.
I also somewhat contest that "interesting behavior comes from the emergent runtime interaction of tons of tiny components". There can be very tight, hierarchical structures to programs designed in the way Alan Kay talks about. He is promoting clear, manageable interactions, not emergent unpredictability, which is something I am sure you came across (we all did), but I would not go so far as describe the whole model of Kay as "fundamentally misguided". He talks of "clear fences", which can be understood to refer to things like "actor-based" models, with controlled, clear messages, as done in languages such as Erlang.
But aren't we? The modern ML revolution is programming via natural selection. Emergent behaviour from complex interactions of simple components trained by selection.
And of course, experience underlines how hard these programmes are to reason about.
However, seems to me, the key trick of these systems is that very complexity that makes them so hard to understand is what gives them their computational power.
Physicians.
"but until we start programming by natural selection I wouldn't describe it as a good paradigm for organizing behavior."
Machine learning, alternatively startups selected by market forces.
We already have reinforcement and other types of machine learning?
Something being hard is not an argument for or against anything.
Alan Kay is misguided because he prefers a hard thing and you prefer a simpler thing?
A paradigm being hard to get things done in is definitely an argument against the value of that paradigm.
That Alan Kay guy sure is a bit of a dummy huh.
He seemed to be arguing for a pure imperative style. You send a message to make something happen. This is the opposite extreme from pure functional programming. A style of programming where everything is an imperative statement with no return value might be possible.
GPU programming is kind of like that. Neural nets are like that. There's an analogy to biology, which doesn't seem to do function calls but does push information around. That apparently appealed to Kay.
Functional programming makes things local. Pure imperative programming makes things global. This is hard on human programmers. It takes more short-term memory than most humans have to work in pure imperative mode.
Kay was heavily into discrete-event simulation. That's what Simula had objects for, and that's where Smalltalk got objects. All those objects are sending messages to each other, driving the simulation forward. The original Smalltalk paper has discrete-event simulation examples. It's possible to build a GUI as a discrete-event simulator, with all the widgets sending one-way messages to each other, but that's seldom done. Discrete-event simulation became a tiny niche in computing. Kay thought of it as a central organizing concept for computing. That's not where the field went.
No neural nets are functional in nature. Each neuron is a combinator which is the fundamental and most modular unit of abstract computation. The net is simply a composition of these combinators.
Training the neuron though is imperative because data is discrete. You have to train one piece of data after another.
>GPU programming is kind of like that.
Not true. See futhark. What's going on here is that the high level language is imperative. Why is the high level language usually imperative? Because the implementation of computing is usually imperative. Assembly whether it's for the CPU or GPU is imperative by implementation.
But the high level abstraction on top of these things don't necessarily need to be imperative.
>Functional programming makes things local. Pure imperative programming makes things global.
What do you mean by this?
Yeah, he just started one of the most popular programming styles that is still taught in universities (even if a different version than the one he envisioned)
> He seemed to be arguing for a pure imperative style. You send a message to make something happen. This is the opposite extreme from pure functional programming. A style of programming where everything is an imperative statement with no return value might be possible.
Agreed, OOP is orthogonally opposite of pure functional programming. Objects have state. Big revelation.
>Functional programming makes things local. Pure imperative programming makes things global. This is hard on human programmers. It takes more short-term memory than most humans have to work in pure imperative mode.
Imperative programming =/= OOP, are you even aware of OOP and its relation with Alan Kay? Not sure if I should argue anything here, but in summary, OOP doesn't make things global, it precisely limits the knowledge and effect of objects, its originally inspired by cells, which have cell walls and communicate via specific hormones with other cells. Have you ever used a language with private modifiers to variables or something?
On simulation, it's worth noting that OOP was developed when the prevailing architecture was a full-local monolith, with the advent of the internet the prevailing architecture was client-server and microservices. In this context OOP becomes the default, and objects no longer need to be simulated, but are natural objects in the world. A GUI is an object nowadays, some HTML running in a browser, and the server is another object, a server running in AWS.
> Kay thought of it as a central organizing concept for computing. That's not where the field went.
Absolutely the opposite, the only central organizing concept would be the scheduler/simulator I guess? Since machines were usually single processor machines, there was a central abstraction that allowed independent objects to exist, processes for example are designed to be separate and independent, you can separate them across machines or run them in the same machine without much difference, you wouldn't argue that processes are a form of centralized computing? It's a feature designed precisely for the opposite, independence of compute and memory fractions. The fact that many independent processes/objects run in the same computer and that it somehow needs to allocate compute resources between them, is not a central architecture.
Are hypervisors and Virtual Machines a centralized computing architecture? That's just ridiculous. It's quite the opposite. There's a federated layer in VMs, in processes and in Object Oriented Languages yes, but it is completely practical removable and splittable into separate physical layers due to the nature of its design.
(I got this early view when I had a tour of PARC in 1975, and Kay explained his thinking.)
it's true that not many systems really depart from that tradition and go fully asynchronous: only erlang, stackless python, orleans, golang, current ecmascript with promises or web workers, python with asyncio, backends connected together with kafka or rabbitmq or ømq, and a few others. and for hysterical raisins their asynchronous tasks aren't called 'objects'. but i don't think it's really true that that style of programming is entirely limited to discrete event simulators!
______
† __getattribute__ or __getattr__, method_missing, no-applicable-method, and __noSuchMethod__ respectively
Without going much further Server-Client architecture presents characteristics of Kay objects, if only because their physical separation requires limitation of the control between server and client for security concerns.
Multitenancy of machines also forwarded Kay Objects in parallel due to security concerns, first OS processes and then stricter virtual machines enforced independency of these objects and allowed communication through strict long-range protocols like TCP in the case of VMs.
I feel Kay pushed for objects at the application level and this was largely redundant with Operating system level concepts like scheduling, user and kernel layer memory protection. Threads and containers proved that there is a need for a more tightly controlled scheduler and resource sharing, but in general Kay's objects nowadays just use strong encapsulation mechanisms at the OS layer such that objects usually communicate via network protocols as if they were in separate machines altogether, they truly are separate physical objects running independently.
It is important to consider the ideas of Kay in their time context, preemptive scheduling was a young concept, and processes back then did not have much protection against memory accesses. Of course the scarcity of resources (compute, memory) back then was also a factor to push for application level encapsulation, but nowadays we can just spin up virtual machines and throw metal into some datacenters, there is a surplus of hardware so there is no incentive to replicate and optimize hypervisors, so they don't move to the application layer at all. Turns out all of those security features are really important in guaranteeing encapsulation, you don't even have to worry about whether there is a bug leaking state, because that is taken as a security concern, and the barriers are designed to be protected against skilled attackers, so random bugs are much less likely to break encapsulation.
Application level objects are still very much used, to my knowledge in simulation software including games, where it would be unreasonable and unnecessary to spin up a VM for each butterfly in a simulated world. But it turns out that in business, Kay Objects are usually assigned to a programmer or to a team of programmers, so there's rarely situations where a programmer is in charge of more than one object, and they need to play a dissociated god controlling designing many entities, and when we do, we inevitably suffer from an identity crisis. And we use harder abstractions like processes or servers anyways. No need to fit multiple kay objects into a single process, that usually causes way too many objects. It's desirable to assign some cost and administrative overhead to object creation to avoid Programmer Ego Death.
I don't think that's quite true. Having state or not isn't a dichotomy but a continuum about the size of the scope of the state. Objects (in either the Kay sense or the Java sense) exist to encapsulate state, to limit its scope and make it easier to reason about. That puts OOP (state is local to objects, and can be cleanly reset by destroying and recreating the object) somewhere between ‘pure imperative’ (only global state; there is no reliable way to reset the state) and ‘pure functional’ (state is limited to being kept in function arguments and return values, and is reset on each function call) on the continuum.
When it comes to "messaging," it usually just boils down to method dispatch or large switch statements. It doesn’t seem like some magical concept we haven't figured out yet; it’s more like something we already know. When I see Kay's complaining about messaging, I imagine he also complaining about other things: "WE NEED BETTER WHEELS", or "WE NEED BETTER ELECTRICITY" (?). What do you actually want, Alan? :-p
From my experience with large Ruby codebases and publish/subscribe systems, debugging can become quite messy when there’s too much flexibility. I think this is what Kay is getting at, even if he maintains the idea that a dynamic system like Smalltalk will somehow evolve to fix these issues.
They seem vague because they are research questions. Tough research questions.
> [messaging] usually just boils down to method dispatch or large switch statements.
And that's the problem.
> [not something] we haven't figured out yet;
Well, we obviously haven't figured it out yet, because it ain't large switch statements or (just) method dispatch.
> debugging can become quite messy when there’s too much flexibility.
Exactly what he's talking about! Languages like Ruby have the metaprogramming flexibility, but they are lacking in the security of meaning department.
Languages like Go are pretty good in the security of meaning department, but lacking in the flexibility/expressiveness department.
So far, we have achieved either/or. He is saying what we need is both.
It's a tough problem.
I agree on the whole, but I think he followed through this time. He gave pretty a set of cogent examples that doesn't leave the whole thing coming across as incoherent (like a mystic we're supposed to revere and take their words as some form of high wisdom that would make sense if only we could attain the requisite form of enlightenment). Viz:
> I would say that a system that allowed other metathings to be done in the ordinary course of programming (like changing what inheritance means, or what is an instance) is a bad design.
(There are two things being communicated here—what sorts of things he means when talking about transgressing the metaboundaries, and a position about whether it's a good idea to do it willy nilly—with his position on the latter being: No. The former seems clear enough and his take on the latter is definitely reasonable and might even qualify as "wise".)
So we are seeing discussion about how to program a programming language. I
"When it comes to "messaging," it usually just boils down to method dispatch or large switch statements. It doesn’t seem like some magical concept we haven't figured out yet; it’s more like something we already know"
This feels like the Seinfeld effect, it sounds obvious in hindsight yes, but it's precisely because he was the pioneer, things like Java, microservices, json, APIs, have evolved from Kay's ideas.
Not to mention Excel, which uses cells, a concept invented by Alan Kay. He also invented OOP which in 1964 inspired the creation of Simula, the first OOP-Language.
Message passing in Smalltalk predates Hewitts Actor Model and was used as inspiration. The messaging in Smalltalk is little different and IMHO better in many cases.
This quip by him from OOPSLA '97 is well-known:
I made up the term object oriented. And I can tell you I did not have C++ in mind..
A little less well-known are the words that immediately follow:
So, the important thing here is: I have many of the same feelings about Smalltalk
As for where he wants Smalltalk to go, that's what Squeak was for. He talked about it on plenty of occasions, at least one of which was also before OOPSLA, and actually did get a research team together to develop it out in the late 2000s: https://tinlizzie.org/IA/index.php/Papers_from_Viewpoints_Re...
The main common ground they share is that CSP becomes too synchronized and particular, making it too difficult to use for systems in the large.
I would suggest that more progress could be made if the smart and talented Squeak list would think more about what the next step in metaprogramming should be - how can we get great power, parsimony, AND security of meaning?
Did you mean that he should have described actors, but did not?
To me at least, "ma" goes beyond just the actor model.
Regarding Smalltalk, there are conceptual reasons why it failed, some of which are mentioned in this thread: https://news.ycombinator.com/item?id=10071681
(And which point was proved.)
The most succinct way I have found to state the problem is: “For example, getting the length of a string object varies significantly from one language to another... size(), count, strlen(), len(), .length, .length(), etc. How can one communicate with a computer -- or how can two computers communicate with each other -- at scale, without a common language?” [1]
The call-by-meaning solution is to refer to functions (processes, etc) not by their name, but by what they do. VPRI provided an example implementation in JavaScript[0]. I re-implemented this -- a bit more cleanly, IMHO -- in Objective C[1].
[0] http://www.vpri.org/pdf/tr2014003_callbymeaning.pdf
[1] https://github.com/plaurent/call-by-meaning-objc?tab=readme-...
This seems like call by an even longer, more difficult to use name.
And it would seem to rely on a common language to describe functions/methods, which clearly we don't have or everyone would use the same names for things that do the same thing already.
var clock = K . find (
"(and
(variableRepresents that thing)
(typeBehaviorCapable-DeviceUsed thing
(MeasuringFn Time-Quantity)))")
So if I want a clock instead of using the name system.timer, now I need to know the much longer name. Maaaybe you think I can reason about the parts of this name, but it's just a longer string with funny syntax. And it's only really useful if we all agree on the language of description, which if we had a common language of description, we wouldn't have the problem this is trying to address.If you've got an example of a real system using this where it's actually better than searching docs, or learning what the language of today uses to measure the size in bytes and the size in codepoints and the size in glyphs, please link to that. But this feels like yet another thing where if everyone agrees about the ontology, everything would be easier, but there's no way everyone would agree, and there's not even an example ontology.
"Call by meaning" sounds exactly like LLMs with tool-calling. The LLM is the component that has "common-sense understanding" of which tool to invoke when, based purely on natural language understanding of each tool's description and signature.
Sure, reality has problems, and no it won't be solved by trying to understand everything as functions. Welcome to the world
Except that Microservices tend to use REST (or something roughly like it) and not CORBA.
https://blog.metaobject.com/2019/11/what-alan-kay-got-wrong-...
(Apologies to Marshall McLuhan)
You and the cup are objects, and physically send messages as you interact. That leads to changes in the physical world as each actor decides what to do with the incoming information, by physics or by conscious action.
So far so good. Except software is just information, and so the software version of that interaction includes the "person put hot cup down on table" event. That interests somebody, so they rapidly express their displeasure and rush to put a coaster underneath...
And that is valid a model of computing. Direct messaging between interacting objects, a stream of events of the produced changes, and actors that consume that stream for things and optionally chose to initiate a new interaction
Alan Kay on Messaging (1998) - https://news.ycombinator.com/item?id=9481074 - May 2015 (61 comments)