On Saturday, January 5, 2013 9:28:21 PM UTC+2, David Nolen wrote: > > On Sat, Jan 5, 2013 at 1:49 PM, Timo Westkämper > <timo.we...@mysema.com<javascript:> > > 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? > [org.clojure/core.logic "0.8.0-beta4"] > >> 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? > Before it was just the general part (defna argso [bindings args] ([[?k ?v . ?rest] [?k . ?resta]] (argso ?rest ?resta)) ([[] []])) > > 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. > Ok, good. > > Again, definitely interested in contributions in this area. > I am not yet strong enough with core.logic for contributions, but I will post more stuff as this project advances. Thanks for your advice. Br, Timo > > David > -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send email to clojure@googlegroups.com Note that posts from new members are moderated - please be patient with your first post. To unsubscribe from this group, send email to clojure+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/clojure?hl=en