[GSoC] Mentor for self-hosting ClojureScript compiler project?

2014-03-17 Thread Max Kreminski
Hello all, I'm applying to GSoC this year, and I'm interested in taking the opportunity to go full-speed on a project I've been toying with on the side for the last month or so now. Specifically, I'm interested in writing a self-hosting ClojureScript compiler – either by forking the current Cl

Re: fast parallel reduction into hash-set/map

2014-03-17 Thread Jules
Re: GPU and "memory is not contiguous" - you need to take a look at e.g.http://www.anandtech.com/show/7677/amd-kaveri-review-a8-7600-a10-7850k/6 "GPU can now access the entire CPU address space without any copies" Heterogeneous System Architecture (HSA) is already here. The h/w and libraries ar

Re: condp first matching predicate

2014-03-17 Thread carlozancanaro
On Mon, Mar 17, 2014 at 09:16:25PM -0700, Timothy Pratley wrote: > I came up with this: > > (condp #(%1 %2) 1 > neg? "neg" > zero? "zero" > pos? "pos" > = "default") > > Which I wouldn't so much mind if I knew the name for #(%1 %2) I usually call it `funcall` (like in Common Lisp): (d

Re: is it good?

2014-03-17 Thread Mark Engelberg
combine can be made more succinct by destructuring the input directly: (defn combine [[mi ma su co] y] [(min mi y) (max ma y) (+ su y) (+ 1 co)]) As for the main function, my tendency would be to avoid taking cases on the number of args: (defn mimasuco [& s] (reduce combine [Double/POSITIVE_INFI

is it good?

2014-03-17 Thread Andy C
Hi, trying to convert some Scala code I have into Clojure and would like as for a feedback. Following code is suppose to scan a sequence and combine min, max, sum and count: user=> (defn combine [x y] (let [[mi ma su co] x] [(min mi y) (max ma y) (+ su y) (+ 1 co)])) #'user/combine user=> (defn m

Re: Calling from a macro to a private macro

2014-03-17 Thread Yoav Rubin
The case is that there are two public macro that call the same private helper macro, and that private macro is the one who does the heavy lifting, so I can either duplicate that private macro's code to be inside the public macros, or make it public and mark it somehow with a "do-not-touch" sign.

condp first matching predicate

2014-03-17 Thread Timothy Pratley
Hi, Is there a better way to write (cond (neg? 1) "neg" (zero? 1) "zero" (pos? 1) "pos" :default "default") I came up with this: (condp #(%1 %2) 1 neg? "neg" zero? "zero" pos? "pos" = "default") Which I wouldn't so much mind if I knew the name for #(%1 %2) And this: (defma

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Andy C
> In my personal experience I cannot get within 10X the throughput, or > latency, of mutable data models when using persistent data models. > Hi Martin, Thanks for finding this thread :-). Let me ask a reversed question. Given you come from a persistent data model where code remains reasonably sim

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Andy C
> Today, data is scattered > everywhere in a huge memory, > its location changes frequently, > code can be dynamically compiled, > get loaded by small chunks, > It describes my case actually - I am loading about 2-8GB of "stuff" in the memory and to tons of mapping, grouping by and filtering

Re: Creating multi-module projects with dependencies between modules

2014-03-17 Thread Dave Kincaid
Thanks, I'll try to show you what I have pieced together from your example and the immutant project. Right now I'm just trying to make it work, so I just have a project with 2 modules. There is lambda-common and lambda-etl. lambda-etl should depend on lambda-common. When I run something like "le

Re: Creating multi-module projects with dependencies between modules

2014-03-17 Thread Jim Crossley
Hi Dave, Inter-module deps should be supported by lein-modules. I have plenty of them in the immutant source tree. The test-resources dir in the lein-modules source has some examples of parent/child/sibling deps, but they're pretty contrived. If you can describe the structure of your projects or p

Creating multi-module projects with dependencies between modules

2014-03-17 Thread Dave Kincaid
I'm trying to create a project with multiple modules where there are some dependencies between modules. So far I've tried out lein-sub and lein-modules but neither one seems to handle inter-module dependencies (either that or I just can't figure out how to do it). What are people using for proj

Re: Calling from a macro to a private macro

2014-03-17 Thread James Reeves
You can call functions within the macro body without the arguments to the macro being evaluated. If this wasn't the case, you'd be very limited in how you could transform code. - James On 17 March 2014 17:31, Yoav Rubin wrote: > I need to do it, as I need the arguments to remain not evaluated

Re: Calling from a macro to a private macro

2014-03-17 Thread Michael Blume
You don't have the macro generate a call to the private function, you have the macro call the private function directly replace: (defmacro call-self* [x] `(~x ~x)) (defmacro call-self [x] `(do (println "calling form " ~(str x) " with itself") (call-self ~x))) with: (defn- call-sel

Re: Calling from a macro to a private macro

2014-03-17 Thread Yoav Rubin
Thanks - that's just what I needed to know :-) On Tuesday, March 18, 2014 12:40:36 AM UTC+2, tbc++ wrote: > > The problem is in the way lisp compilers work. Example: > > The public macro gets analyzed first and runs, and emits the code required > to call the private macro. Then the compiler analy

Re: Calling from a macro to a private macro

2014-03-17 Thread Timothy Baldridge
The problem is in the way lisp compilers work. Example: The public macro gets analyzed first and runs, and emits the code required to call the private macro. Then the compiler analyzes the output of the first macro and discovers that the code now calls a new macro. It analyzes this code and finds

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Luc Prefontaine
In the "old" days, the principle of locality was prevalent. Most data allocation was static or if not contiguous (the stack). Code was also contiguous being most of the time statically compiled on several pages. Memory was costly, its size remained "reasonable". Today, data is scattered everywher

Re: Calling from a macro to a private macro

2014-03-17 Thread Yoav Rubin
Let's leave aside the recommendations not to do it. I'd like to understand why I get the exception when I make such a call (from a public macro to a private macro), and if it is possible, what am I doing wrong here... On Monday, March 17, 2014 7:40:42 PM UTC+2, tbc++ wrote: > > Don't use private

Re: [GSoC 2014] Looking for mentors: cljs graphics package (in the spirit of p5.js / quil / three.js)

2014-03-17 Thread szx
+1 on moving away from the imperative/java in clojure approach. May be interesting to look at penumbra and elm for inspiration? I'm sure Zach Tellman has/had some thoughts on the subject. Just my 2 cents. On Friday, March 14, 2014 5

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Andy C
>From what I understand, a single core can easily saturate a memory bus. At the same time L2 and L3 caches are so small as compared to GB of memory systems yet growing them does not necessarily help either due to larger latencies. It all limits the number of practical applications which could real

Finding maximum weighted graph matchings

2014-03-17 Thread Laurens Van Houtven
Hi! I'm trying to find a maximum weighted graph matching for a given graph. Searching for this has proven difficult; search engines like to give me results that involve a lot of pattern matching and not a lot of graph matching. I know algorithms for this exist; specifically variants of Edmonds

Re: Calling from a macro to a private macro

2014-03-17 Thread Timothy Baldridge
Don't use private vars. Instead move the macro to a sub namespace called "internals" or "impl" or something like that and make it public. Prefer trusting your users instead of limiting them. my $0.02 Timothy On Mon, Mar 17, 2014 at 11:33 AM, Yoav Rubin wrote: > I'm familiar with that trick, b

Re: Calling from a macro to a private macro

2014-03-17 Thread Yoav Rubin
I'm familiar with that trick, but is it a language feature (and then I can rely on to not being changed in the future)? or is it a hack that based on something that may change in future releases? Thanks, Yoav On Monday, March 17, 2014 4:09:23 PM UTC+2, Maik Schünemann wrote: > > Hi, > I guess

Re: Calling from a macro to a private macro

2014-03-17 Thread Yoav Rubin
I need to do it, as I need the arguments to remain not evaluated until they get to that private macro. That private macro does some work on the arguments before they get evaluated (the arguments themselves are s-expressions). Still, even if it is a private function - how can I call it from a ma

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread Luc Prefontaine
I would say that guidelines can help but curiosity is mandatory. I used to sleep with books on my bedside table about hardware design, operating system internals, io subsystems, networking, ... I did this for 15 years after I started to work with computers. Aside from work related stuff of cour

Re: STM and persistent data structures performance on mutli-core archs

2014-03-17 Thread François Rey
On 16/03/14 18:24, Softaddicts wrote: I think that significant optimizations have to be decided at a higher level. I doubt that any of that can be implemented at the hardware level alone and let it decide on the fly. This sounds like magic, too good to be true. I am also quite convinced that opt

Re: Sharing optional arguments among functions

2014-03-17 Thread Adam Krieg
Thanks, Luc! On Mar 17, 2014, at 11:08 AM, Luc Prefontaine wrote: > Use (apply base-fun opts) > > Luc P. > > >> I'm trying to define a couple of functions that support the same options, >> but return different return types. >> >> I have one function that is the "base" function that provide

Re: Sharing optional arguments among functions

2014-03-17 Thread Luc Prefontaine
Use (apply base-fun opts) Luc P. > I'm trying to define a couple of functions that support the same options, > but return different return types. > > I have one function that is the "base" function that provides the most raw > access, and some other functions that call this base function and

Re: expectations 2.0 has been released

2014-03-17 Thread Jochen
Hi Jay yep, with 2.0.7, everything works just fine now. BTW: I still consider this a very quick response time wich is highly appreciated. Ported all my (thousands of) tests over with no more issues. Ciao ...Jochen -- You received this message because you are subscribed to the Google Gr

Sharing optional arguments among functions

2014-03-17 Thread Adam Krieg
I'm trying to define a couple of functions that support the same options, but return different return types. I have one function that is the "base" function that provides the most raw access, and some other functions that call this base function and do their thing. I would like to make these k

Re: Calling from a macro to a private macro

2014-03-17 Thread James Reeves
Don't use a private macro: use a function that spits out an s-expression. - James On 17 March 2014 06:02, Yoav Rubin wrote: > Hi All, > > I have a namespace that has two macros as part of its public API, and > another macro that act as helpers for the public macro > > (defmacro helper-mac [arg

Re: Calling from a macro to a private macro

2014-03-17 Thread Maik Schünemann
Hi, I guess that maybe the same trick works for calling private functions from another namespace via getting the var and calling it. That being said, macros calling macros gets very complex after a short time, it is better to have helper functions instead of macros. The functions just accept s-expr

Calling from a macro to a private macro

2014-03-17 Thread Yoav Rubin
Hi All, I have a namespace that has two macros as part of its public API, and another macro that act as helpers for the public macro (defmacro helper-mac [arg1 arg2 f] ;; do stuff with f , arg1 and arg2 ) (defmacro m0 [arg1 arg2] (priv-mac arg1 arg2 f1) ) (defmacro m1 [arg1 arg2] ( (priv

Re: fast parallel reduction into hash-set/map

2014-03-17 Thread Jean Niklas L'orange
Hello, On Saturday, March 15, 2014 11:37:11 PM UTC+1, Jules wrote: > > 2. I've had a look at rrb-vector - very fast for catvec - agreed, but > there does appear to be a performance penalty in terms of conj[!]-ing - I > can post my results if you are interested. I read the Bagwell paper on > wh