On Sunday, December 6, 2015 at 11:07:26 PM UTC-5, Alexis King wrote: > The honest answer to your question is that I don’t know (though I’d also be > interested to hear the answer). Obviously, I’d like to see generic APIs given > more thought, but they are currently somewhat slow due to how dispatch is > performed. I don’t think that’s a reason to design APIs in a certain way, but > it is a practical consideration. I’m guessing that can be optimized, though, > and I’d be curious to see how generics fare on Pycket.
Does the current implementation use caching? The ideal (I think) would be to do a whole-program transformation that collects all the interface implementations. I'm not sure if Racket even has a mechanism for that, though. Even a per-module system would be handy, though, and that should be doable. > More generally, I’m not sure multiple dispatch is needed, though it can be a > neat tool at times. I think part of the problem is that multiple dispatch is > both hard to reason about and slow to implement in a dynamically-typed > language. It’s unclear what to use to dispatch on given that values do not > have “types”. Well in the dream language that lives in my head, you can create dispatchers with any predicate, and the compiler converts them to some normal form and generates a decision tree. And it cooperates with the type checking system so that each call site can jump directly to branches in the tree if some of those decisions are known at compile time (and it's all decidable and O(log log n) because, hey, it's my dream :) ). But again, whole-program transformations. > I think that collections are an obvious place where generic APIs just make > sense, but I’d be open to hearing suggestions for other parts of Racket to be > “genericized”. Yeah, generic collections are the sine qua non. -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group and stop receiving emails from it, send an email to racket-users+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.