Honestly a question as opposed to a troll disguised as a question… This is a question from the perspective of a language implementation geek who also gets asked why some things are awkward in Elm and wants to give honest answers.
There are lots of arguments in favor of the way ports work that cite avoidance of runtime exceptions. I understand that having native code run synchronously with other Elm code or worse manipulating Elm’s data structures opens up risks. But what I don’t understand is why disallowing command ports from returning values and instead requiring a separate subscription — an issue that seems to come up repeatedly for some uses ports — creates runtime safety that would not be present if such things were allowed. The same Turing completeness argument that argues that nothing is impossible with ports would also seem to argue that having a command trigger JavaSript code which triggers a subscription has the same potential for runtime exceptions as code in which the command implementation gets to respond directly to the command rather than via a subscription.
Honestly, what am I missing? What runtime exceptions is the plumbing around ports on either side preventing or at least heavily discouraging that a ports approach with the ability for commands to asnchronously return values wouldn’t?