Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-20 Thread Nathan Marz
Thanks. It doesn't currently use type hints to distinguish between multiple methods of the same arity. Opened an issue: https://github.com/redplanetlabs/proxy-plus/issues/1 On Monday, January 20, 2020 at 11:57:31 AM UTC-5, Ghadi Shayban wrote: > > I tried using proxy+ for one of the proxy

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-20 Thread Ghadi Shayban
I tried using proxy+ for one of the proxy implementations in clojure.core, but I ran into an issue where a "too many matching methods" got thrown at macroexpansion time. The proxy I tried to replicate was PrintWriter-on

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-15 Thread Mike Rodriguez
Ah yes. I didn't consider that. On Wednesday, January 15, 2020 at 12:31:13 PM UTC-5, Alex Miller wrote: > > Using vars lets you iterate on the impl functions without invalidating the > proxy instances. I'm not sure if that was the reason, but that would be one > advantage. > > On Wednesday,

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-15 Thread Alex Miller
Using vars lets you iterate on the impl functions without invalidating the proxy instances. I'm not sure if that was the reason, but that would be one advantage. On Wednesday, January 15, 2020 at 10:46:36 AM UTC-6, Mike Rodriguez wrote: > > Do you have any idea about the reason that the Clojure

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-15 Thread Mike Rodriguez
Do you have any idea about the reason that the Clojure implementation was done this way - when it obviously seems a bit limited and also slower than necessary? Just curious if there's some historical context. On Tuesday, January 14, 2020 at 11:58:17 AM UTC-5, Nathan Marz wrote: > > The speedup

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-14 Thread Brent Millare
Thanks this is wonderful! Nice work On Tuesday, January 14, 2020 at 11:58:17 AM UTC-5, Nathan Marz wrote: > > The speedup comes from proxy+ directly overriding methods with the > provided implementation, while Clojure's proxy has additional indirection. > For example, if you do (proxy [Object]

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-14 Thread Nathan Marz
The speedup comes from proxy+ directly overriding methods with the provided implementation, while Clojure's proxy has additional indirection. For example, if you do (proxy [Object] [] (toString [] "hello")), the bytecode for toString is: public java.lang.String toString(); 0 aload_0

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-14 Thread Brent Millare
I skimmed the code, I don't really understand how it makes it faster over proxy. Is it the generated ASM is better? What's the in-a-nutshell description of how it works? On Monday, January 13, 2020 at 1:28:46 PM UTC-5, Nathan Marz wrote: > > No differences in behavior except for API being like

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-13 Thread Nathan Marz
No differences in behavior except for API being like reify. It integrates with AOT and can be consumed just like any other class. No idea how it interacts with Graal. On Monday, January 13, 2020 at 12:29:35 PM UTC-5, John Newman wrote: > > Bravo  > > Are there any differences in behavior

Re: [ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-13 Thread John Newman
Bravo  Are there any differences in behavior to be aware of? AOT, Graal, consuming proxy+ classes from vanilla clojure classes? On Mon, Jan 13, 2020, 11:47 AM Nathan Marz wrote: > proxy+ is a replacement for Clojure's proxy that's faster and more usable. > proxy has a strange

[ANN] proxy-plus: Faster and more usable replacement for "proxy"

2020-01-13 Thread Nathan Marz
proxy+ is a replacement for Clojure's proxy that's faster and more usable. proxy has a strange implementation where it overrides every possible method and uses a mutable field to store a map of string -> function for dispatching the methods. This causes it to be unable to handle methods with