How should `volatile` work? =========================== Perhaps there are actually 4 different types of "volatile" and "volatile"-like keywords: * For multi-threading. * For communicating with the OS, if that is done via reads/writes of userspace rather than syscalls. * For communicating with hardware, e.g. device registers. * For signal handlers, setjmp/longjmp, etc. Questions / decisions to make: * Should `io` imply `volatile`? - No, `io` objects can only be modified when the current thread is operating on them (e.g. making a function call). Volatile objects can be modified at any point, and even asynchronously. * Should objects be able to become `volatile` when borrowed? - No, next solution is better: * Should `var` objects be able to become `volatile`? - Perhaps. A `var` object is exclusively referenced (OR shared with `aliased` references). - But this would weaken `aliased`, which would essentially become equivalent to `volatile`. * Should only `volatile` and `io` objects be able to reference `volatile` objects? - Yes, this is necessary to prevent "spooky action at a distance", or even incorrect behavior (e.g. a "pure" function that accesses a `volatile` field somewhere). * Should access to volatile data/fields only be allowed through explicit "write_once" and "read_once" operators? * Should 64-bit integers, float, and other possibly multiple-word sized types be allowed in volatile data?