Erratic behaviour when raising exception from foreign code

That’s a mistake I’ve made a number of times. We’ve discussed preventing this by wrapping atom_t and term_t as C structs, but it was unclear if the compilers would generate as good code. Also, it’d be quite a bit of work (I experimented with this change after the third time I made this mistake).

The C++ interface prevents making the mistake of using an atom instead of a term. (It’s not entirely free of gotchas, but it has fewer of them than the C interface.)