Hacker News new | ask | show | jobs
by jcelerier 2835 days ago
> In the end either a class exists in the closed-world that existed when the project was compiled, or it does not

uh ? no, new classes are added at runtime all the time - at least in C++, dynamic loading of plug-ins is extremely common

1 comments

What I'm saying is that it breaks when you do a Class.forName(...), while if such class is known to exist at compile time, it is the same as a switch statement on the class name that returns a new object of the same type; and that second form would be a valid operation.
> What I'm saying is that it breaks when you do a Class.forName(...),

but you don't do this. you register the classes according to what is on your file system and you load one that matches your criterions or you ask your user to choose one in a UI of some kind.

SubstrateVM does support that pattern.

What people are talking about is different. It's when the app genuinely loads plugins that weren't available at compile time, or generates bytecode on the fly.