miniKanren / core.logic Google Group

2013-03-13 Thread David Nolen
William Byrd has started a new miniKanren / core.logic Google Group. Feel free to direct your relational and constraint logic programming queries there. It's fine to post on the Clojure lists of course especially if the inquiry / discussion is Clojure-centric, but I'm excited about the cross-polli

Re: core.logic: Dividing the knowledge base

2013-03-14 Thread David Nolen
That's likely though pldb is so small I don't really think it would require much in the way of changes. On Thu, Mar 14, 2013 at 5:15 PM, JvJ wrote: > I'm not sure how else to go about contacting you about this, but I've > found some problems in pldb. The system just doesn't seem to work at all

Re: clojurescript browser repl not working.

2013-03-14 Thread David Nolen
I'm not sure if lein-cljsbuild uses the latest release of ClojureScript - Evan would know. In general I think it's probably best to just specify the version of ClojureScript you want to use yourself to avoid any issues. On Thu, Mar 14, 2013 at 5:21 PM, Rohan Nicholls wrote: > I have been in touc

Re: core.logic: Dividing the knowledge base

2013-03-14 Thread David Nolen
On Thu, Mar 14, 2013 at 7:18 PM, Norman Richards wrote: > PLDB was written against the current core.logic release. I have not yet > started testing with the 0.8 pre releases, but judging from the recent > core.logic announcement, now is probably a good time to start. :) Please do. I'll probably

Re: core.logic : Fact assertion as a relational operator

2013-03-16 Thread David Nolen
Doesn't exist and I'm not that familiar with assert. Patch welcome of course. On Sat, Mar 16, 2013 at 5:24 PM, JvJ wrote: > I realize that it is possible to enter facts into the core.logic database > with the facts function. However, I'm looking for something more like the > Prolog assert; a r

ANN: core.logic 0.8.0

2013-03-17 Thread David Nolen
I'm happy to announce the release of core.logic 0.8.0. There are far too changes, bug fixes, and enhancements to cover here. For the most part the miniKanren portion of core.logic has been left unchanged from the standpoint of the user. The biggest change is the inclusion of extensible constraint l

Re: [ClojureScript] Re: Moving ClojureScript to Clojure 1.5.0 & data.json dependency

2013-03-17 Thread David Nolen
Done! On Sun, Mar 17, 2013 at 4:49 PM, Darrick Wiebe wrote: > On Friday, 1 March 2013 11:41:26 UTC-8, David Nolen wrote: > > Now that Clojure 1.5.0 is out the door I'd like to make ClojureScript > depend on it. This would allow me to merge in the source map branch whi

Re: ANN: core.logic 0.8.0

2013-03-17 Thread David Nolen
ogic/blob/master/CHANGES.md On Sun, Mar 17, 2013 at 2:50 PM, David Nolen wrote: > I'm happy to announce the release of core.logic 0.8.0. There are far too > changes, bug fixes, and enhancements to cover here. For the most part the > miniKanren portion of core.logic has been left

Re: Persistent Data Structures for Objective-C/LLVM

2013-03-28 Thread David Nolen
As far as I know the immutable Objective-C collections are not efficient to update and likely perform terrible in this respect to Clojure collections. On Thu, Mar 28, 2013 at 1:07 PM, Omer Iqbal wrote: > Most foundation objective c data structures are immutable (NSArray, > NSDictionary, NSSet e

Re: core.logic : In one list but not in another

2013-03-28 Thread David Nolen
You can express not member of list B with disequality. I could show you how to do this, but you'd probably learn more by giving it a try yourself ;) On Thu, Mar 28, 2013 at 2:47 PM, JvJ wrote: > In core.logic, how do the following: "Give me everything that is a member > of list A and not a memb

Re: core.logic : In one list but not in another

2013-03-28 Thread David Nolen
negation is hard. This has come up several times. It may be possible to a better form of negation as failure via delays, but this not high on my current priority list. Patches to make it work are of course most welcome. On Thu, Mar 28, 2013 at 2:54 PM, JvJ wrote: > Thanks, but there's another a

Re: core.logic : In one list but not in another

2013-03-28 Thread David Nolen
> [4] > [5] > [6]]) > > (run* [q] > (a q) > (fresh [x] >(b x) >(!= q x))) > (1 1 2 1 1 2 2 2 3 4 3 3 4 4) > > So what the heck is this all about? > > On Thursday, 28 March 2013 15:17:24 UTC-4, David Nolen wrote: > >&

Re: core.logic : In one list but not in another

2013-03-28 Thread David Nolen
>> >> (run* [q] >> (fresh [x] >> (conde >>( (== q 1) ) >>( (== q 2) ) >>( (== q 3) ) >>( (== q 4) )) >> >> (conde >>( (== x 3) ) >>( (== x 4) ) >> ( (== x 5) ) >>( (== x 6) )) >&g

Re: core.logic : In one list but not in another

2013-03-28 Thread David Nolen
> > On Thursday, 28 March 2013 16:21:41 UTC-4, David Nolen wrote: > >> My point here isn't to tickle your brain but point out that there's a bit >> of misunderstanding about how core.logic works and what facilities you >> should use to handle your problem. >

Re: core.logic : In one list but not in another

2013-03-28 Thread David Nolen
On Thu, Mar 28, 2013 at 5:01 PM, JvJ wrote: > (defn hates-drink >[d] >(is-drink d) >(not-likes-drink d)) > This is a common mistake. But consider that the following hardly makes any sense in Clojure either: (defn foo [a b] (+ a b) (- a b)) Clearly the addition is going to get

Re: How to use clojure.core.logic to generate strings?

2013-04-04 Thread David Nolen
str is a function not a goal/relation - it doesn't know how to deal with logic vars. If you want that to work you will need to project result first. But if you project result then order matters and the unification of query must come after the membero call. On Thu, Apr 4, 2013 at 9:25 AM, Adam Sal

Re: How to use clojure.core.logic to generate strings?

2013-04-04 Thread David Nolen
There is currently no simple way to make a substring goal beyond manipulating strings as sequences which is not ideal. The constraint framework does make it possible, but that API is under change so you can't build things upon it reliably yet. So project is your best option for now. On Thu, Apr

Re: core.logic: Database context monad

2013-04-04 Thread David Nolen
Sounds interesting. I've seen nothing like this in the Prolog literature, but I may not have looked hard enough. Probably worth investigating, might turn up some other interesting ideas even if you can't make assertion/retraction relational. On Thu, Apr 4, 2013 at 9:21 PM, JvJ wrote: > I've bee

Re: core.logic: Database context monad

2013-04-05 Thread David Nolen
7;ve gathered some bits and pieces about how goals work, but > I'm not sure I totally understand the system. Do you know any good places > to start with that? > > > On Thursday, 4 April 2013 22:08:38 UTC-4, David Nolen wrote: > >> Sounds interesting. I've seen noth

Re: core.logic: Database context monad

2013-04-05 Thread David Nolen
Oops, thanks for the proper link! On Fri, Apr 5, 2013 at 10:28 AM, Rostislav Svoboda < rostislav.svob...@gmail.com> wrote: > I found this http://gradworks.umi.com/3380156.pdf on > http://www.cs.indiana.edu/~webyrd/ > > -- > -- > You received this message because you are subscribed to the Google

Re: core.logic: Database context monad

2013-04-05 Thread David Nolen
I should clarify that only Chapter 3 is really relevant. The other chapters explain how tabling, disequality, and nominal logic work - but they are not essential. Also the version of miniKanren found in the dissertation is available here and I recommend running it in your favorite Scheme: http://g

Re: core.logic: partial resolution

2013-04-05 Thread David Nolen
Your macro just produces more answers, it doesn't actually address the problem of divergence. I don't think it could be made to work nor any other approach. On Fri, Apr 5, 2013 at 4:24 PM, JvJ wrote: > Is there a way in core.logic to get something like the "best possible > substitution" for a g

Re: Superset goal in clojure.core.logic?

2013-04-07 Thread David Nolen
I don't have much advice beyond looking at how people do this in Prolog. We're starting to look into CLP(Set) which will provide much better support for working with sets and doesn't rely on list encodings. On Sun, Apr 7, 2013 at 5:24 AM, Adam Saleh wrote: > Hi, > > I am having trouble creating

Re: Clojure is in GSoC 2013!

2013-04-08 Thread David Nolen
WOOT! On Mon, Apr 8, 2013 at 9:33 PM, Daniel Solano Gómez wrote: > Hello, all, > > I am happy to report that Clojure has been accepted as a mentoring > organization for Google Summer of Code 2013. Now is the time for > sudents to start researching their projects and reaching out to members. > A

Re: [GSOC 2013] core.match refactoring

2013-04-10 Thread David Nolen
t; > Can anyone point me in the right direction to contacting David Nolen about > refactoring/documenting core.match? > > I've done a bit of tinkering around with Erlang and it's gotten me > intrigued with the implementation of pattern matching. I'm also looking > over

Re: [GSoC 2013] core.logic CLP(Prob)

2013-04-23 Thread David Nolen
On Tue, Apr 23, 2013 at 2:10 PM, Radosław Piliszek wrote: > 1) Is this place the best to discuss this? > Yes. > 2) Are there some set goals that CLP(Prob) should achieve? (,,Basic > support of CLP(Prob).'' does not express it too well! :-P ) > This seems like a pretty challenging one as there

Re: [GSoC 2013] core.logic CLP(Prob)

2013-04-24 Thread David Nolen
I think it means though, then it > should be possible to build and keep track of the computation trace thanks > to the JVM and Clojure. My intuition says that a very dedicated student > could probably produce a Clojure library to catch Church in terms of speed > by the end of the summer, si

Re: [GSoC 2013] core.logic CLP(Prob)

2013-04-25 Thread David Nolen
On Thu, Apr 25, 2013 at 5:29 AM, Martin Forsgren wrote: > What are your thoughts on slpKanren? Could it be used as a base for > probabilistic programming in core.logic? > https://github.com/webyrd/slpKanren > > - Martin > It's definitely worth taking a look at and assessing. It does have the bene

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
primitive hinted fns will get inlined. You can also play the same kinds of games that Clojure does with definterface+deftype and fns that declare :inline metadata. If you don't want to learn the subtleties of Clojure performance tuning then you can always write your performance critical bits in Ja

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
quot; > "Elapsed time: 68.964182 msecs" > "Elapsed time: 68.105047 msecs" > "Elapsed time: 108.576746 msecs" > "Elapsed time: 100.992193 msecs" > "Elapsed time: 100.945511 msecs" > > On Apr 25, 10:32 pm, David Nolen wrote: > > pr

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
Which is out of date. On Thu, Apr 25, 2013 at 12:47 PM, Alice wrote: > Found this blog post written by fogus: > > "To provide this level of flexibility Clojure establishes a level of > indirection. Specifically, all function lookups through a Var occur, > at the lowest level, through an atomic

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
laborate which part is out of date? > > On Apr 26, 1:48 am, David Nolen wrote: > > Which is out of date. > > > > > > > > > > > > > > > > On Thu, Apr 25, 2013 at 12:47 PM, Alice wrote: > > > Found this blog post written by fogus: &

Re: Do functions never get inlined by jvm?

2013-04-25 Thread David Nolen
(doc definline) On Thu, Apr 25, 2013 at 1:17 PM, Michael Klishin < michael.s.klis...@gmail.com> wrote: > > 2013/4/25 David Nolen > >> + :inline metadata > > > Which is not documented anywhere and might as well not exist for regular > Clojure users

Re: core.logic: Strange behaviour when using featurec with nested feature map (bug?).

2013-04-25 Thread David Nolen
Looks like a featurec bug, please file a ticket http://dev.clojure.org/jira/browse/LOGIC Thanks! David On Thu, Apr 25, 2013 at 5:53 PM, Martin Forsgren wrote: > Hi! > > I noticed something strange when using featurec with a nested feature map(I'm > using core.logic 0.8.3). > This works as expe

ANN: ClojureScript release 0.0-1798

2013-05-03 Thread David Nolen
artifact: http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1798%7Cjar Git log: https://github.com/clojure/clojurescript/compare/r1586...r1798 Enhancements * Code size improvements, (.log js/console "Hello world!") now generates ~100 LOC of pretty printe

Re: ANN: ClojureScript release 0.0-1798

2013-05-03 Thread David Nolen
Forgot to add CLJS now depends on Clojure 1.5.1 and data.json 0.2.2. On Friday, May 3, 2013, David Nolen wrote: > artifact: > http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclojurescript%7C0.0-1798%7Cjar > > Git log: https://github.com/clojure/clojurescript/compare/r

Re: core.logic: Strange behaviour when using featurec with nested feature map (bug?).

2013-05-05 Thread David Nolen
Fixed in master, thanks for the report! On Thu, Apr 25, 2013 at 5:53 PM, Martin Forsgren wrote: > Hi! > > I noticed something strange when using featurec with a nested feature map(I'm > using core.logic 0.8.3). > This works as expected: > (run* [x y] > (featurec x {:a {:b 1}}) > (== y {:b 1

Re: [GSoC] Mentors: please review student proposals

2013-05-06 Thread David Nolen
Thanks for the reminder! On Mon, May 6, 2013 at 9:23 AM, Daniel Solano Gómez wrote: > Hello, all, > > This is just a quick reminder for mentors. Please sign up to be a > mentor on Melange[1] with Clojure. Once you do so, please take a moment > to review the proposal that have been submitted.

Re: ANN: ClojureScript release 0.0-1798

2013-05-06 Thread David Nolen
Stuart Sierra just pushed out 0.0-1803 which fixes a regression around seq, get, & reduce and extension to JavaScript natives pointed out by Kevin Lynagh. On Fri, May 3, 2013 at 6:14 PM, David Nolen wrote: > artifact: > http://search.maven.org/#artifactdetails%7Corg.clojure%7Cclo

Re: Separating Out .cljs Content

2013-05-07 Thread David Nolen
I believe the ClojureScript compiler simply looks for all .cljs files on the specified compile path. I think maybe you could put your files in different directories so they don't all get concatenated together. You can one build specify one path, and another build specify both paths. Perhaps other

Re: Separating Out .cljs Content

2013-05-07 Thread David Nolen
ut if I recall correctly, the > only way > to not compile everything into a single file is to leave out the > :optimization flag > completely. If this is the case this should probably be considered a bug. > I might > be wrong though. > > Jonathan > > > On Tue, May 7, 201

Re: Parallel code execution in ClojureScript?

2013-05-07 Thread David Nolen
It can probably be done with HTML 5 Workers in browsers that support it, On Tuesday, May 7, 2013, Ghassan Ayesh wrote: > Hi: > > In Javascript language, and while the language is inherently functional, > Javascript's *implementation* until now, does not support parallel code > execution against a

Re: Clojure/Script pr-str/read-string roundtrip differences

2013-05-09 Thread David Nolen
Patch welcome for 1. As far as 2 I myself see no way to make that work without considering a numerics overhaul. On Sun, Jan 6, 2013 at 7:13 PM, Thomas Heller wrote: > Hey, > > I'm writing a Clojure Webapp with a CLJS Frontend and expected to be able > to cljs.reader/read-string everything I pr

Re: Clojure/Script pr-str/read-string roundtrip differences

2013-05-09 Thread David Nolen
Heh didn't notice the date on the first post :) On Thu, May 9, 2013 at 8:29 PM, Thomas Heller wrote: > Hey Brian, > > been a while since that Post, Issue #1 has been resolved for a while (see > http://dev.clojure.org/jira/browse/CLJS-466) but I actually switched to > using proper EDN tags via I

Re: Clojure/Script pr-str/read-string roundtrip differences

2013-05-10 Thread David Nolen
I believe 0.0-1806 is the latest. On Fri, May 10, 2013 at 12:35 PM, Brian Jenkins wrote: > Doh! > > I was running 0.0-1586 instead of 0.0-1798 > > Brian > > On Monday, January 7, 2013 1:13:30 AM UTC+1, Thomas Heller wrote: > >> Hey, >> >> I'm writing a Clojure Webapp with a CLJS Frontend and ex

Re: Quick question on protocols

2013-05-10 Thread David Nolen
It was my impression that extending to Object is handled as a special case - much like extend-type default in ClojureScript. On Fri, May 10, 2013 at 6:06 PM, Alan Malloy wrote: > Even when the interface and class you've extended them to are related by > inheritance? I thought the most-derived i

Re: Untangling Compilation & External Libs: Clojurescript -> Javascript

2013-05-10 Thread David Nolen
to-array is not sufficient, use clj->js On Fri, May 10, 2013 at 8:58 PM, Timothy Washington wrote: > Hi all, > > I'm trying to suss out some problems I'm encountering when compiling > Clojurescript, down to Javascript. I'm using i) a 3rd-party charting > library (highcharts.com), and ii) using c

Re: Released lein-cljsbuild 0.3.1

2013-05-11 Thread David Nolen
Thanks! On Saturday, May 11, 2013, Evan Mezeske wrote: > Nothing major in this release other than some bugfixes and bringing the > default ClojureScript version up to date. Thanks to all contributors! > Release notes: > > https://github.com/emezeske/lein-cljsbuild/blob/master/doc/RELEASE-NOTES.

Re: [ANN] - purnam 0.0.9 (javascript.dot.notation language extensions for cljs)

2013-05-12 Thread David Nolen
It wasn't intentional that aset not be variadic, I'm surprised no one has ever opened a ticket for this. Fixed in master and it inlines into efficient javascript: (defn bad-code [obj val] (aset obj "inner" "number" 10) (aset val "inner" "count" (+ 10 (aget obj "inner" "count"))) On Sun, Ma

Re: Is there any particular reason for using this form?

2013-05-16 Thread David Nolen
It is necessary - integer literals default to primitive long and I'm not sure if >= will inline if it doesn't have type information in scope. This bit of noise could probably be removed by improving type inference in the compiler. On Thu, May 16, 2013 at 3:09 PM, Pavel Prokopenko < pavel.a.prokop

Re: Is there any particular reason for using this form?

2013-05-16 Thread David Nolen
at 4:15 PM, Pavel Prokopenko < pavel.a.prokope...@gmail.com> wrote: > Thanks, David! > > What about (.nth this i) vs (nth this i)? Is that also some optimization > trick like direct object's method call vs reflection method call? > > > On Thursday, May 16, 2013 10:34:1

Re: Is there any particular reason for using this form?

2013-05-16 Thread David Nolen
On Thu, May 16, 2013 at 4:30 PM, David Nolen wrote: > .nth is a method call, nth is a function call. Another perf thing. > > In anycase if you're looking for examples of everyday Clojure it's best to > look elsewhere :) fast Clojure tends to look a bit quirky and reli

Re: Newbie question about vector performance

2010-05-31 Thread David Nolen
On Fri, May 28, 2010 at 12:20 PM, Rubén Béjar wrote: > Hi again, > > I have tried a few more things: > > I have done the same in Java but using an array > of Integers, instead of an array of ints. It just takes > 78 ms. (more than 16, still far less than 4 secs). > > I have also tried with an up

Re: Newbie question about vector performance

2010-05-31 Thread David Nolen
On Sun, May 30, 2010 at 3:49 PM, Rubén Béjar wrote: > > is not very precise with that short periods of time) and in Clojure the > 2000x2000 CA > is updated in 98 secs some times and up to 150 s. other times (the 500x500 > was 4 secs), When numbers fluctuate like that I'm pretty sure you're hitt

Re: Clojure Enhancement Proposals or "wish list"

2010-06-09 Thread David Nolen
On Wed, Jun 9, 2010 at 4:25 PM, frantz wrote: > I would like to know if there is "Clojure Enhacements Proposals" list > ("wish list"). I would like to add something. > > Best wishes, Franis. > user> (= mailing-list wish-list) true ;) -- You received this message because you are subscribed to

Bug in prim branch?

2010-06-09 Thread David Nolen
(defn foo [#^ARef wah]) Works fine on master but throws: java.lang.IllegalArgumentException: Unable to resolve classname: ARef (NO_SOURCE_FILE:6) on the prim branch. David -- You received this message because you are subscribed to the Google Groups "Clojure" group. To post to this group, send

Re: Bug in prim branch?

2010-06-10 Thread David Nolen
Here's the patch. http://github.com/swannodette/swank-clojure/commit/8c6a037c9b62edc83c852673523e95a0b14acece On Thu, Jun 10, 2010 at 12:10 AM, David Nolen wrote: > (defn foo [#^ARef wah]) -- You received this message because you are subscribed to the Google Groups "Clojure"

Re: Bug in prim branch?

2010-06-10 Thread David Nolen
Oh sorry this if you want swank-clojure to work with the prim branch. On Thu, Jun 10, 2010 at 10:56 AM, David Nolen wrote: > Here's the patch. > > > http://github.com/swannodette/swank-clojure/commit/8c6a037c9b62edc83c852673523e95a0b14acece > > On Thu, Jun 10, 2010 at 12:1

Re: 1.2 letfn/reduce bug?

2010-06-11 Thread David Nolen
On Fri, Jun 11, 2010 at 12:00 PM, russellc wrote: > (defn foo [] >(letfn (bar [acc val] > acc) > (reduce bar {} (range 1 10 > > doesn't compile > java.lang.IllegalArgumentException: Don't know how to create ISeq > from: clojure.lang.Symbol > Ahh that dreaded err

Re: Newbie question about vector performance

2010-06-11 Thread David Nolen
On Sun, May 30, 2010 at 3:49 PM, Rubén Béjar wrote: > Thanks to all of you for your interest, I will inform of any further > advance... > :-) > > Rubén Because I like sitting around optimizing Clojure code I looked into this some more: http://gist.github.com/420036 With the really great cha

Re: Protocol type hints - Java interface

2010-06-12 Thread David Nolen
On Sat, Jun 12, 2010 at 11:21 AM, David McNeil wrote: > As near as I can tell the protocol type hints are not used in the > resulting Java interface. For example: > > (ns demo.impl.boat) > > (defprotocol Boat > (go [boat ^int distance])) You can't put type hints on protocol methods, at least as

Re: Mac Emacs users: which version do you prefer (Aquamacs, Carbon Emacs, other?)

2010-06-12 Thread David Nolen
Carbon Emacs is great, I used it for years. However it will no longer be supported. I've since switched over to the Cocoa 23 port. It's lacking in some niceties but it's totally usable. On Sat, Jun 12, 2010 at 8:25 AM, Thomas Kjeldahl Nilsson < tho...@kjeldahlnilsson.net> wrote: > What are the ma

Re: Protocol type hints - Java interface

2010-06-12 Thread David Nolen
Here is a gist of what statics look like: http://gist.github.com/432465 David On Sat, Jun 12, 2010 at 12:09 PM, David McNeil wrote: > David - Thanks for the tips on definterface and the new statics > feature. I will need to look into these because I am not familiar with > either. What is the dif

Re: noob questions - Hello world + learning

2010-06-13 Thread David Nolen
If your are new to programming I recommend reading at least the first three chapters of The Structure and Interpretation of Computer Programs. It's available online. David On Friday, June 11, 2010, Jared wrote: > Hi everyone, > > I'm 100% new to LISP, 95% new to Java, and 90% new to programming

Re: noob questions - Hello world + learning

2010-06-15 Thread David Nolen
On Mon, Jun 14, 2010 at 4:09 PM, Jared wrote: > I'm trying to grok this hello world template before I move on to other > stuff. What is the ns line for? I read the documentation on ns, but it > didn't make much sense to me. Is ns related to scope? All I know is > when I delete the ns line the pro

Re: Recommendations on prepping a library for 1.2 release?

2010-06-16 Thread David Nolen
On Wed, Jun 16, 2010 at 10:17 PM, Richard Lyman wrote: > Everything's on github - right? The simplest commands to grab the core > (and contrib?) from github as well as the commands to keep updating > every week or so until release would be fantastic. > git clone url, to get it git pull, to update

Re: Recommendations on prepping a library for 1.2 release?

2010-06-16 Thread David Nolen
On Wed, Jun 16, 2010 at 11:34 PM, Richard Lyman wrote: > On Wed, Jun 16, 2010 at 8:36 PM, David Nolen > wrote: > > On Wed, Jun 16, 2010 at 10:17 PM, Richard Lyman > > > wrote: > >> > >> Everything's on github - right? The simplest commands to grab

Re: Enhanced Primitive Support

2010-06-17 Thread David Nolen
On Thu, Jun 17, 2010 at 11:00 PM, Rich Hickey wrote: > In the end, this does put the interests of two sides of the community at > odds. Only one set of interests can be the default. Part of the point of > this discussion is to measure the sides (so speak up people!). I am squarely on the side o

Re: Enhanced Primitive Support

2010-06-17 Thread David Nolen
On Thu, Jun 17, 2010 at 11:57 PM, Mark Engelberg wrote: > I assume that most Clojure users really like its dynamic nature. If > this is true, then for most of us, the common case is to NOT annotate > our code with types. Certainly I like the idea of making it as easy > as possible to write fast

Re: Enhanced Primitive Support

2010-06-17 Thread David Nolen
On Fri, Jun 18, 2010 at 12:24 AM, Antony Blakey wrote: > > That's fine for fact, but as a consumer of library functions, how do I know > when I should pass in bigints? How do I know when an intermediate value, for > my particular combination of parameter values, is going to overflow? > If the lib

Re: Enhanced Primitive Support

2010-06-17 Thread David Nolen
On Fri, Jun 18, 2010 at 1:44 AM, Antony Blakey wrote: > > On Fri, Jun 18, 2010 at 12:24 AM, Antony Blakey > wrote: > This proposal is IMO a very bad idea. > Why do you need know? You're assumption is built on someone writing a writing a bad library (one that doesn't handle long & BigInt that sho

Re: Enhanced Primitive Support

2010-06-17 Thread David Nolen
On Fri, Jun 18, 2010 at 2:10 AM, Mark Engelberg wrote: > This imposes too high a burden on any programmer who cares about safety. Rich Hickey's branch work boil down to: 1) double/long crowd get to stop eating bark 2) BigInt crowd loses free lunch I'd say this is a bona fide community compromi

Re: Enhanced Primitive Support

2010-06-17 Thread David Nolen
On Fri, Jun 18, 2010 at 2:10 AM, Mark Engelberg wrote: > Elaborating on Anthony's explanation, let's say you call (fact (foo n)). > This imposes too high a burden on any programmer who cares about safety. > Don't buy it. That's the whole point of BigInt contagion. If fact and foo are correctl

Re: Enhanced Primitive Support

2010-06-18 Thread David Nolen
On Fri, Jun 18, 2010 at 6:47 AM, Carson wrote: > (defn fact [n] (if (zero? n) 1 (* n (fact (dec n) > (defn twice-fact [n] (fact (fact n))) > (defn bad-twice-fact [n] (fact (-> n fact range last inc))) > Not only is it contrived, under the proposal, this implementation of fact is broken. It n

Re: Enhanced Primitive Support

2010-06-18 Thread David Nolen
On Fri, Jun 18, 2010 at 4:52 PM, Rich Hickey wrote: > I've revised and enhanced the strategy, based upon the feedback here. I > think it is a nice compromise. > > Docs (see update section at the top) > > > https://www.assembla.com/wiki/show/b4-TTcvBSr3RAZeJe5aVNr/Enhanced_Primitive_Support > > Co

Re: How to derive a protocol from another protocol?

2010-06-18 Thread David Nolen
Unless I'm mistaken, protocols cannot be derived. 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

Re: Enhanced Primitive Support

2010-06-19 Thread David Nolen
On Sat, Jun 19, 2010 at 5:13 AM, Mike Meyer < mwm-keyword-googlegroups.620...@mired.org> wrote: > > > Were those real world programs, or arithmetic benchmarks? Most real world > programs I see spend so little of their time doing arithmetic that making > the math an order of magnitude slower wouldn'

Re: Enhanced Primitive Support

2010-06-19 Thread David Nolen
On Sat, Jun 19, 2010 at 4:10 PM, Michał Marczyk wrote: > (defn fact [n] > (loop [n n r 1] >(if (zero? n) > r > (recur (dec n) (* r n) Huh? That doesn't look like it's going to work at all. 1) 1 is primitive, we know that, accept it 2) we don't know the type of n, what will (*

Re: Enhanced Primitive Support

2010-06-19 Thread David Nolen
e for working code. Until then this is just theoretical rhetoric. On Saturday, June 19, 2010, Mark Engelberg wrote: > On Sat, Jun 19, 2010 at 5:13 PM, David Nolen wrote: >> Huh? That doesn't look like it's going to work at all. >> 1) 1 is primitive, we know that, acc

Re: Enhanced Primitive Support

2010-06-20 Thread David Nolen
On Sun, Jun 20, 2010 at 12:57 PM, Luke VanderHart wrote: > anything that would mean I'd have to explain the intricacies of > primitives, boxing, hinting and casting in an "Intro to Clojure" > course. As much as humanely possible, that should be reserved for the > "Performance coding in Clojure" s

Re: Enhanced Primitive Support

2010-06-20 Thread David Nolen
On Sun, Jun 20, 2010 at 8:19 PM, Mark Engelberg wrote: > My favorite option of those proposed is: > +, *, -, inc, dec auto-promote. > loop/recur is changed so that primitive bindings are boxed. > +',*',-',inc',dec' give error upon overflow. > A new construct, loop', is introduced that doesn't box

Re: [ANN] Calx, a wrapper for OpenCL

2010-06-21 Thread David Nolen
On Mon, Jun 21, 2010 at 2:04 AM, Zach Tellman wrote: > Wrappers for OpenCL have been discussed a few times on this list, so > hopefully a few of you will be interested to hear that one is > available at http://github.com/ztellman/calx. > > In my opinion, the C-variant language used by OpenCL does

Re: Enhanced Primitive Support

2010-06-21 Thread David Nolen
On Mon, Jun 21, 2010 at 10:52 AM, Rich Hickey wrote: > I've added the speculative analysis required to detect when recur arguments > fail to match the type of primitive loop locals, and recompile the loop with > those loop args boxed. When *warn-on-reflection* is true it will issue a > report tha

Re: Transform columnar data into a tree?

2010-06-21 Thread David Nolen
Is it really necessary to have the keys :data and :children? If not: (reduce (fn [r x] (assoc-in r x {})) {} (partition 3 '(A1 B1 C1 A1 B1 C2 A1 B2 C3 A1 B2 C4 A2 B3 C5 A2 B3 C6 A2 B4 C7 A2 B4 C8))) {A2 {B4 {C8 {}, C7 {}}, B3 {C6 {}, C5 {}}}, A1 {B2 {C4 {}, C3 {}}, B1 {C2 {}, C1 { Works out

Re: Enhanced Primitive Support

2010-06-22 Thread David Nolen
If you're going to give example of what the current branch is like, at least write the code how a primitive Clojurian would write it: (let [n (long 9223372036854775810)] (* (/ n 3) 3)) ; Value out of range for long: 9223372036854775810 (let [n (long 9223372036854775810)] (* (/ n 2) 2)) ; Valu

Re: Enhanced Primitive Support

2010-06-22 Thread David Nolen
On Tue, Jun 22, 2010 at 6:04 AM, Heinz N. Gies wrote: > > > Yes. With Rich's primitive work we can get to *1 billion arithmetic > operations* in < 2/3 of a second on commodity hardware. > > Which is absolutely great since I always wanted to do that :P , > meaning the example is kind of far fetche

Re: cond formatting

2010-06-22 Thread David Nolen
On Tue, Jun 22, 2010 at 4:27 PM, cageface wrote: > > Any thoughts on this or other approaches? (defn compare-row [a b] ;; compare null rows as > to advance cursor (cond (and (nil? a) (nil? b)) [0,0] (and (nil? a) (not= b nil)) [1, 0] (and (not= a nil) (nil? b)) [-1, 0] tru

Re: Reflection warnings in defrecord (missing hint in core_deftype.clj?)

2010-06-23 Thread David Nolen
I've been seeing this as well. On Wed, Jun 23, 2010 at 11:17 AM, Michał Marczyk wrote: > Hi, > > just noticed that > > (defprotocol Foo (foo [self])) > (defrecord Bar [x] Foo (foo [self] x)) > > gives a reflection warning -- "call to contains can't be resolved". > > My initial guess is that this

Re: State of Clojure web development

2010-06-24 Thread David Nolen
On Thu, Jun 24, 2010 at 3:12 PM, Tim Robinson wrote: > > > (def stuff {:key1 {:item1 {:sub1 val1}}) > > (((stuff :key1) :item1) sub1) <--- YUCK > val1 > (get-in m [:key1 :item1 :sub1]) <--- YUM ;) > > (rest stuff) > (2 3 4 5) > > (next stuff) > (2 3 4 5) < this can be done with res

Re: State of Clojure web development

2010-06-24 Thread David Nolen
On Thu, Jun 24, 2010 at 12:27 PM, Daniel Gagnon wrote: > I don't use Clojure for web development and I thought sharing why could be > useful too. > > For web development, my favourite tool is > Django. > It comes as a fullstack framework which means I have everythin

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-24 Thread David Nolen
On Thu, Jun 24, 2010 at 5:08 PM, Heinz N. Gies wrote: > So out of curiosity I did some benchmarking of the new equal branch and > wanted to see how much I can get out of clojure if I push the limits. Now > that said I know equal isn't done yet but I figured it won't hurt. Bad news > first, despit

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-24 Thread David Nolen
On Thu, Jun 24, 2010 at 5:17 PM, David Nolen wrote: > On Thu, Jun 24, 2010 at 5:08 PM, Heinz N. Gies wrote: > >> So out of curiosity I did some benchmarking of the new equal branch and >> wanted to see how much I can get out of clojure if I push the limits. Now >> that

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-24 Thread David Nolen
If you want some ideas: http://gist.github.com/452032 This was posted earlier in the ML in an un-optimized Clojure form as taking 98secs while the Java version took about 16ms on the OP's machine. With Rich's latest changes this optimized Clojure code runs in about 20-25ms on my i7 laptop. David

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-24 Thread David Nolen
On Thu, Jun 24, 2010 at 10:50 PM, Mark Engelberg wrote: > With respect to this particular benchmark, I don't think it will be > possible to get idiomatic code in the same ballpark as Java, because > if you use Clojure's vectors to store the permuted values, they will > be boxed. Unless Clojure st

Re: Hash-map destructuring

2010-06-25 Thread David Nolen
On Wed, Jun 16, 2010 at 7:00 PM, Brian Carper wrote: > Given: > > (defn foo [x & {:as args}] [x args]) > (foo 1 :bar 2 :baz [:quux]) > => [1 {:bar 2, :baz [:quux]}] > > If I have those rest-arguments already in a map, what's the most > elegant way to call foo with them? > > (def args {:bar 2 :baz

Re: Clojure's n00b attraction problem

2010-06-28 Thread David Nolen
On Sun, Jun 27, 2010 at 5:58 PM, Greg wrote: > This weekend I've been diving head-first into Clojure, and I've documented > a lot of the sticking points that I've run into as a n00b. > > I'd like to share them with the community here, in the hopes that we might > be able to improve the getting st

Re: Documentation and examples (and where is the documentation on reduce)?

2010-06-29 Thread David Nolen
On Tue, Jun 29, 2010 at 5:55 AM, michele wrote: > I really like Clojure, but as a complete n00b on Lisp languages, it is > frustrating that I many times have to hunt high and low for > documentation on basic stuff. > > Recently I saw a code snippet that showed that reduce takes an > optional init

Re: New Primitive data types (equal branch) - impact on optimized code.

2010-06-29 Thread David Nolen
On Tue, Jun 29, 2010 at 2:05 PM, j-g-faustus wrote: > OK, I tried this. Object field access instead of arrays made a few > percent difference, but not enough to be significant. > > Definterface and defprotocol, on the other hand, not only gave cleaner > code but was more than twice as fast. A huge

Re: Clojure's n00b attraction problem

2010-06-29 Thread David Nolen
On Tue, Jun 29, 2010 at 11:02 PM, Jason Smith wrote: > One of the great strengths of Clojure, and what is going to make it > hard for students who aren't already comfortable with Java, is that it > not only integrates with Java, it depends on that integration. So you > have to know a lot about J

Re: Clojure's n00b attraction problem

2010-06-29 Thread David Nolen
On Tue, Jun 29, 2010 at 11:04 PM, cageface wrote: > A language advocate is a salesman. A good salesman knows his product > and his audience. Many here seem to have some extremely naive ideas > about this. Push Clojure as a Python/Ruby/blub replacement and you'll > get a inbox full of this kind of

<    5   6   7   8   9   10   11   12   13   14   >