feat: annotate methods in `java.lang.System`
I think we should discuss some of these annotations more.
I understand Env as read-only from system properties, but Sys as writing. That means that if you have Sys you also have Env when it interacts with the system properties. Maybe this is not entirely correct.
Note, that the effects file is not sorted alphabetically. I will do that in a subsequent PR. Right now they appear in the order mentioned in the java doc.
Closes https://github.com/flix/flix/issues/9512
I think this also calls for the discussion in https://github.com/flix/flix/issues/9499
CI failures
I understand
Envas read-only from system properties, butSysas writing.
I think to a first approximation that is OK. But env is not just properties, it could also be e.g. number of CPUs etc. (which is not an environmental variable).
That means that if you have
Sysyou also haveEnvwhen it interacts with the system properties. Maybe this is not entirely correct.
Yes, but there is no subeffecting. So you have to put both.
Note, that the effects file is not sorted alphabetically. I will do that in a subsequent PR. Right now they appear in the order mentioned in the java doc.
OK
In the case of Runtime and System it might be worth annotating every method explicitly no matter what we decide to do in general. The reasoning being that these classes are very special and we don't want to miss anything.
I think to a first approximation that is OK. But env is not just properties, it could also be e.g. number of CPUs etc. (which is not an environmental variable).
Ah yeah apologies for the confusion. The java documentation treats env vars as system properties along with other things.
@mlutze @JonathanStarup Do we morally agree with these breakages?
@mlutze @JonathanStarup Do we morally agree with these breakages?
It has my blessing.
I am ambivalent about whether asking for platform newline or CPUs should really be a primitive effect. Hmm. But I suppose it HAS to be some effect.
I am ambivalent about whether asking for platform newline or CPUs should really be a primitive effect. Hmm. But I suppose it HAS to be some effect.
I am not ambivalent. It is definitely an effect in my book.
Nice if pure code was somewhat immue to "it works on my machine"
I understand Env as read-only from system properties, but Sys as writing. That means that if you have Sys you also have Env when it interacts with the system properties.
Not sure this is Env
What does this even do?
Does not actually seem like Env at all tbf
Maybe its impractical, but it feels like these annotations should have "doc comments" on them
Should we do another review of this and see if we can merge it?
Maybe its impractical, but it feels like these annotations should have "doc comments" on them
We could map each function to an object with the shape { "effects": effect-str, "comment": str }
No longer relevant.