I need a way to run untrusted code delivered by network. And I’m going to use Elm for that. Because it allows to make sandboxed code interaction predictable and strict.
So you basically want to use Elm as a scripting language where your backend?/frontend? will execute code that isn’t trustworthy because it is delivered over a network? To do what sort of work?
Without more details it’s hard to tell what you may need exactly
I’m on research stage so it’s harder to provide more details
I’m going to run elm program with nodejs. For example I have counter app which increase stored value. This app should work like service and subscribe to some counter Port. I’m going to run several instances of such program in one nodejs process simultaneously.
That would be possible, although it’s a curious thing that you want to process JSON with Elm when de-/encoding JSON is one of the things people constantly complain about
// App1.elm
// Have a headless Elm program
main =
Platform.programWithFlags
{ init = init
, subscriptions = subscriptions
, update = update
}
// service.js
import Elm from 'your/built/app.js';
const app1 = Elm.App1.worker({ someFlag: true });
app1.ports.toElm.send({ your: 'data' });
// ... more apps