4 ms·
If you wanted to create a version of F# that only allows pure functions, your best option is probably to modify the F# compiler (which is open source). However,
by tpetricek 10y ago
If you wanted to create a version of F# that only allows pure functions, your best option is probably to modify the F# compiler (which is open source). However, that sounds like something that might not be all that useful.
A more useful thing could potentially be to use the "F# Compiler Service" (which is the compiler API, exposed via a nice F# library) and create some tool that checks purity. I think many people might actually be interested in something like this.
- stcredzero 10y agoMy purpose would be to create a multiplayer game programming platform. Basically, it would come with a game loop already running, with communications already working. Then you could modify the game by changing functions that transform game tick N to game tick N+1.
- moomin 10y agoThere's another way to do this. Just scan the compiled code for access to anything other than a fairly short whitelist of functions. This is how Terrarium worked.
- evincarofautumn 10y agoYup, this is the better approach to sandboxing. You can always expand a whitelist, but it’s not so easy to play black-a-mole.