User:Colby Russell/Static initializers

Revision as of 20:48, 5 July 2020 by Colby Russell (talk | contribs) (Created page with "Since static initializers aren't allowed in the triple script dialect, what about making way to use selective reification as an easy substitute? One example is in ZodLib,...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

Since static initializers aren't allowed in the triple script dialect, what about making way to use selective reification as an easy substitute?

One example is in ZodLib, where we don't pre-compute the CRC-32 table, which almost certainly leads to performance degradation that wouldn't be a problem if we had static initializers.

On the other hand, people go crazy with every affordance being used in the most ill-advised ways, and static initialization is a top recurring problem. Maybe we can finesse the dialect/ecosystem in such a way that people perceive selective reification to be too heavyweight to be used as casually as it is static initialization shows up in, say, Java, JS, Oberon, Go, etc.

Highly relevant to some notes I took yesterday:

Right now, we say that there is a prohibition on global shared state, but at the same time, we allow the browser and NodeJS layers to cheat—through guarded access following a successful typeof check, but it's still cheating. This seems to be privileging the host platforms over well-behaved modules. I can never write an orinary module, for example, to do "global" mutations on shared state. Maybe we do need a way to allow for this, but still mandate that this only occur in the host layers. (Do we need some provision in the dialect to annotate this stuff?) Or maybe we can just defer to treason + selective reification? (Is that just hand waving things away?) In my notes, I have been floating the idea of doing namespaces by fixing them up into classes and autogenerating a constructor. Maybe there's a good anchor point there for this, too. XXX Gilad keeps calling these "aliens" in the Channel 9 video about Newspeak.