Yes, what @Connor said. Basically: plugins run in sandboxes.
There is Secure EcmaScript http://github.com/Agoric/SES and webassembly. rust is especially easy to compile to web assembly - and also many other languages.
process plugins also gets us 90% of the way there.