Skip to end of metadata
Go to start of metadata

The reason that assignment statements are so pernicious is not, as is commonly supposed, that they inherently appeal to a stateful model, but rather that they are virtually impossible to potentialise. There are almost no audiences for whom an assignment statement is meaningful other than those at the extremes - that is, the final executing system, or the original compiler. They are troublesome because there is almost no interpretation of an assignment statement that doesn't take the form of setting about enacting its effects RIGHT NOW. Because of this "excluded middle" of audiences, interceptors and interpreters of the "meaning" of assignment, faced with the choices of becoming a compiler, and becoming a modified executor, are forced into the second as the only viable option.

The first choice is ruled out because being even a moderately competent compiler or even parser of a small subset of a realistic programming language is prohibitively hard. Note how the dominant public parser https://github.com/jquery/esprima/blob/master/src/nodes.ts of a fairly simple language, JavaScript is completely handcrafted and able to rely on no effective tools for even part of its work, and how projects targetted at variant but highly similar languages like Vega's expression parser https://github.com/vega/vega-expression/blob/master/src/parser.js simply fork Esprima's code and bash on it to remove the surplus parts of the syntax. Note also that in general it requires the resources of a multi-billion-dollar corporation to effectively develop and maintain a credible parser and runtime, as with Microsoft in the case of TypeScript or Facebook in the case of JSX.

So - this leaves us with "intercepted execution" which appears easier to execute but simply leads down an even deeper pit. Because the semantics of "standard execution" are themselves so subtle, and were in general crafted without the needs of interception in mind, one in the end ends up having implemented an unspecifiable and uncheckable "shadow" of a part of the execution semantics of the real language - which if it isn't a train wreck in itself, will certainly become one if combined with the attempts of another citizen using the same means for a different purpose - observe the dire warnings such as these in the "observer" documentation page - https://mobx.js.org/refguide/observer-component.html "make sure that observer is the innermost (first applied) decorator; otherwise it might do nothing at all". The presence of this kind of warning indicates an obviously insane and unusable system - but note that there is not even the possibility in this world (as there might be in the mirror world of strongly typed fanaticism) of verifying compliance with the terms of the warning. The system either works as expected, if used as expected, or it doesn't. And being used as expected can be given no practical definition other than the circular one of giving rise to the expected results.

This is why we conclude that the entire mechanism of assignment, including the sites that it gives rise to, traditionally labelled as lvalues and rvalues, must be eliminated from our vocabulary of expression.

  • No labels