Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

The reason that assignment statements are so pernicious is not, as is commonly supposed, that they are 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.

...