Spinning off a new thread because I really like this comment:

https://cybre.space/@jauntywunderkind420/104956363785764927

<< What I do see as a pure virtue that stood for something clear was 9p. Expose your state. Let it span systems. Use common os tools to manipulate state. >>

I like this because I think "expose state and use common tools" is a key design principle in big systems that work (eg, HTTP / REST) - but it also seems the opposite of OOP's "hide state" mantra.

Do we know why?

@jauntywunderkind420 @enkiv2 @byron

JauntyWunderKind (@[email protected])

@[email protected] @[email protected] @[email protected] I take to think those examples are good but also kind of irrelevant. They had good characteristics but only some aspects, amid a lot of things going on. It's too complicated to be clear. What I do see as a pure virtue that stood for something clear was 9p. Expose your state. Let it span systems. Use common os tools to manipulate state.

cybre.space

@jauntywunderkind420 @enkiv2 @byron

Eg: I think hiding state is important too! There are many secrets we have to keep private, everything would fall apart if we didn't have information hiding as a key abstraction.

But... for getting things working, it feels like "let sealed objects handle everything" just kind of... doesn't work, because programmers always do bad things in their objects and never fix them, and so exposing state seems to be the only way we can route around bad programs?

@jauntywunderkind420 @enkiv2 @byron

Or is it more like "expose all state *that was transmitted to you*, and don't hide any inherited state?" Because that's usually data loss.

I don't know. I really don't know. Nothing much about what actually historically happened with these technologies seems to make sense.

Smalltalk was all about messaging, and was inspired by ARPANET, but the early Web doesn't seem like it was at all Smalltalky, though it was extremely ARPANETty. Do we understand why?

@jauntywunderkind420 @enkiv2 @byron

The Web 1.0 wasn't built on Javascript, but the 2020 Web is built on Javascript over CSS over SGML over HTTP over (webapp server) over SQL - at least six completely separate syntax / semantic layers. This seems non-optimal.

What if we removed everything except the somewhat-Smalltalky Javascript?

Could we rebuild the Web on just JS? Would it be better? It would be reasonably trivial to try, because Node.js would be the webapp server.

@jauntywunderkind420 @enkiv2 @byron

Alternatively, if rebuilding the entire Web on Javascript message sends (modulo maybe a NotUnderstood facility like Smalltalk had, or whatever else might be needed) demonstrably *doesn't* work, maybe because it's true that state needs to be exposed in some reliable manner...

.. could we go the other way, build a full-stack programming language on an analog of HTTP/REST?

Why or why not?

If 'not' to either of these, what are we missing?

@jauntywunderkind420 @enkiv2 @byron

One thing that has always bugged me deeply about OOP is that although it's supposedly all about messages, there is no standard or reliable way to represent 'just a chunk of structured data'.

I mean, you *could* conceivably represent 'a foo with parameters bar, baz' as something like

new foo(bar,baz)

or (something).foo(bar,baz)

but.... those aren't really defined in any sense, and aren't good for large messages (kilobytes to gigabytes).

Do we know why?

@jauntywunderkind420 @enkiv2 @byron

You'd *think* that since constructors are a pretty universal part of OOP, that every conceivable data type or structured message WOULD be an instance (sic) of

new foo(bar,baz)

BUT

that just gives you a local reference to an instance of foo

Once you've got that reference... how do you communicate it to another system? It's not a 'message' in any meaningful sense now. Messages can be 'sent'. Objects... are not designed to be 'sent'.

It feels incomplete.

@natecull @jauntywunderkind420 @enkiv2 @byron Talking about method calls as "messages" is something that came out of Smalltalk, and is in my opinion incredibly misleading.

I've had debates with people online who strongly claim there is a difference between method calls in most Java-style object oriented languages and something like Smalltalk that talks about "messages". Most of the arguments seems to revolve around the idea that you can send messages (i.e. call methods) on instances that have not previously been declared to support such method calls.

At the end of the day, it all boils down to dynamic vs. static dispatch. But even for dynamic dispatch, referring to method calls as "messages" does nothing but confuse users and make it seem to complex than it actually is.

@loke @natecull @jauntywunderkind420 @enkiv2 @byron C++ and subsequently Java made that mistake in understanding,, as event based gui systems were not widely experienced yet. . messages are more like events than method calls. you can think of it as tthe difference between desugaring to
sendmsg(objectId, methodname, params) : void
vs
methodname(objectpointer, parans) : somevalue

the difference seems subtle but the former, with an extra level of indirection guves the dispatcher more freedom

@zensaiyuki @loke @natecull @jauntywunderkind420 @enkiv2 @byron it makes it really weird that no one's implemented a GUI app in Erlang other than Wings and the integrated debugger

@libc @byron @zensaiyuki @natecull @jauntywunderkind420 @loke

There are TK erlang bindings. About ten years ago, I ported a large prolog project to erlang (though I didn't, and still don't, really know erlang) & wrote a fair amount of gui code related to that.

But, thing is, the GUI toolkit itself was not erlangy. It was a binding to tk, which is C++ and really intended to be embedded in tcl. So, for instance, it wants to be single-threaded with an event loop.

@enkiv2 @byron @zensaiyuki @natecull @jauntywunderkind420 @loke Erlang ships with Wx bindings, and Wx is.... less antiquated looking OOTB than Tk. still, doing Win32 rawdog programming makes me realize "shit, why can't i just receive {paint, Hwnd, Dc} messages?"

@libc @byron @zensaiyuki @natecull @jauntywunderkind420 @loke

Maybe I used Wx rather than Tk. I don't really remember. It's still sort of the same issue.

And, of course, 'antiquated' is kind of funny because the ideal we're reaching for (properly message-based OO GUI toolkit) is... in smalltalk 78.

@enkiv2 @libc @byron @natecull @jauntywunderkind420 @loke i am not sure i understand smalltalk 78 but my understanding is even smalltalk ended up compromising the messages concept, partly because performance of 1979’s conputers, partly because nobody had failed at it enough times yet to know how not to do it.

@zensaiyuki @libc @byron @natecull @jauntywunderkind420 @loke

The underlying implementation of smalltalk for the alto turned messages into method calls for performance reasons. From what I understand, the language itself didn't break the message paradigm despite this, & graphics programming was async-friendly. (But, my familiarity with it is currently mostly second-hand.)

@enkiv2 @libc @byron @natecull @jauntywunderkind420 @loke so then it’s a little ironic to say the web wasn’t smalltalky, since the system it was implemented on was trying very hard to be smalltalky.

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

Right! That's one the things that fascinates me. Berners-Lee writes WWW on a NeXT, which at least advertised itself as object-oriented, and if this factoid is true then he writes it heavily relying on NeXT's OOP framework...

... But no trace of that framework and its objects extends over the network. Isn't that odd? And interesting?

Naively one would expect WWW pages to have been serialised NeXT object classes. They very weren't.

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

For comparison: from the same era, Microsoft Word .doc files of early 1990s were *massively* more OOP than the Web. They were literally just collections of objects but *because* they were just RAM dumps of objects they were unsuited to traversing multiple systems.

And MS thought they'd beat the Web because they were OOP and 'modern' and Web wasn't, until around 1995.

@natecull @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke but that was obviously a proprietary format, and also worked on systems where objects were second class citizens so to speak
@natecull @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke OLE, OpenDoc, etc weren't truly flexible or open enough to really operate as such an alternative
@a_breakin_glass @natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke a bit of a libertarian dream though: turn documents into a dozen little plugin purchases the reader needs to make in order to just view the document
@natecull @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke objects were ultimately merely an implementation detail

@a_breakin_glass @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

Right. I think that's the part that still niggles at me. Why *did* objects end up just being an implementation detail, when the whole idea of an object was 'here is a small machine that is a thing'?

'An object is a thing' *seems* to make intuitive sense. BUT!

The BIG but is that an object is generally 'a thing you can't give to anyone'.

To 'give' an object you have to radically destructure it. Parse to text etc.

@natecull @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke down in the dirt, we end up needing to make hard choices

@a_breakin_glass @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

So as a programming paradigm, objects seems.... not to be as universal as it wanted to be.

Something about objects seems to weld them to very specific machine contexts that they can't be easily unwelded.

Data formats that can be easily transmitted, and survive multiple systems, seem to be very non-objecty.

This doesn't seem to be what any of the OOP proponents ever wanted. But why couldn't they see that?

@natecull @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke i dunno, HATEOAS seems like a very smalltalky objecty idea
@natecull @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke like smalltalk, and OOP, people focused in on the wrong idea in REST: thinking REST was about URLs, when really it’s about hyperlinks (and forms) enabling a client (web browser) to interact wirh a server without any prior knowledge of the remote application’s internal structure. a strong contrast with modern “REST” apis that now have an ecosystem thar has reinvented CORBA again but named it OPENAPI/Swagger

@zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke

I really like that idea of inverting the application state into a message-like thing that the client holds as a ticket and sends to the server.

However I wish we weren't trying to do that over a protocol built to transfer and display literal documents, because nothing about a REST application is anything like a document.

Especially if we wanted to scale *down* to the desktop - we'd want a very small, fast protocol.

@natecull @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke well, there’s HAL if you wanna do HATEOS in a more applicationy way
Hypertext Application Language - Wikipedia

@natecull @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke it says it’s “draft” but it’s what amazon uses for all of its apis.
@natecull @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke a somewhat more sophisticated version is JSONAPI that is still HATEOAS style but addesses some of the annoying limitations of HAL.
still stuck with JSON as a wire protocol but there’s worse fates

@zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke

I guess I'm wondering if JSON is too heavyweight to be used as a desktop protocol, even for widgets within a windowl? Or do we all have enough excess CPU cycles now that that's not a problem?

Cos if it is too heavyweight then we gonna need another protocol.

@zensaiyuki @natecull @a_breakin_glass @enkiv2 @libc @byron @loke i had no idea aws uses HAL for it's apis. HAL is fairly old, it ignored some very good existing work, but it is a pretty reasonable pretty decent take from a very good dev.

i had no idea amazon was such a strong practitioner of hypermedia systems!! neat. til. thanks.

@zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke

I suppose to me the idea of REST that's missing from the conventional windowed deskop is that that every window in any state is a 'view' over some giant abstract space of data, and that every such window has an identifier that you can sort of peel off and save and restore.

Sort of like the UI equivalent of continuations in Scheme, I guess?

It seems something we should have much more of on the desktop.

@zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke

I think this is the feeling of what's missing that I've been groping for for a while...

... the idea that if possible there shouldn't be separate 'applications' (maybe libraries), there should just be windows into state. And that since each window represents a locus of interaction between you and the machine, you should be able to have as many as you want. They shouldn't block.

But we have so many blocking windows.

@zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke

Imagine if you were playing a game, and you didn't know what path to go, north or south. So you just right-clicked and spun off another window. Now you got two windows on the game state, each of which you can play at the same time, taking a different path in each one, or close and then open in the future. And the game doesn't know you're doing any of this, so it can't say 'nope'.

This is what I want for all 'apps'.

@zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke

I put 'apps' in quotes because I don't want there to *be* apps. I want there to be state, and rules that cause state to change, and a user interface that is thoroughly decoupled from any of those rules so they can't get in the way. So there's *always* versioning, history, a 'back' button, save functions, etc. All of that's just done at the UI/OS/VM level. It's none of the 'app's business.

I just want data and rules.

@natecull @zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @loke

i think @zensaiyuki nailed a core point:

> enabling a client (web browser) to interact wirh a server without any prior knowledge of the remote application’s internal structure.

to me, json-ld and microdata or rdfa do a fantastic job of turning rest into a sea of universal & hyperlinked objects that can be navigated. i could not be more excited to start getting app & web app dev folks trying & using these systems, for once they start, i believe users & extensions will notice, & hypermedia & a new form of browsing will take off.

@natecull @zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @loke to call it out a little more, i think it will enable users to be involved with & to gather/collect/manipulate/relate to individual discrete objects.

i don't think we have any current examples of letting users relate to the entities/objects about them. starting to allow this connection is, imo, one of the main requirements to liberate personal computing & begin the revolution.

@jauntywunderkind420 @zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @loke

I really want JSON-JD to be All The Things. But....

How do we scale JSON-JD *down* to the desktop? Can we? Cause I want my data on my desktop.

This is the reason for my question earlier in this thread about 'is JSON really practical for inter-window communication on the desktop?'

I'm not *quite* convinced that all window messages should be JSON-LD running over Structured Clone Algorithm and that's it, job solved.

@natecull @jauntywunderkind420 @a_breakin_glass @enkiv2 @libc @byron @loke can you think of s case where that wouldn’t cut it?

@zensaiyuki @jauntywunderkind420 @a_breakin_glass @enkiv2 @libc @byron @loke

The obvious answer is that 'shuttling all widget communication through JSON would have the same problems that Electron does, ie, it would make everything bigger and slower and your mouse clicks would take seconds to process and everyone would swear at it'.

I don't know if this is actually the case or not.

I guess Gnome uses D-BUS for something similar, but I don't think its messages are as general as JSON.

@zensaiyuki @jauntywunderkind420 @a_breakin_glass @enkiv2 @libc @byron @loke

I do want, though, something *like* arbitrary JSON objects (up to megabytes in size) to be transferrable either between objects in a process, or widgets in a window, or windows from multiple applications in a desktop, or across the Internet. All with the same data model and semantics, if not the same protocol.

(because if it's not the same data model, you can't link your data; 'hyperdata' breaks down at that point).

@natecull @zensaiyuki @jauntywunderkind420 @a_breakin_glass @libc @byron @loke

Display postscript was faster, on weaker machines. JSON / javascript isn't the bottleneck in electron; html is

@jauntywunderkind420 @zensaiyuki @a_breakin_glass @enkiv2 @libc @byron @loke

Basically I guess JSON as the inter-widget protocol on the desktop would be roughly equivalent to Tcl/Tk and its text string windowing protocol.

Is that feasible, again, now? *Could* we do this?

JSON (or maybe JSON-SEQ) as a protocol for Unix shell pipelines would get us a few steps further towards what Powershell does for Windows.

@natecull
I used ndjson & will switch to json-seq to push data between programs atm, very easy. But it's for very simple systems, each expecting some specific form of stdin or writing some specific stdout. I don't feel like that's enough handholding, enough structure to build a desktop environment around. It's simple but too simple, anything could be anything.

Linux/freedesktop typically uses DBus. Which tends to require some programming chops to use. One could imagine writing tools to help users & tools publish & consume data there more readily but it's pretty heavy.

There's varlink, which is a json based interface & protocol. Again somewhat programming intensive. I think it makes clearer though some possible structures that "just json" doesnt help with.
https://varlink.org/

VARLINK

The Varlink Website

VARLINK
@natecull @a_breakin_glass @enkiv2 @libc @byron @jauntywunderkind420 @loke this idea is so normalised now we don’t even see it as anything special. we hear people talk about “REST” and think it must be something more interesting than literally just browsing a dynamic website (say, youtube for instance)

@a_breakin_glass @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

I mean, LOTS and LOTS of people, through the 1980s and 1990s, were SCREAMING at the object folks saying 'you are idiots for welding code to data! don't do that! nothing will work!' and all the object folks were like 'no no this is the future you oldies just don't understand'

But I think the oldies turned out to have been right? For every object we build it seems we need a parallel, separate, data format/tool for it.

@a_breakin_glass @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

And now in the age of containers and programmable infrastructure, we still use as our unit of state..... text files.

We build objects the size of computers using one-way transformations out of piles of scripts and JSON in text files , because text files are the only thing we can trust to be there between computers.

Maybe this was always how it was gonna be.

@a_breakin_glass @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

I do think that maybe 95% of what made the Web take off was its being free.

I remember there being *dozens* of competing commercial hypertext systems in the late 1980s. Hypertext was an idea that was in the air, everyone wanted in, but 'globally networked hypertext' still felt like science fiction when even setting up a LAN was very costly.

All the commercial hypertext systems died because WWW was open and free.

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

I feel like part of the mystery maybe was the idea of classes was too chunky? Document parsing, and structures of SGML /XML /JSON nodes were much more flexible because you didn't have to bind your whole document to one inflexible 'class' that had to update as a unit?

Or maybe www just leveraged FTP, DNS et all and those weren't OOP-y but were just 'there and good enough'?

@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke adding sgml was part of the process of making it work cross platform. you needed the wire protocol to not care what exact class heirarchy was available at the other end.
@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke you could say that was where the web succeeded and other systems like corba failed. thanks to libwww, you could get the web to work on the computer you actually owned, not some fictional future computer that a theorist was excited would be ubiquitous someday
@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke corba gained traction in enterprise spaces, where you could actually install the same system (and class heirarchy) on every workstation and server that needs to use it. i still need to use a corba based client for my job in 2020
@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke it works just as i describe: click a button to view a directory listing, unplug the network cable, and the whole app spin locks up. have to force close it. no network error handling whatsoever
@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke my eyee bugged out of my head when i was watching a demo of the pre-web mac system 7.5’s new networking features: real time collaborative object oriented document editing over a (local) network

@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke apple did implement something like that. it’s, i think what the itunes store was originally written with

https://en.m.wikipedia.org/wiki/WebObjects

aside from that, URL’s *are* opaque identifiers as far as http is concerned. the paths are just a convenience for automatically generating them off a file system. but, indeed, web servers don’t need to expose paths, or files. they just take the url as a string and return a response.

WebObjects - Wikipedia

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

My point is that I think the REST philosophy strongly disagrees with the idea that 'URLs are opaque'. As I recall, REST argues that URLs have to be strings so humans can write them.

By comparison: OOP identifiers *aren't* strings. They're machine addresses, compiled *from* strings but which only exist in source code files not the finished product. That made them fast but brittle.

Dropping back down to strings was important I think.

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

And for HTTP, it also wasn't just that URLs/URIs were strings... but that pages were expressed as 'documents' which were imported as strings.

NONE of this was at all standard late 1980s commercial desktop practice AIUI. Word processing documents weren't strings, they were binary RAM dumps. Everything was moving FROM strings TO objects.

But documents being old 1970s-era strings made the Web hugely accessible, portable and debuggable.

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

eg the comparable commercial hypertext systems, all of them that I know of, all had a 'compile' phase. You edited a document in some source form which MIGHT be a text file, or might be a WYSIWYG editor, but then you compiled it to the special secret sauce proprietary hypertext format of the engine of your choice (Hypercard, Microsoft Help, Folio VIEWS etc). The idea of a viewer that read raw text... was a massive throwback.

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

But I'm wondering now, was DynaText (being SGML) a missing link in the evolution of WWW?

There has to be a reason why Berners-Lee felt that SGML was an appropriate tool for the job of hypertext?

https://en.wikipedia.org/wiki/Dynatext

Dynatext - Wikipedia

@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke it was just a convenient tool he had available and was familiar with from his academic work. he didn’t choose it from first principles. it could just as easily have ended up being TeX

@zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke

Mmm. But what were those academic systems that were using SGML, circa 1989? What were they using SGML for?

@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke i imagine for the scientific papers he wanted to put into the wiki system he was trying to buld. (the original idea was much more like a wiki system than the read only web we ended up with)
@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke REST is broadly misunderstood actually. one of its core principles is strongly that urls are opaque identifiers. a RESt protocol shouldn’t care what’s inside a url string
@natecull @enkiv2 @libc @byron @jauntywunderkind420 @loke but to clarify, REST refers to multiple things, there’s REST the network architecture paper written by roy fielding, detailing the principles behind the deeign of the http protocol, and then theres RESTY apis, this informal idea about mapping urls to objects in an application and using http for application apis.
@natecull @zensaiyuki @enkiv2 @libc @byron @jauntywunderkind420 @loke
The original HTTP and URL RFCs specified the semantics of parts of the URL, such as paths and query strings. REST built on that. Later RFCs gave up doing that because too many vendors violated the standard semantics, so now URLs are effectively opaque to the right of the hostname.

@natecull @zensaiyuki @libc @byron @jauntywunderkind420 @loke

If I recall, NeXT / ObjC actually *had* its own RPC (i.e., network-transparent message forwarding) and object transfer (can't recall if it serialized or just swizzled pointers).

(If it didn't, it should have, as a natural extension of the smalltalky nature of objc.)

TBL was doing development on NeXT but afaict he wasn't a NeXT *guy*.

@natecull @zensaiyuki @libc @byron @jauntywunderkind420 @loke

For instance, my understanding is that some design decisions around web rendering basically came down to the ease with which NeXTSteP's graphical GUI-builder application could be made to display or implement them -- not a sign that he had swallowed the object orientation ideology, but a sign that (just as with Eich some years later) he had to get this done in a couple days & didn't have time for design or forethought.