4 ms·
Enforcing pureness on the function might be difficult w.r.t. things like IO, due to Java interop, and frankly that's one of the strengths of the platform. Infe
by dpratt 12y ago
Enforcing pureness on the function might be difficult w.r.t. things like IO, due to Java interop, and frankly that's one of the strengths of the platform.
Inferring loose immutability constraints on a function would be interesting. You could implement it in the compiler, perhaps something like an annotation on a method that declares all inputs must consist of only final/immutable values, enforced all the way down the chain.
This is more of a JVM gripe, but as long as we're talking about Go, I'd love to see actual VM-level coroutine support. It'd make async code in Scala a lot easier to both author and debug.
- tormeh 12y agoWell, you could just assume that all non-Scala code is impure. Actually, thinking about it, why not just make it illegal to modify arguments, full stop? It's perhaps the worst software practice I can think of. I think Oracle is going to wait a long time until they add that to Java, and it's not going into the JVM before it's going into Java, unfortunately. Well, there is a limited number of instructions in the JVM, so using them on things that are unproven might be a very bad idea.