0:41slashus2: When playing with sorted-map, if you do (rseq (sorted-map :a 5 :b 6)) It is no longer just a sorted-map, it is a sequence. What is the idiomatic way to reverse a sorted-map and keep it a sorted-map after the reverse?

0:44xitam: i guess you use sorted-map-by to create a new map with an opposite comparator

9:07AWizzArd: rhickey: is it possible to make (comment ..) a special operator, with some reader magic, which eliminates it completely from the resulting sources? Currently it can crashes for things like (comment ##) and it evals to nil. So it should not be the last form in a defn/defmacro.

9:08 or maybe a reader macro instead of comment, such as #-(this does not exist)

13:18clojurebot: "([& args]); Like 'require, but also refers to each lib's namespace using clojure.core/refer. Use :use in the ns macro in preference to calling this directly. 'use accepts additional options in libspecs: :exclude, :only, :rename. The arguments and semantics for :exclude, :only, and :rename are the same as those documented for clojure.core/refer."

13:23 it's a fun challenege talking to other programmers. Some have never seen anything outside of C#, some started with Fortran and have seen it all. They all have different expectations and questions based on that experience

13:24 This group came with an open mind, so we had awesome discussions comparing to other languages and in the context of different businesses

13:25technomancy: and now it actually looks like it might be viable on .net

13:28gnuvince: slava: pretty impressive. Are you gonna try with just doubles and ints like the other programs?

13:29shoover`: danlarkin: I will accept that code that uses libs might not be portable across VMs and just be happy that I can use Clojure's lispness, data structures, and concurrency on either VM that I happen to be on at the time

13:30slava: gnuvince: that kind of defeats the point, you may as well use fortran or C if you'll be declaring machine types explicitly

13:31danlarkin: well right now we have this great ecosystem of easy interpolation with any java lib out there. But if the .net port becomes full-featured and active I think there's going to be temptation to only write pure-clojure (or clojure that only interfaces with "native" code in some yet-to-be-defined "safe" way) in the interest of compatibility

13:32slava: gnuvince: if i remove type declarations from the clojure version it runs in 89 seconds :)

13:33 gnuvince: adding a single type coercion to the factor code brings it down to 4.5 seconds. that's about as fast as it will get without low level tricks

13:35danlarkin: I don't want to see, "oh sorry, this is clojure.net code only/java clojure code only" because that sucks... splinters the amount of accessible code... but I also don't want to see "oh I want this code to be cross platform so I won't use any existing non-clojure libs" because that's reinventing the wheel, and what's the point of java/.net interop if we can't use it and expect others to be able to use it

13:38Chouser: but seriously, I think that if someone wants to try to port clojure to whatever VM, there's no real way to stop them. All you can do is deem the port "unofficial", and what does that buy you?

13:42shoover`: danlarkin: or look at it another way... if I can only use .NET I will never contribute any useful Clojure libs you can use. If I'm on ClojureCLR, there's a good chance I'll interface to .NET libraries *and* break out some pure Clojure libs

13:42slava: the compiler should try to infer types where possible, and do runtime dispatch on the remainder

13:46 but you might still want the compiler to specialize a function at different call sites, like C++ templates do

13:46danlarkin: technomancy: but it's different for clojure... take file access for instance. In ruby there's probably a file IO library or whatever, so that can be ported to the JVM so the API is identical. But in clojure the file library is java.io and that isn't going to be ported to .net -- they'll use whatever the file library there is

13:46slava: that's the trick to making dynamic code fast, you clone it and propagate types

13:47leafw: slava: once I wrote a macro to decorate my code with specific types I was interested in -- had to do with processing images made of short[], float[] and double[].

13:49danlarkin: technomancy: but should every class in the standard library be wrapped? and what about cases where functionality is different. I donno... like rich said, the JVM isn't an implementation detail, it is part of the language. ClojureCLR won't be a port, it'll be an entirely different language with strikingly similar syntax and semantics

13:50technomancy: danlarkin: I suspect stuff will get wrapped as people need it; that's usually how these things happen. =)

13:50 personally I'd prefer to use a wrapper for the standard lib stuff, though it's not onerous the way it currently is

13:50rhickey: danlarkin: I think it is more subtle than that - Clojure was designed to be hosted. From the start, it abstracted away JVM/CLR. There will be two levels of libs, those that encapsulate the host and those that expsoe/embrace it

13:51technomancy: yeah, as long as you're explicit upfront about which kind of lib it is, it shouldn't be a problem.

13:51Chouser: I don't expect it will be much work to make contrib portable, and the set of wrappers it provides for itself to use will be a good starting point for other libs.

13:51technomancy: any more than "people are writing code in a language I'm not using" is a problem. =)

14:06rsynnott: (apple have shown some signs that they may allow Sun and Adobe to put Java and Flash on it)

14:06rhickey: People will branch at JVM/.Net at the point they specifically want JVM/.Net, i.e. to satisfy client requirement or leverage existing knowledge/investment in a specific platform. I would recommend people without a specific investment in either use Java, which is why I chose that when I went to one

14:15 but seriously, in practice most of the glue code won't need type declarations there

14:16slava: rsynnott: I'd like to see how well firefox would perform were it written in a JVM language...

14:16technomancy: leafw: actually, thinking about Firefox, it's a great example of non-portable code. since FF is an application written in XUL and JS (spidermonkey), but it would never run if you tried to use it on KJS or opera's JS engine.

14:16slava: rsynnott: the issue is that glue code is uninteresting and easy to write anyway. you want the hairy algorithmic stuff to be high level and maintainable, and not overly inflexible from hand-coded optimization

14:19 so its pretty silly if abstractions run slower than hand-optimized code

14:19rhickey: slava: a lot of people will be running on multicores soon, where some compiler micro-optimization will be dwarfed by the ability to split up the job - i.e. optimization at the level you are suggesting is quickly going to become uninteresting compared with auto-parallelization

14:23hiredman: slava: I don't think anyone is justifying anything except their own use of time.

14:23slava: well, whenever I read clojure advocacy I see claims about the high performance of the JVM. but if you're not going to exploit that, its a bit disingeneous to say that clojure is a lot faster than scripting languages on one hand, but then explain that this is only the case for low-level Java-like code on the other hand

14:23rhickey: because some of this will fall out of enhancements to the HotSpots - they can get rid of ephemeral objects, automatically generate multiple paths etc

14:24 slava: only numerics are slower than Java, Clojure _is_ a lot faster then most scripting languages, and with type hints, as fast as Java on numeric inner loops - that's a lot of range today, even if not all of it is automatic

14:25slava: so the best approach then is to just be honest and focus on Clojure's true strengths: clean semantics, concurrency, JVM integration, etc

14:25rhickey: slava: oh, please - I'm happy to use type declaration to get the fastest perf - that doesn't mean I don'tcare

14:26slava: then you can say that clojure offers performance comaparable to scripting languages, but if you use a Java-like subset, then you can get good performance. that's similar to the situation in CL and many people are happy with that

14:43 slava: only occasionally I'd use clojure as well for low-level -- but it works very well, with type declarations. Is just that immutability is a problem with "areduce", when arrays are gigabyte-long.

14:49 No matter - the background on imagej will be helpful if I end up using it.

14:49leafw: zakwilson: we even added a clojure launcher for fiji: ./fiji --main-class clojure.lang.Repl would do it ... and ./fiji some-script.clj will launch it. All jars into the classpath automatically :)

14:50zakwilson: I'm working on a program for doing things to directories full of images. Currently, I have a greyscale filter and nothing more. My intent is to provide multiple filters, resizing, etc...

14:51rhickey: One of the things that hasn't yet happened, is that people can leverage the low-level stuff inside a macro-package that makes it declaration-free, without any compiler enhancements. i.e. as long as the perf is reachable, some more abstraction can be added via macros

14:51leafw: zakwilson: I'd say all of that is doable with ImageJ rather easily

14:53zakwilson: leafw: Sounds like it. Some time later, I'm going to play with it later. I'm interested in seeing if its greyscale filter is faster than mine.

16:05Bracki: Can duck_streams be considered as the "file utils" package for clojure?

16:06cemerick: rhickey: an NPE is fine, but with some explanation of what's going on would be nice. This is a class of error that is not present in java because javac doesn't allow null to be passed as a primitive arg.

16:06 (modulo whatever happens with "unboxing" a ref to a java.lang.Float, but I've never tried that)

16:10cemerick: hiredman: that NPE is coming out of the Float(String) constructor, as it attempts to parse the null -- the presence of that stack frame makes determining the problem a lot easier than the NPE coming out of clojure-land.

16:12 OK, so in Java, calling a fn that takes a float with a null Float results in a bare NPE as well (I hardly ever use boxed primitives, FWIW).

16:13 I guess the only difference is the stack trace coming out of clojure, not an application source file.

16:14rhickey: cemerick: if your call is in a file you'll get the source line of the failing call in the trace

16:23 you can deref it and get the data, but in order to change the value the ref has, you have to do it inside a transaction

16:24jkantz: an alternative to the evaluation rule for symbols in function position: always look for var in current namespace, if you want the lexical binding in the function position you add quote which is consistent with the way quote strips away the namespace ('lex-fn-name arg1 arg2)

18:18zakwilson: redalastor: I think you're misreading it. You can distribute an app under any license you want, though if your app is a modified version of Clojure itself, you must comply with the terms of the EPL.

18:19 And if you bundle Clojure with your app, you're bound by the EPL, but the EPL only covers Clojure itself; it does not attach itself to code that uses Clojure.

18:30dreish: I think it's pretty clear-cut that a program written in a language is not a derivative work of that language's compiler, but if you aren't comfortable you can always get yourself a lawyer.

18:32redalastor: dreish: Actually, according to the FSF lawyers, it can be if there is code from that language being mixed in.

18:33technomancy: well of course it's possible to make a derivative if you copy code

18:33 that doesn't really have anything to do with the question at hand

19:00 i am currently trying to create a generated list, but stringtemplate expects a class with apropriate fields set to the values it should insert. actually, i have tried to create a proxy defining getter- and setter-methods, but this doesnt work. I also considered gen-class, but i dont really understand it. is there something inverse to (bean ...)?

19:03mmt: technomancy: Is clojure hosted on git-hub now? I was using that SVN checkout

20:19schoppenhauer: weavejester: well, it would be a nice feature to have something like on-the-fly-class-generating (or interface-generating). I mean the "Proxy"-command is very elegant. Having a genclass-command being as elegant as this would be nice.