Re: Best way to dynamically spin Java classes?

2020-04-26 Thread Remi Forax
Shameless plug, i've written a simple library that shows how lookup.defineHiddenClass [1] can be used to implement dynamic proxies [ https://github.com/forax/hidden_proxy | https://github.com/forax/hidden_proxy ] regards, RĂ©mi [1] [ https://download.java.net/java/early_access/jdk15/docs/a

Re: Best way to dynamically spin Java classes?

2020-04-26 Thread Dr Heinz M. Kabutz
In Java 15 we will have hidden classes, which seem like the right model for what you are trying to do. On Sun, 26 Apr 2020 at 19:36, Steven Stewart-Gallus < stevenselectronicm...@gmail.com> wrote: > I'm spinning a lot of classes dynamically for an interpreter. > I'm not sure the best way to load

Best way to dynamically spin Java classes?

2020-04-26 Thread Steven Stewart-Gallus
I'm spinning a lot of classes dynamically for an interpreter. I'm not sure the best way to load the classes into the VM. Aside from Unsafe's defineAnonymousClass what's the best way to load classes into the VM? I believe I could create a new classloader for each spun class but IIRC classloaders