Lambda Encoding
- attempt at articulation of an idea prompted by some discussions at Ink&Switch (though much older now, dating back to PostScript) - what if documents were described not as a "structure", but as a program that generates that structure
- if I squint, this looks similar to "Kolmogorov Complexity"
Kolmogorov complexity of an object, such as a piece of text, is the length of a shortest computer program (...) that produces the object as output
Several of the best graphics people at PARC created an excellent "printing standard" for how a document was to be sent to the printer. This data structure was parsed at the printer side and followed to set up printing.
But just a few weeks after this, more document requirements surfaced and with them additional printing requirements.
This led to a "sad realization" that sending a data structure to a server is a terrible idea if the degrees of freedom needed on the sending side are large.
And eventually, this led to a "happy realization", that sending a program to a server is a very good idea if the degrees of freedom needed on the sending side are large.
(...)
Key Point: "sending a program, not a data structure" is a very big idea (and also scales really well if some thought is put into just how the program is set up).
— Should web browsers have stuck to being document viewers? ↗ - Alan Kay
- big thing to solve here is sandboxing - safely executing random code sent to you is a much harder thing than parsing a well-defined schema; this is an issue with PostScript too - maybe it's not a "big deal" since it's a printer?
Infinite loops One trivial example of an infinite loop written in PostScript is given below:
%! {} loopThis minimalist document keeps a PostScript interpreter busy forever. In an evaluation with a pool of 20 test printers, only one had a watchdog mechanism and restarted itself after about 10 minutes. The other devices did not accept print jobs anymore until the test was ultimately interrupted after half an hour.
— http://hacking-printers.net/wiki/index.php/Document_processing ↗ - on the other hand, aren't JavaScript single-page-apps already this in "reverse" - the clients receive code to execute, not a rendered document