3 ms·
How are the side effects tracked? I couldn't find it in a brief read of the source code. The documentation mentions sequence points at which previous side effec
by chrisaycock 8y ago
How are the side effects tracked? I couldn't find it in a brief read of the source code. The documentation mentions sequence points at which previous side effects are guaranteed to have finished. But what actually tracks whether IO or state changes have occurred?
- tnowacki 8y agoIO is managed through very specific native extensions where updates to that IO source are able to be tracked outside of the language and fed back in. For example, we don't have anything that lets you read from command line or stdin. But you can open and watch a file. Any changes to that file will be tracked by the runtime. Other non deterministic computation, like randomness or time is outright banned in the tracked environment. (There is an opt-in 'untracked' modifier if you want to write code outside of the reactive environment). For other tricky behavior, like mutability/mutations on an object, the type system tracks the mutability mode of any object. Only objects that are fully immutable ('frozen' in the language) can be memoized inputs/outputs to a function.
- X6S1x6Okd1st 8y ago> For example, we don't have anything that lets you read from command line or stdin. But you can open and watch a file. whats the difference between opening a file and watching it and watching stdin?
- TheDong 8y agoinotify and seek works on most files. FIFO file descriptors, not so much. If you can't seek backwards, you pretty much have to cache the whole contents in memory, which seems wildly inefficient.