Hacker News new | ask | show | jobs
by eMGm4D0zgUAVXc7 1654 days ago
How do you want to write software which supports plugins then?

Force the user to restart everything if they need a plugin?

Or do you want to force developers to only ever write monolithic software now?

4 comments

It's simple, you simply implement some sort of code signing feature, or you only let people run arbitrary code in a sandbox or some sort of similarly limited environment. Letting people load code from a remote source into the same address space of a running program containing potentially sensitive data is intrinsically bad.

In fairness, Java has had capabilities to only let signed code run since its early days (it was fundamental for stuff like Applets or RMI), but like the rest of Java the whole specification is over engineered and quite complicate so nobody bothers with it. There are just too many old features lying around in the JRE that should be off by default. Like they shouldn't be possible to use unless you explicitly configure your environment to enable them. 99.999% of apps do not need and will never care about JNDI, and having it just lying around doing nothing just pointlessly increases the surface attack of your application for no good reason.

> restart everything if they need a plugin

Yes. Hopefully ensures that only people authorized to actually restart the service can add arbitrary code.

Have a look at the forced restarts of Windows due to updates having become a well-hated meme to see how lucky you'll be in explaining that to the users.
Restarting an operating system is completely different than restarting an application after you enable a plug-in.
Zero-downtime service restarts have been a thing for a very long time. It is a different story for operating systems.
Plug-ins should be sandboxed anyway. Which means they shouldn’t be random Java classes with the same blast radius as your main application. And if you’ve done that right you’ve got a VM that can be restarted without having to restart the parent application.
a trivial false dichotomy. you can create plugin systems that do not allow modifying the runtime.