On Sat, Jan 5, 2013 at 1:49 PM, Timo Westkämper <[email protected]>wrote:
> > Are there or will there be goals to do this in core.logic? Having direct > support for maps would be great. > It's something I've been thinking about for a long time. So it's likely it will appear at some point, I'm just not sure when. If somebody would be willing to investigate it's feasibility that would be extremely helpful. > Here is one example > > (def l (range 0 2000)) > (run* [q] (appendo l l q)) > One my machine this works without a hitch. What version of core.logic are you using? > Ok, I will try if I can extract one of those SO errors. > > I also noticed that I could get significant performance gains when > encoding certain goal usage patterns more directly like this > > (defna argso > [bindings args] > ([[?k ?v] [?k]]) > ([[?k1 ?v1 ?k2 ?v2] [?k1 ?k2]]) > ([[?k1 ?v1 ?k2 ?v2 ?k3 ?v3] [?k1 ?k2 ?k3]]) > ([[?k ?v . ?rest] [?k . ?resta]] > (argso ?rest ?resta)) > ([[] []])) > > I suspect this means that the recursion in goals is not yet as performant > as it could/should be? > How were you writing this goal before? But yes, unification is eager and implemented as efficiently as I know how. Recursive goals involve scheduling and extra unifications so things might not happen as quickly as you like. I do have many possible core.logic optimizations in mind but these will need to wait. I think 0.8.0 will involve a considerable amount of shakeout of the new constraint work. If that gets settled I could see 0.9.0 focusing on performance optimizations. Again, definitely interested in contributions in this area. David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to [email protected] Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/clojure?hl=en
