-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededtype system
Description
We should be able to query the current time and time a scheduled variable was last-updated. In fact, ssm-runtime already supports this, and codegen even has bindings for it. I tried hacking this in with 072fb9a (for now and last, whose syntax is prefix @@) and 152d994 (adding in Time as an alias for U64).
But there are several problems, leading me to remove these features from the scanner in 11752b8:
- Timestamps cause mad leaks. This is because they are 64-bit values and are stored on the heap. Reading them causes allocation, and for some reason they aren't being cleaned up properly.
- We can't do any kind of arithmetic or comparisons with time. Arithmetic operators like
+,-,<, and==are hard-coded asI32 -> I32 -> I32. To support time arithmetic, we would need them to be aware ofU64somehow. This involves type classes or some other kind of overloading, which we're not ready for. We would also need to do codegen for them differently because we would need to read the value out of the heap usingssm_time_read()rather thanssm_unmarshal(). - We can't even "read" the time. An easy hack out of the above issue is to add primitives to read the lower and upper 32 bits out of the 64-bit timestamp, using
ssm_time_read(), but we would need syntax for this.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthelp wantedExtra attention is neededExtra attention is neededtype system