5 ms·
There are many possibilities since you can pass any program/algorithm through LJSON while still having a good level of safety. You could it, for example, to all
by LightMachine 11y ago
There are many possibilities since you can pass any program/algorithm through LJSON while still having a good level of safety. You could it, for example, to allow your users to pick an AI strategy for their bots in a game, among billion of other things. But there are many restrictions, so you can't just write arbitrary JS functions. You have to design them much more carefully by requesting the proper primitives, using the technique I explained with the hypothenuse example. Of cours, you could just request `window` as a primitive and get everything, but yea...