You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Much of the compiler code base currently relies on global mutable state. This comes with the following implications:
It is impossible to effectively parallelize calls to the service without sacrificing thread safety.
The service is not referentiallytransparent: identical inputs might generate slightly different assemblies, most importantly yielding incompatible names in generated closure types. This can be a serious problem when considering things like serialization.
We should improve this situation, either by making global mutable state thread safe or even completely refactoring the relevant code so that it becomes referentially transparent.
The text was updated successfully, but these errors were encountered:
I have an alternative proposal to solving this, which might not require as much refactoring as making a proper fix.
I propose we use thread-local dependency injection. You can find the gist of this pattern in this snippet. I have created a branch that explores on this idea. The fsc and fsi services are working properly and a couple of unit tests have been added that test parallel compilation and referential transparency.
Much of the compiler code base currently relies on global mutable state. This comes with the following implications:
We should improve this situation, either by making global mutable state thread safe or even completely refactoring the relevant code so that it becomes referentially transparent.
The text was updated successfully, but these errors were encountered: