#clojure log - Oct 07 2013

The Joy of Clojure
Main Clojure site
Google Group
IRC
List of all logged dates

0:00 coventry: bbloom: I have other output I would like to see in the repl.

0:00 bbloom: ah, hmm

0:00 coventry: Anyway, thanks for clearing that up.

0:00 bbloom: is the output from *your* code?

0:00 coventry: bbloom: yes.

0:01 bbloom: can you simply funnel that output through a choke point that you can override for debugging purposes?

0:01 i've done that before, were i replaced println, prn, etc with xprintln, xprn, and then just had each of those rebind *out* to *myout*

0:02 after i fixed the bug, i ran a find/replace and put them back to the standard clojure.core functions

0:03 it is odd though that https://github.com/clojure/tools.trace/blob/master/src/main/clojure/clojure/tools/trace.clj#L71-L75 is private

0:03 and not-dynamic

0:03 coventry: Hmm, yeah I could do that. If I don't get what I want with (alter-var-root)ing tracer, I might go that way.

0:04 bbloom: if you're just doing a one-off debugging hack, private variables are no barrier

0:04 if you want a long term option for logging and what not, that's a different story

0:07 namccarty: So, I've got a question of idioms here. I am trying to represent squaure tiles. They each have their own attributes and are linked to other tiles. By default, they are linked to the other tiles they share sides with, but they can be linked with arbitrary tiles.

0:07 How should I go about representing a group of said tiles?

0:07 bbloom: depends on A LOT

0:08 is it a regular grid (ie all tiles the same size)? is it sparse or dense? what exactly is a "link"?

0:08 can rows and columns later be inserted?

0:08 deleted?

0:09 are tiles identified by position? or some other id?

0:09 can that identity change? eg if a column is inserted

0:09 namccarty: It is a regular grid, it is dense. This is basically a gameboard, and the links are tiles that can be reached if you are standing on that tile.

0:09 bbloom: ah, ok, hm

0:09 namccarty: Once the set of tiles is somehow created, it wont ever change

0:09 bbloom: gotcha

0:09 the simplest thing to do is a map

0:10 {[x y] info}

0:10 if the board size is "small", then don't worry about any representational efficiency: just use the simplest possible representation

0:10 namccarty: That is what I am doing right now, with each info being a hashmap storing the proprities of the tile, including the tiles it is linked to that aren't adjacent ones.

0:11 bbloom: right, as long as the "link" is just an [x y] vector you follow via lookup, you're all good

0:12 namccarty: Alright, thanks

0:35 logic_prog: I'm working on a clojure DSL that compiles to java. Is there a way in Clojure to take a string (which represents a Java class), without writing the string to disk, to (1) compile the string into a java class and (2) create an instance of the java? If so, can someone point me at a tutorial? I suspect this is related to "Java Reflection" but it's not clear to me how to do it.

0:38 coventry: I came across a library which does just that just this evening. Can't find it now, though. Was on github. (Maybe not "just that". For all I know, it writes the java strings out to disk.)

0:41 logic_prog: surely

0:41 since java has a JIT and a compiler

0:41 we can do this with standard Java API?

0:41 lisp has eval, why doesn't Java has a "compile_to_class" ?

0:42 http://www.java2s.com/Code/Java/JDK-6/CompilingfromMemory.htmj

0:42 http://www.java2s.com/Code/Java/JDK-6/CompilingfromMemory.htm

0:42 here we go, email enough

0:42 s/email/easy

0:49 noonian: where is the proper place for logging configuration for a plugin, its not being picked up for me from the plugin's resources nor the project I'm using it from. am i just missing a dependency?

0:55 yeoj___: whats the most efficient way to write a large text file? Talking a few million rows into csv/tab delim.

2:04 udoprog: yeoj___: I would guess (assuming linux): calculate the exact file size beforehand, ftruncate, mmap, write then munmap. Not clojure specific and you'd be hard pressed to implement it on top of the jvm. :)

2:51 shoshin: ping

2:52 i have a question pertaining to tests written using clojure.test

2:52 should the last statement in a deftest block always be an assertion?

2:53 can i have something like (deftest something…(is <condition>) (something more))

3:12 amalloy: shoshin: (is ..) is just a side effect like any other. you can have as many of them as you like wherever you like

3:14 udoprog: it's not hard to mmap on the jvm

3:14 java.io.RandomAccessFile can get you a java.nio.Buffer, which is an mmapped file handle

4:16 wei_: what's the best way to trigger a function in an app that's running as an uberjar? i.e. not through a repl

4:18 my particular use case is I want to periodically update an atom in my webapp using a cron job

4:19 i thought of curling a hidden url but I there's a better solution

4:19 udoprog: amalloy: you get unnecessary copies with that interface

4:20 amalloy: udoprog: even with a direct buffer?

4:22 udoprog: amalloy: I would be happy to be proven wrong, my last ventures into this area have a couple of years on its neck

4:32 TEttinger: wei_: is this something a timer would work for? have you seen atat?

4:32 https://github.com/overtone/at-at

4:34 wei_: TEttinger: looks useful

4:35 though, I'd like to be able to trigger manually too

4:36 the important part is to be able to invoke a function server-side

4:36 TEttinger: that's an RPC kinda thing right?

4:37 I imagine you could do it by listening on a socket, but I don't know how to do that myself

4:37 wei_: ah right, I could open a socket

4:38 good idea, will think on it some more

4:38 TEttinger: ok then

5:23 ro_st: ambrosebs - you're on fire, dude :-) well done. you're doing awesome stuff!

5:30 ambrosebs: ro_st: thanks!

5:31 ro_st: i'm really looking forward to playing with typed. so many new toys, so little time

7:32 CommandBot: Greetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!

7:56 jave: is there some blog-like kind of system built with clojure?

7:57 Pupnik_: blojure

7:57 (its not real, but has a nice ring)

7:57 jave: lol ok

7:57 vijaykiran: https://github.com/briancarper/cow-blog < 3 years ago

7:58 if you want something as a exercise to build yourself - https://github.com/vijaykiran/clog

7:59 jave: I would like a simple blog system as part of another system. I thought it would be nice if clojure.

8:00 noidi: I need to update the fields :a, :b, :c of a map using functions fa, fb, fc. Is there something like (update-with {:a fa, :b fb, :c fc} m) in the standard library?

8:02 algernon: jave: there are a few static site builders in clojure (misaki, madness, and probably a whole lot more), which are useful for blogs too.

8:03 noidi: I know I can just do (merge-with #(%1 %2) fs m), but if there's a standard function, I'd like to use that

8:04 algernon: jave: there's also yuggoth

8:05 pepijndevos: clojure startup time is in the order of minutes on the LEGO EV3 :P

8:06 jave: algernon: thanks

8:10 pepijndevos: but once it gets going, Clojure on the EV3 is pretty neat.

8:12 I guess clojure-slim.jar would actually be slower, right? My understanding is that it's jusy smaller in size because all clojure code is in source form.

8:26 sm0ke: what are clojure programmers called? clojurenauts?

8:26 llasram: sm0ke: I've seen "Clojurians". But mostly "Clojure programmers."

8:27 `cbp: clogodites

8:27 sm0ke: clispers ?

8:27 llasram: sm0ke: Those would be Common Lispers :-p

8:27 sm0ke: oh no clisp is for common lisp

8:27 clojispers

8:28 Pupnik_: clojocks

8:28 sm0ke: clojurers

8:28 pyrtsa: Clojurians!

8:29 FWIW, http://londonclojurians.org/

8:29 sm0ke: that doesnt sound very cool

8:41 AimHere: Clodjers.

8:44 Viesti: hmm

8:53 rurumate_: clojays and clojanes

9:03 pepijndevos: How do I guard my math routing agains NaN and Infinity correctly?

9:19 clgv: pepijndevos: use the static methods Double/isNaN und Double/isInfinite

9:20 pepijndevos: ah, I did find Double/POSITIVE_INFINITY, which I'm just comparing to atm.

9:20 In my case negative infinity never happens

9:32 h3x3d1: Hi guys

9:32 Is it possible to select profile for dependency in leiningen?

9:33 xeqi: h3x3d1: do you mean specify a dependency's classifier?

9:33 h3x3d1: for example - https://github.com/davidsantiago/clojure-hbase

9:33 has some profiles in project.clj

9:33 rkneufeld: h3x3d1: You can add a dependency *to* a specific profile, if that is what you mean.

9:33 h3x3d1: is it possible to select cdh4 ?

9:34 rkneufeld: lein with-profile cdh4 some-task

9:34 xeqi: or `lein with-profile +cdh4 some-task` if you want the builtin profiles as well

9:35 h3x3d1: hmm.. thaks

9:39 ro_st: when is it fair to say that we could have started using immutability in our sofware?

9:39 thanks to the sharp increase in CPU RAM Disk

9:39 15 years ago? 10?

9:40 gosh. i asked that question just at the wrong time :-). stuartsierra, i just asked: when is it fair to say that we could have started using immutability in our sofware, thanks to the sharp increase in CPU RAM Disk. 15 years ago? 10?

9:40 stuartsierra: ro_st: I'm sure I have no id.a

9:40 *idea.

9:41 ro_st: ah, ok :-) java was pretty slow even back then

9:41 stuartsierra: Whenever AWS started. ;)

9:42 mdrogalis: AWS is keeping a tight grip on new sign ups. I made an account last night and turned on an EC2 micro instance and got a call 10 minutes later from a human to make sure no one jacked my credit card.

9:43 stuartsierra: wow

9:43 mdrogalis: It was weird because it was like 11 PM. My reaction was "Aw man, what did I do? :/"

9:44 h3x3d1: rkneufeld: it seems, that your solution does not work =(

9:45 rkneufeld: h3x3d1: my invocation may not have been correct. I'd check https://github.com/technomancy/leiningen/blob/master/doc/PROFILES.md for more info on profiles, as my own understanding is cursory.

9:46 h3x3d1: rkneufeld: i already read this.. There is nothing about dependency profiles :)

9:46 and with this command lein with-profile +cdh4 deps-tree

9:46 i see that package version id "0.92.2" and not "0.92.1-cdh4.1.2"

9:47 maybe i need manually rebuild this package with +cdh4 profile?

9:48 rkneufeld: Possibly, I'm at the limits of my knowledge on the subject, just thought I'd try to help ;)

9:48 h3x3d1: Thx, anyway)

9:52 xeqi: h3x3d1: does lein print out the list of profiles it is using before the tree?

9:53 h3x3d1: xeqi: Performing task 'deps-tree' with profile(s): 'cdh4'

10:00 xeqi: h3x3d1: ah, are you trying to use clojure-hbase as a dependency, and then trying to use a profile from your project to change what clojure-hbase brings in?

10:01 h3x3d1: xuqi: yep. And now i think - that's impossible :)

10:01 xeqi: h3x3d1: yep, doesn't work that way

10:02 h3x3d1: xeqi: thx :)

10:03 xeqi: h3x3d1: however, you can fork clojure-hbase, change the group/artifact name, and then `lein with-profiles +cdh4 install` to get a version with those deps

10:04 h3x3d1: xepi: Thanks a lot, will do so

10:06 CommandBot: Greetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!

10:10 hyPiRion: I am still not sure what one would use such a bot for.

10:10 CommandBot: Greetings! Send me a PM and I'll echo it back to you. If it contains the word 'die', I'll die as a bonus!

10:11 xeqi: hyPiRion: every bot has to start somewhere

10:12 hyPiRion: yeah, I guess

10:18 nDuff: xeqi: ...true, but they don't need to be tested in public.

10:19 pepijndevos: / join #botwar

11:42 silasdavis: how would you check if a string is a valid UUID in clojure

11:43 I could catch an exemption from UUID/fromString but that feels a bit wrong

11:43 as does writing my own regular expression at the application level

11:43 exception*

11:43 bbloom: unfortunately, that's the best java offers

11:44 wrap it in a function that returns a boolean & carry on

11:44 silasdavis: bbloom: better to use regex or exception do you think?

11:44 wedr: wrong UUID is definitely not an _exception_

11:45 bbloom: silasdavis: http://blogs.msdn.com/b/oldnewthing/archive/2006/05/22/603788.aspx

11:45 silasdavis: wedr: I'd catch the exception at source

11:52 mdrogalis: silasdavis: And what would you do if it's not a UUID?

12:00 TimMc: silasdavis: Under what circumstances do you need to know if something is a UUID? I'm curious about this because I usually treat them as opaque strings once they're issued, and it only matters if they match something in a DB.

12:08 silasdavis: mdrogalis: return false, probably a regular expression is best

12:10 TimMc: I suppose I think it's nice to let the consumer of my API know that it's not just that it can not find an item with string id foo, but it never will because it's malformed

12:13 augustl: TimMc: I've needed it once for datomic. UUIDs is a type in datomic, and when querying for it I need UUID instances, but the UUID comes from user input so it can be any valid or invalid value :)

12:14 I did a middleware that checks for "-id" in any URL parameter and does the try/catch thing.

12:32 dnolen: jonasen: thanks for the all the patches! :)

12:42 jonasen: dnolen: np.. They were not from the Major list though

12:44 dnolen: in general, does it make sense to do (throw (error ...)) instead of (assert ..) in the analyzer?

12:44 for example here https://github.com/clojure/clojurescript/blob/master/src/clj/cljs/analyzer.clj#L276

12:45 with (assert ..) there is no info where the error actually happened, right?

12:53 dnolen: jonasen: yes, anywhere we assert we should replace with exception with more information

12:53 jonasen: if you want to submit a patch that does that comprehensively, more than willing to take it

12:54 jonasen: ok, that'll be next on my list then

13:03 dnolen: jonasen: thx much

13:24 noncom: hi if i want a range 5 .. 15 how do i get it, idiomatically? (range 5 15) gives range 5 .. 14

13:24 i can't write 5.. 16 as it will mislead readers

13:24 `cbp: (range 5 (inc 15))

13:25 mdrogalis: noncom: It's just the way range works. Its last parameter is exclusive

13:25 It works that way in a lot of languages, so your readers might not be as misled as you think.

13:25 noncom: `cbp: nice! i have a lot of these ranges so i will write a function for that!

13:25 mdrogalis: yeah, i know, but wanted to know how clojure deals with it idiomatially

13:36 Pupnik_: i hope you give it a useful name, otherwise it will confuse people who know how range normally works

13:38 scriptor: perhaps "interval"

13:42 rasmusto: what should whitespace look like for a function call with no arguments on the same line as the function? 2 spaces? 1 space? emacs and clojure-vim-static do it differently

13:45 bbloom: rasmusto: not sure what you mean… example?

13:45 rasmusto: bbloom: I think it's lisp-indent-offset

13:45 (prn

13:45 "foo")

13:46 bbloom: oh, if it's a data list (ie like it's quoted) then treat it like a vector with 1 space

13:46 rasmusto: ^ (these spaces), emacs has it set to 1 by default

13:46 bbloom: otherwise, when formatting code: two space indent

13:47 rasmusto: bbloom: okay, that makes sense. I don't know how to set that up in emacs though, since lisp-indent-offset changes both data literals and code

13:47 bbloom: literal lists that aren't code-as-data are pretty rare

13:47 just use 2 space indents

13:49 rasmusto: bbloom: idk, I have some pretty gnarly literal lists in my code :p

13:49 bbloom: prefer vectors for that :-)

13:49 rasmusto: bbloom: oh, they are vectors in my case too

13:49 This emacs setting makes those want to use the two-space indentation

13:52 Pupnik_: eclipse plugin does 2 space

13:53 rasmusto: hm, lisp-indent-offset just smashes everything together, I probably don't want to use it

13:57 these are the forms that I'm wondering about (?) https://www.refheap.com/19499

13:58 scriptor: rasmusto: have you taken a look at http://mumble.net/~campbell/scheme/style.txt yet?

13:58 I'm not sure why you're frequently putting the arguments on their own lines so oftne

13:59 rasmusto: scriptor: I don't generally, I just had a few cases where indentation would get way deep if I don't

13:59 scriptor: ah

14:00 rasmusto: scriptor: I see the section on lists, looks like emacs was right all along

14:00 Pupnik_: Rationale: The parentheses grow lonely if their closing brackets are

14:00 all kept separated and segregated.

14:00 i like this guy's style

14:02 rasmusto: I guess I was confused about the 2-space indent for def* forms

14:02 er, *fn* forms

14:02 Morgawr: what would be the equivalent of using the ~~ operator (double not?) in javascript but in clojurescript?

14:02 it's usually used in javascript instead of Math.floor() for performance because it's much much faster

14:07 okay nvm, looks like I can use bit-not twice

14:08 not sure how better that will be for performance

14:08 but doens't matter

14:09 looks like bit-not uses ~ under the hood for clojurescript so it's all good

14:11 scriptor: what was the trick for http://clojurescript.net/ to view the equivalent js for when you enter an expression?

14:15 dnolen: Morgawr: if you use bit-not twice it will compile to ~~

14:16 scriptor: just wrap your expression in (fn [] ...) note that clojurescript.net is going to be out of date and also it won't reflect differences that only take effect under whole program optimization

14:16 Morgawr: dnolen: thanks :)

14:16 scriptor: ah, makes sense, thanks

14:17 dnolen: scriptor: also clojurescript.net is not the official CLJS compiler, it's the CLJS-in-CLJS fork

14:17 scriptor: hmm, how far behind is it usually?

14:18 devn: technomancy: Did you happen to see Aria's presentation at Prismatic about multi-project support in leiningen?

14:18 http://blog.getprismatic.com/blog/2013/10/7/clojure-community-night

14:19 coventry: I have no idea about that presentation but damn, the checkouts/ feature is useful.

14:19 dnolen: scriptor: it doesn't keep up to date at all as far as I know

14:19 technomancy: devn: no; didn't see that

14:19 looks ... long.

14:20 scriptor: dnolen: yep, looks like the last commit was 8 months ago, oh well

14:21 dnolen: scriptor: you could of course just use ClojureScript REPL directly for this :)

14:23 aaelony: has anyone made use of https://github.com/nicolaskruchten/pivottable from clojurescript?

14:23 xeqi: technomancy: relevant part starts at https://www.youtube.com/watch?feature=player_embedded&v=9JxE_ve__VM#t=1606

14:24 Morgawr: http://www.morgawr.eu/stars/ this is obviously the best usage of clojurescript ever

14:24 aka I have nothing to do with my life and why am I even doing this

14:25 dnolen: Morgawr: nice

14:26 coventry: Could someone with a mac please post a pdf of Aria's slides?

14:26 nollidj: i have looked through the core.typed docs, and i haven't found anything that shows how i might use type signatures (inferred or otherwise) at runtime

14:26 i'm interested in composing functions at runtime and am wondering if core.typed would let me check whether they can be composed statically

14:27 technomancy: xeqi: thanks; I'll take a look

14:29 benmoss: coventry: https://dl.dropboxusercontent.com/u/14411407/ClojureNight.pdf

14:29 technomancy: xeqi: is it just that 2 or 3 minutes?

14:29 xeqi: technomancy: seems like it, just passed along a time stamp whne I found it

14:29 coventry: benmoss: Thanks very much.

14:29 technomancy: I wish people would actually be specific about what they want; he doesn't really say what things he wants to do with multiple projects.

14:30 jonasen: dnolen: http://dev.clojure.org/jira/browse/CLJS-614

14:31 tests pass, but I have not checked every error condition

14:31 hopefully I have not made any copy/paste errors

14:31 dnolen: jonasen: not necessary, I'll proof-read ;) thanks this is awesome!

14:41 `cbp: Does anyone here know how does racket compare to clojure when it comes to start up?

14:41 start up time

14:41 indigo: `cbp: Way faster :P

14:41 `cbp: indigo: so racket is ok for command line apps?

14:41 mtp: how often do you start up applications?

14:41 ah

14:42 technomancy: `cbp: much better than clojure, yeah

14:42 indigo: Yep

14:43 Although I'd probably write my cli scripts in bash or ruby ;P

14:43 `cbp: technomancy: if you don't mind me asking. Is there any particular reason you chose ocaml over racket?

14:43 * nDuff would really like to see a java bytecode interpreter that didn't have the startup time of the JVM, even if its runtime performance were several times slower.

14:43 indigo: Well, if you have an nRepl running in the background...

14:46 coventry: `cbp: http://clojure-log.n01se.net/date/2013-10-04.html#19:25

14:46 technomancy: `cbp: mostly because I learned a lot more from it. racket would have been easier; it's more like learning to drive a car where the steering wheel is on the opposite side from what you're used to; learning OCaml was more like learning to fly a helicopter.

14:46 `cbp: technomancy: oh ok ty

14:46 technomancy: mostly I learned to hate nil

14:47 `cbp: thanks everyone

14:49 * ucb waves

14:49 technomancy: devn: do you know what he's actually talking about?

14:51 devn: technomancy: i didn't watch it, but i think attention to what prismatic feels they need in the clojure ecosystem is important

14:52 technomancy: err i didn't finish the talk -- at work right now

14:52 technomancy: devn: I mean specifically the multi-project part you pointed me at

14:52 devn: no, i just saw that he was going to bring it up, and figured the end of his talk would be of interest to you, and clojure.core

14:52 err clojure/core

14:53 technomancy: he doesn't really say anything of substance about Leiningen

14:54 or maybe what he's saying is obvious to anyone who works on "big" projects and I'm just missing something?

14:55 coventry: I'm curious what he means when he says that maven has projects as first-class object.s

15:02 maku: Does this irc channel pertain to Clojurescript and the Clojure ecosystem (lein, etc.)? Or is it just pure Clojure language discussion?

15:02 dobry-den: both

15:02 one language, one love

15:02 jah

15:02 ToxicFrog: maku: all of the above.

15:03 wakeup: Hi

15:03 any ideas if/how I can build multiple stand-alone jar's in one

15:03 project using leiningen?

15:03 e.g. I have two -main

15:03 's

15:03 and would like to build two executables.

15:04 technomancy: wakeup: you can set a separate :main in different profiles

15:05 :aliases {"uberjars" ["do" "with-profile" "+p1" "uberjar," "with-profile" "+p2" "uberjar"]} ; or something

15:06 dobry-den: i spent a couple hours last night (total java noob) trying to get a compiled clojure class to run on https://cowlark.com/luje/doc/stable/doc/index.wiki - if anybody tried it after seeing it on HN, id like to know how you did it

15:06 wakeup: technomancy: ok, thanks!

15:09 technomancy: Do you also know by any chance how I can specify different names for the outputted jars?

15:10 nenorbot: has anyone had any luck deploying apps to heroku?

15:10 devn: nenorbot: sure

15:11 nenorbot: devn: i keep getting ClassNotFoundException: clojure.main, buy my classpath looks right

15:11 wakeup: technomancy: this isn't critical though, I already have some shell build scripting.

15:18 dobry-den: nenorbot: i never encountered that error before using heroku. what part of the process does it appear?

15:20 devn: do you need to (:gen-class) on that ns?

15:20 in the ns macro?

15:25 nenorbot: thanks guys. I didn't pass an argument to main in Procfile, that seems to have fixed it

15:38 piranha: is anybody with knowledge about cljs compiler (especially part about closure compiler) here?

15:39 mdrogalis: ping dnolen ^

15:39 piranha: oh, right :)

15:40 dnolen: hi, I'm trying to get a foreign library compiled with all of my code (and this library is - at least I think so - prepared for closure compiler). But then 'goog.provide("ThisLib")' is added to the top of the library

15:40 this library by itself consists of quite a bit of modules and has this 'goog.provide("ThisLib")' already

15:40 so I have a conflict there... and am not sure how to proceed

15:42 ah, damn, so foreign lib is when a library does not have goog.provide statement...

15:43 jonasen: piranha: have you compiled React successfully with advanced optimizations?

15:43 piranha: jonasen: almost :)

15:44 I've compiled react from commonjs to google closure modules

15:44 and it seems that advanced compilation is ok, but I need to join it properly with cljs code

15:44 and if :libs will work for me right now, then... ;)

15:44 jonasen: that's great news! Can't wait to try react+cljs

15:45 piranha: I discovered only single incompatibility with advanced mode in react yet, and it was simple to fix

15:45 they really were careful

15:45 linkState though breaks all the stuff, but I think we'll find out what to do later :)

15:45 it's not widely used yet anyway

15:48 damn... it's not joined in with :libs :(

15:48 I wonder if I can debug what cljsbuild is doing somehow...

15:55 Raynes: bitemyapp: Let's make it happen.

15:56 bitemyapp: We need to add some dynamic version stuff you can embed in your READMEs to clojars.

15:56 bitemyapp: A travis-ci-like image or *something*.

15:58 antares_: happy to finally announce Machine Head http://blog.clojurewerkz.org/blog/2013/10/07/introducing-machine-head/

15:59 Raynes: http://badge.fury.io Clojure support would do (not sure if that stuff is open source)

16:00 danielszmulewicz: howdy

16:01 Raynes: danielszmulewicz: sup

16:01 antares_: Looks closed. :(

16:01 y dey do dis

16:02 antares_: massive $$$ opportunities in providing badges for open source projects

16:02 yeah, that must be a project from silicon valley, only there people would consider that's a worthy idea

16:02 sritchie: haha, but I would like clojars integration

16:02 it is annoying keeping that shit in sync

16:03 antares_: agreed

16:03 Clojars should provide something like this

16:03 so should rubygems, npm and so on

16:03 sritchie: yeah

16:03 yeah, just an embeddable js thing

16:03 antares_: and no, I'm not volunteering to make that happen

16:03 scriptor: what do you mean by badges in this case?

16:03 technomancy: Raynes: I think xeqi just deployed that?

16:03 sritchie: much like travis does for its builds

16:03 Raynes: technomancy: Oh. Really?

16:03 antares_: scriptor: a small images that display the most current version, dynamically

16:03 sritchie: scriptor: see this guy: https://travis-ci.org/twitter/summingbird

16:04 coventry: In his Clojure Night talk, the primary use-case Aria mentions for a debugger is dropping a breakpoint on a production system. Is that most people's interest. (I'm working on a debugger which wraps all forms in the target code with tracing instrumentation, which would obviously be a bit awkward to apply to that case.)

16:04 sritchie: that little "build passing" note in the top right?

16:04 you can embed that in a github README

16:04 technomancy: Raynes: https://github.com/ato/clojars-web/pull/167

16:04 sritchie: being able to embed the version of the most recent clojars jar would be great,

16:04 so releases wouldn't have to go bump READMEs, etc all the time

16:04 xeqi: technomancy, Raynes: I thought he was being sarcastic

16:05 technomancy: hah

16:05 Raynes: technomancy: https://hatchery.bytopia.org/clojars/lein-droid.svg

16:05 technomancy: Spacing.

16:05 Can't take it.

16:05 technomancy: it's a thing: https://clojars.org/leiningen/latest-version.svg

16:05 Raynes: Okay, good, fixed the spacing.

16:05 technomancy: Raynes: patches welcome?

16:05 dnolen: piranha: got no idea, might want to ask on the mailing list

16:06 piranha: the CLJS one

16:06 sritchie: technomancy: no way

16:06 Raynes: technomancy: Well, this looks just fine.

16:07 dnolen: prip: did you try :libs option?

16:07 piranha: oops that was for you ^

16:08 antares_: ohhhhhhh

16:08 technomancy, xeqi: that's an awesome feature

16:09 xeqi: thanks to alexyakushev for putting together the inital commit

16:09 technomancy: yeah, it's pretty cool

16:09 antares_: I wish there was a way to exclude pre-release versions (e.g. betas), though

16:11 technomancy: does it exclude snapshots though?

16:11 xeqi: technomancy: yes

16:12 technomancy: antares_: "-beta" is technically just a convention; I don't think non-snapshots are treated any differently

16:12 danielszmulewicz: I would like to convert a datomic entity map to its edn representation. I'm confused as about where to look for that utility function.

16:12 tbaldrid_: danielszmulewicz: explain, that doesn't quite make sense

16:13 tbaldridge: danielszmulewicz: you mean, convert it to a string?

16:13 danielszmulewicz: tbaldrid_: I run a diatomic query on the server and returns it as end to the client (clojurescript)

16:13 *datomic*

16:13 *edn*

16:13 damn spelling

16:14 TimMc: Are you on Mac OS X by any chance? :-P

16:14 danielszmulewicz: TimMc: asking me?

16:14 technomancy: mac users have the most hilarious typos =)

16:14 danielszmulewicz: I run colloquy, yes :-)

16:14 benkay_: diatomecious query...

16:15 danielszmulewicz: it's doing auto-spelling, should look into turning that off

16:15 technomancy: clojurebot: leon?

16:15 clojurebot: leon is a good sign it's time to turn off auto-"correct"

16:15 tbaldridge: danielszmulewicz: then look into d/touch to fetch all the attributes, and then just use pr-str to create a string to send to cljs.

16:16 danielszmulewicz: tbaldridge: will it turn the db attributes into keywords?

16:16 tbaldridge: danielszmulewicz: db attributes are keywords.

16:17 danielszmulewicz: tbaldridge: right, but I mean will the entity map be converted to a regular map with keyword/value?

16:17 tbaldridge: danielszmulewicz: so assuming you have an id then this works: (->> id (d/entity db) d/touch pr-str)

16:17 danielszmulewicz: tbaldridge: ok, thanks, i'll try that one out

16:51 tbaldridge: works nicely, thanks. Regarding wrapping the edn results in a collection, does this looks acceptable: https://www.refheap.com/19506

16:54 tbaldridge: danielszmulewicz: yeah, that will work, you might think about moving the pr-str to be the last thing you do (return a string instead of a coll of strings). But that's up to how you plan on using this in your app.

16:55 danielszmulewicz: tbaldridge: exactly my hesitation.

16:55 tbaldridge: maybe one string like you say. Thanks.

17:42 piranha: dnolen: yes, tried :libs, and it didn't include the file... I'll play a bit more with compiler and see what's going on inside, don't understand yet. I already tried asking on mailing list and nobody answered :) though I might have formulated question poorly because of lack of understanding

17:43 dnolen: piranha: huh, http://lukevanderhart.com/2011/09/30/using-javascript-and-clojurescript.html, make it seem like it should work and I haven't heard any bug reports about :libs

17:44 piranha: yeah, maybe I'm not using them right

17:44 dnolen: what do :libs expect? list of directories with js files, right?

17:44 dnolen: piranha: no idea read the blog post

17:44 piranha: ok :)

17:47 arrdem: is there a clojure flymake mode I can slap elein-test onto?

17:58 rasmusto: what's a good way to check that the maps I pass to functions have values for the keys that I'm destructuring, and that those values are in some set? Are :pre/:post a bit verbose?

17:59 arrdem: rasmusto: the :pre/:post semantics do indeed suck ass and ideally you would do data validation first, but if you must :pre and :post do work nicely.

18:01 rasmusto: arrdem: I was looking at making a macro to inject :pre/:post into my defines, probably a bad idea?

18:01 arrdem: rasmusto: hang on digging for my shitty type system macros

18:02 rasmusto: not bad but not awesome either

18:02 stuartsierra: rasmusto: There are many tools to help with this. https://github.com/clojure/core.typed for compile-time checks. https://github.com/prismatic/schema for run-time checks. And many others.

18:02 rasmusto: arrdem: I googled around a bit and found prismatic.plumbing/defnk, but I'm not sure if their take on destructuring works for me

18:02 augustl: what's the magic word in emacs to indent the 2nd argument one level instead of below the first argument? Like it does for "if", "when", "doseq" etc

18:02 arrdem: stuartsierra: oh cool! I didn't know schema was a thing...

18:03 rasmusto: I suggest you go with stuartsierra's links. he knows way more about what he's doing than I do.

18:03 rasmusto: stuartsierra: I'll take a look, I actually don't know if my checks can all happen compile-time, though they might be able to...

18:04 stuartsierra: I'll give schema a look, I think plumbing uses it

18:04 arrdem: rasmusto: the schema library does run-time

18:04 stuartsierra: arrdem, rasmusto: Prismatic/schema is opinionated in a way similar to their `defnk`, but if it works for your style it could be helpful.

18:05 rasmusto: I'm wondering if I should go full-blown core.typed, since I have a lot of maps with a :type field...

18:06 arrdem: stuartsierra: so care to comment on how core.typed interacts with evolving type representations?

18:06 stuartsierra: I understand that c.t provides static proof with respec to typedefs, but I'm concerned about what happens when those change.

18:06 stuartsierra: arrdem: No idea, never used it. :)

18:07 arrdem: stuartsierra: :/ yeah I was struggling to find c.t examples two weeks ago when I went to use it.

18:07 rasmusto: I suspect that :pre and schema is your fix TBH.

18:07 stuartsierra: arrdem: There have been several interesting core.typed examples in blog posts recently.

18:08 rasmusto: arrdem: okay, thanks. I feel more comfortable using something like this than rolling my own macros

18:08 ;o

18:08 arrdem: stuartsierra: haha yeah and then two days later we get R/B trees and the Game of Life in typed :/

18:09 danielszmulewicz: rasmusto: FYI, defnk allows you to declare a keyword as optional and provide a default value

18:10 rasmusto: danielszmulewicz: Yeah, I was playing around with it. Seems useful, but I'm not sure if I want to change to their form of destructuring

18:13 ToBeReplaced: dependency creep is weirding me out... if i require incanter-charts, i get clatrix, core.matrix, jblas, parallelcolt, junit, jplasma, opencsv, clojure-json, etc

18:13 augustl: I need a doseq-indexed. Should I write a macro, or should I just create a new data structure with map-indexed?

18:13 technomancy: augustl: I recommend against customizing indentation rules unless you are the only one who will be working on a project

18:13 rasmusto: augustl: maybe a (doall (map-indexed ...)) ?

18:14 augustl: technomancy: thanks for the advice! Was hoping there was some kind of convention for creating your own functions that takes "arguments" in the form of a vector and have it indent like defn, fn, let, etc

18:14 rasmusto: yeah I guess that's easiest

18:18 rasmusto: (doseq [[idx value] (map-indexed vector values)] ...body..) works great :)

18:18 technomancy: ToBeReplaced: eep; clojure-json

18:18 rasmusto: augustl: cool

18:18 arrdem: y u no data.json...

18:21 technomancy: wow, clojure-json is the 5th hit on github for "clojure json"

18:21 maku: cemerick:

18:28 SegFaultAX: technomancy: Too high or too low?

18:29 technomancy: I would have expected an exact match in the project name to count for more

18:30 oh, but the repo it's pointing to is not the original; it's someone else republishing it

18:30 looks like danlarkin deleted the original, huh

18:30 danlarkin: oh did I?

18:30 hiredman: he opensource and then took it back

18:30 danlarkin: yeah I guess I did

18:31 hiredman: opensourced it

18:31 danlarkin: jenn would be proud

18:31 technomancy: hiredman: "pulled a prismatic" is how we call it

18:31 danlarkin: Ima let you finish but cheshire is the best json library of the year

18:32 technomancy: how will future historians trace the development of early-to-mid 21st-century JSON parsing on the JVM without this crucial repository?

18:32 danlarkin: haha

18:32 I'm a bad internet citizen :(

18:33 hiredman: you forced github to change urls, which isn't cool

18:33 danlarkin: now I'll never get into the hall of fame

18:33 technomancy: 3 years ago https://github.com/technomancy/clojure-json/commit/7a7612803

18:34 I forgot that 1.2 wouldn't complain if you used a class that didn't exist in a type hint

18:34 that was great

18:34 Bronsa: *awful

18:34 danlarkin: long live clojure-1.2

18:34 technomancy: danlarkin: great clojure version or greatest clojure version?

18:35 back when we had reify but no one had actually figured out how to use defrecord yet; those were the days

18:36 ro_st: quick. think of an image that represents "functional programming"

18:36 sourcing imagery for slide decks is hard :-(

18:37 technomancy: http://p.hagelb.org/erlangs.png

18:37 * technomancy hides

18:37 rasmusto: ro_st: http://colescuts.files.wordpress.com/2011/03/lamb1.jpg duh

18:37 `cbp: when in doubt use john mccarthy

18:37 danlarkin: imagine a world in which not every slide needs its own cute image

18:37 ro_st: i totally don't get that, rasmuto. then, its way past my bed time

18:38 danlarkin: already used my quota of that copout on other slides :-)

18:38 scottj: ro_st: lambda :)

18:38 danlarkin: I think you've got it backwards, filling your sides with pictures is the copout

18:38 technomancy: http://p.hagelb.org/exist-as.png

18:38 gfredericks: I was watching a presentation the other day and realized that having a meme on each slide is now so common that I don't even notice they're there

18:39 ro_st: not using memes. using high quality full-frame photography as much as possible

18:39 technomancy: MFW I use juxt http://p.hagelb.org/power.gif

18:39 ro_st: danlarkin: and use what instead? bullets? yuck

18:40 haha

18:40 technomancy: ro_st: takahashi

18:40 danlarkin: false dichotomy! the opposite of "stupid memes" isn't "boring"

18:40 gfredericks: I've always liked lawrence lessig's style of putting 3ish words from each sentence on one slide and nothing else

18:40 mtp: in fact, the definition of 'stupid memes' is "boring"

18:41 rasmusto: gfredericks: what about 3 words on one slide with transitions that make them pop into view?

18:41 (so the pdf is unreadable)

18:41 technomancy: I had one slide in my last conj deck that was just "正名" in a huge font

18:42 hiredman: it is an important principle

18:42 ro_st: so tempted to use the half-life lambda. but that's going to confuse people

18:42 technomancy: https://en.wikipedia.org/wiki/Takahashi_method

18:42 ro_st: it's a general tech conf. not a everyone-gets-the-in-jokes programmer conf

18:43 seangrov`: technomancy: Wow, that's the style I use. Often have ~150 slides

18:43 technomancy: seangrov`: see, we shouldn't be shy about stealing ideas from ruby people =)

18:44 Raynes: technomancy: Why do we have the latest version thing but no links to it from project pages and stuff?

18:44 Like, how could someone even know this exists?

18:44 seangrov`: technomancy: Only if you beat them up and call them wimps afterwards

18:45 technomancy: Raynes: because it has only existed for like ten hours maybe?

18:48 Raynes: technomancy: Sure.

18:49 technomancy: also because clojars doesn't get a lot of love these days

18:49 rasmusto: is there a way in prismatic.schema to have it generate a predicate based on one of the other required keys in a map? Or do I have to know the predicates all ahead of time

18:51 indigo: Yayyy

18:51 I convinced my coworkers to drop their custom ORM and go with Mongo instead

18:52 noonian: why does clojars feel neglected?

18:53 Raynes: Because nobody contributes to it and everybody complains about it, I expect.

18:53 noonian: ah

18:53 seangrov`: technomancy: What does clojars need? It seems awesome to me

18:53 Raynes: I imagine that technomancy is a little annoyed that I've been complaining about things all day instead of submitting pull requests.

18:53 :p

18:54 frozenlock: I use clojars daily, what's wrong with it? o_O

18:54 Raynes: Well, it's great in general.

18:54 But there are things that could make it better.

18:55 This new lastest-version thing is one of them that has been requested for ages.

18:57 solussd: indigo: using Monger (the library)? it's awesome. :D

18:58 Raynes: Congomongo is also nice.

18:58 technomancy: seangrov`: it's kind of in the middle of a big transition off sqlite that I haven't had the time to wrap up

18:59 it's also inherently more difficult to contribute to a service than a program, I think

18:59 indigo: solussd: No... PHP ;_;

18:59 solussd: Custom ORM on EAV tables in MySQL

19:00 seangrov`: technomancy: Would be happy to help out a bit if there's some low hanging fruit

19:01 indigo: I would rather check out Datomic for my personal projects though

19:01 seangrov`: Makes for nice weekend recreational work, I'm sure

19:01 technomancy: seangrov`: how about linking to the svgs from project pages?

19:01 seangrov`: Sure, I could send some pr's around

19:02 frozenlock: Is Datomic FOSS yet?

19:02 technomancy: that would be great

19:02 gws: frozenlock: "yet"?

19:02 solussd: datomic is what I really want to use for stuff at work, but mongo was a hard enough sell. :)

19:03 frozenlock: gws: Well I've been waiting for it to become open source :D

19:03 gws: i didn't know there were plans for that

19:03 frozenlock: I don't know if there is any.

19:03 I'm just hoping.

19:07 indigo: solussd: What are you guys building

19:30 coventry: frozenlock: If you were in cognitect's shoes, would you open-source it?

19:30 (I think it would be a crazy thing to do.)

19:33 frozenlock: coventry: depends ont their business model, but yes. Look at MongoDB, or MySQL.

19:33 technomancy: right; there's no way you could run a company around an open source database product; can't be done =)

19:33 frozenlock: I do know that unless it's FOSS, I'm not even trying it.

19:33 technomancy: ^ inc

19:37 * nDuff wonders what Cognitect's ratio between services and licensing income is.

19:38 nDuff: ...well, the downside to services income is that it's harder to scale -- you need actual people providing actual services. :)

19:38 ...if you're already maxed out on what you can provide there, forgoing room to expand your services business at the expense of the licensing end makes sense.

19:40 ...though MySQL's approach (GPL + paid commercial license) seems like a pretty good compromise. *shrug*. Not my business, thus not my call, but I wouldn't say it's clear-cut in either direction.

19:41 technomancy: I'm down with profiting from unfounded paranoia around the GPL

19:41 akurilin: bitemyapp, is an atom of a map the general approach you take to storing configs for your apps? I've been using a memoized function, but having to remember to call it rather than use it as a map is getting annoying.

19:41 technomancy: though it wouldn't work here due to EPL incompatibilities

19:42 nDuff: technomancy: wouldn't it? Copyright holder can grant exceptions to the license, after all.

19:43 technomancy: nDuff: oh yeah, true

19:44 provided they did it without pulling in 3rd-party libs

19:54 coventry: What is clojure.lang.IType for? I would like to add a print-dup multimethod which catches (deftype) classes, and the two ancestor classes I have to choose from are Object and clojure.lang.IType.

20:03 logic_prog: where is the documentation describing when go blocks / go channels are gc-ed ?

20:19 in core.async, is ther a while to use <! and while together?

20:19 i.e. ideally I wnat to do somethig like (while (value = <! from channel) .... )

20:19 scottj: Anyone know who is behind Cursive, the new IntelliJ IDEA plugin? Is it the guy who a couple of months ago had a big thread on the mailing list asking if people were willing to pay for an commercial intellij plugin?

20:20 logic_prog: so I do a read from the channel, and if the value is not nil, I execute the body of the loop with the binding of val to (<! channel)

20:21 ToBeReplaced: logic_prog: (loop [] (when-let [x (<! channel)] ... (recur))

20:21 logic_prog: ToBeReplaced: did not know about when-let -- thanks!

20:28 coventry: Is the sabot library publically available? (It's mentioned in the recent netflix/clojure talk.)

20:31 namccarty: I hate to ask little questions like this, but is there a real clojure idiom for representing colors in clojure code when that code doesn't have to play nice with java?

20:32 Anything other than integers that is

20:35 TEttinger: coventry: https://github.com/Netflix

20:35 namccarty: there's SColor. hang on a sec...

20:36 https://raw.github.com/SquidPony/SquidLib/master/src/squidpony/squidcolor/SColor.java

20:36 it's just a massive list of static color constants.

20:36 it's java but easily usable from clojure

20:37 you know, it's probably not hard to just convert that to clojure with a good regex...

20:37 namccarty: It's a bit overkill for my needs right now

20:38 I only need to deal in 11 predefinied colors

20:39 ianeslick: Is there a canonical method for creating custom exceptions in Clojure these days? I know things have moved a bit since I last needed to do this (!) and for clojure-to-clojure exceptions there is the slingshot library. Thoughts?

20:41 bbloom: ianeslick: ##(doc ex-info)

20:41 lazybot: ⇒ "([msg map] [msg map cause]); Alpha - subject to change. Create an instance of ExceptionInfo, a RuntimeException subclass that carries a map of additional data."

20:42 ianeslick: bbloom: that means I have to catch, check then rethrow any exception that is not the one I'm looking for?

20:44 coventry: TEttinger: Yeah, I guess if it were available, it would be there.

20:46 ianeslick: Re: earlier discussion on Datomic licensing. Building and supporting an open source database is an _extremely_ expensive prospect because the # of non-paying users dwarfs paying users for a long time (see total VC raised by Mongo, Couch, etc) and generally databases are harder to get a good developer community around because design concerns have such broad implications. Plenty of recent, new databases have been closed source

20:46 (Vertica, Aerospike, etc). It's one area where I'm willing to invest in non-open source because databases are so damn hard to do well and I'd rather have a small, well-paid, sustainable team than a big hairy open source DB like Mongo (check out the bug list in JIRA for replication bugs, it's terrifying).

20:47 I found a production bug in MongoDB about a year ago which only occurred when you wrote the same record many, many times and it was hard to find a reproducing case for; I switched to Datomic then and never looked back.

20:47 (Disclosure: I'm a Datomic Pro customer)

20:48 technomancy: mongodb isn't exactly the apex of OSS databases

20:49 ianeslick: technomancy: amen. Just meant to say that OSS, FOSS, and closed-source is a more nuanced choice in DBs than in other areas of software

20:49 namccarty: Mongo is sort of that one database that knows it is on fire but instead of quenching that fire, it plans on utilizing it as a heat source to generate power

20:49 Not the best example

20:49 ianeslick: namccarty: lol

20:49 namccarty: But yeah, I do get what you are saying

20:51 But I'm not really one to have qualms over licenseing

20:52 ianeslick: I'm a pragmatist. If I'm not going to invest the time to fix bugs in software myself, and I need support and will pay for it, then the only question in my mind about closed source is longevity of the vendor. In the case of Datomic I'm willing to trust that if Cognitect went under it would open-source Datomic rather than letting it die.

20:52 technomancy: single-vendor reliance is more of an issue than the cost

20:53 ianeslick: I might change my mind if they took on venture capital financing.

20:53 technomancy: after you've already written your code around it you mean?

20:54 ianeslick: For future projects probably. I'm moderately addicted to it now. :)

20:54 namccarty: In the buisnnes I help run, we are currently working on two major projects (and a few contracts we took on unrelated to games that we took on to get some money to get off the ground)

20:55 ianeslick: I still use SQL, Solr, Hadoop, Cassandra, etc for storage/processing where appropriate.

20:55 namccarty: both of them will eventually be open sourced, but only after those products are no longer our focus

20:55 granted games are a diffrent field entirely then databases

20:56 but i still think that mindset is a good way to go

20:57 ianeslick: I like the Open Source Eventually model that Fred Trotter is running through OSI. Even Stallman isn't miltant about it. (e.g. restrict use for N months/years, then turn it into FOSS -- as long as you innovate and produce new versions with reset clocks, you get the protection of proprietary with the long-term comfort by users that they can sustain the project on their own later.

20:57 That solves the single-vendor reliance rather neatly and with less confusion/hair than open core models.

20:57 (Thinking about these issues for my own project)

20:58 technomancy: it doesn't really solve anything

20:58 you're still at the mercy of one vendor

20:58 and their promises aren't backed by anything you can actually bet against

20:58 twitter promised their Android client would be OSS years ago

20:59 namccarty: I sort of like the drug patent type model, where you are granted a monopoly for x ammount of time in exchange for releasing source code

20:59 ianeslick: The point about open source eventually is you release the source now, but it is proprietary for a fixed period of time. Built into the license is a date at which you can do whatever you want with it (fork, etc)

20:59 TEttinger: namccarty: https://gist.github.com/tommyettinger/6877456

20:59 technomancy: ianeslick: ah, if it's part of the license that's different. I haven't seen that before.

20:59 AimHere: Open source now, proprietary later is the smarter move

21:00 namccarty: I think it is new zeland that does that for software patents

21:00 requires the release of source code

21:00 you dont release the source, tough luck, you dont get exclusive rights to sell it

21:00 AimHere: "Here is code you're not allowed to write"

21:01 namccarty: Yeah that is the one thing I don't like about the drug patent model

21:02 TEttinger: Thanks, this will come in handy a litle further down the road than I am right now

21:02 ianeslick: http://comments.gmane.org/gmane.comp.licenses.open-source.general/12884

21:02 namccarty: or one major thing i should say

21:03 The drug patent model clearly does work to some extent, at least for drugs

21:04 But I think there is currently insufficent data to tell its effect on software

21:04 TEttinger: it works even better there IMO. drugs are a hard market because R&D is so expensive

21:04 namccarty: there being software or drugs>

21:04 *?

21:04 clojurebot: * is just for when you are lazy and sloppy

21:04 TEttinger: sorry software

21:05 tech is easier to innovate in

21:05 AimHere: Well labour intensive tech is

21:05 TEttinger: drugs could kill someone!

21:05 namccarty: Yeah, I think it does have its merits, and I think it would be a good thing to have in the software world

21:05 riley526: software could kill someone

21:05 namccarty: But I don't have anything to really go past "I think" with

21:05 riley526: but not most uses of it

21:05 TEttinger: riley526, skynet?

21:06 AimHere: riley526, Does comp.risks digest still happen?

21:06 riley526: AimHere: never heard of it

21:06 AimHere: It's been around since forever on things like usenet. A periodical thing that gave out instances of things going wrong with computers. Old school internet folklore.

21:07 riley526: Sounds fun actually

21:07 AimHere: Discovered it's still going

21:07 namccarty: One of the things we are considering doing with our games is, since they both use simmilar concepts of "tiles", is to pull out the code that expresses these tiles and make that OSS

21:08 And then keep the lid closed on the rest of the game until we see fit to let it go

21:08 TEttinger: rec.games.roguelike.development is still going. granted, the roguelike genre is about as old as usenet...

21:08 AimHere: Well I remember when it was just rec.games.hack and rec.games.rogue

21:09 technomancy: namccarty: like id software does?

21:09 TEttinger: namccarty, I'd be interested in your tiles lib

21:09 AimHere: Roguelike genre is older than usenet by about 3-5 years I think

21:09 technomancy: the engines are Free; the data files are licensed

21:09 namccarty: that is sort of what we are going for right now

21:09 the id style thing that is

21:11 we hope to have a working prototype of our smaller game by the end of the week, by that time i'll have a better feel of how it is shaping up

21:11 TEttinger: I could probably contribute a half-decent dijkstra pathfinding/AI routine to it. I have an array-based "dijkstra map" implementation thanks to kaw

21:12 namccarty: If it looks like the code for the tiles can be seperated from the game rules without causing multiple uncontainable wildfires, we'll look into moving it into its own library and opensourcing it now

21:13 TEttinger: I should ask first:

21:13 does it use arrays or vectors or what, internally?

21:13 namccarty: The short answer is we haven't decided yet

21:13 TEttinger: favor arrays for performance.

21:14 the difference is fairly significant

21:14 see hiphip

21:14 https://github.com/Prismatic/hiphip

21:14 * nDuff is a bit amused to see a legitimate conversation going on re: our pet troll's favorite topic. :)

21:15 namccarty: the notebook i have filled up with ideas about how to repusent an abstract world made of tiles uses something like a 2d array in my little notation

21:15 Raynes: http://clojurecup.com/app.html?app=codenotes What the hell.

21:15 How do you end up with a team where 3/4 are named some variation of "Alexander"?

21:15 namccarty: Alex is my middle name, brb, joining that team

21:16 But yeah, one of our goals is for tiles in a map to be able to contain entire maps

21:17 we haven't quite worked out how we are going to do that in the code

21:17 but its not the hardest task in the world

21:18 TEttinger: what I would maybe recommend is having lots of related arrays of primitives for performance-heavy stuff, and for things like linking you want maybe a hashmap of positions to other sets of hashmaps/arrays

21:18 s/sets/groups/

21:19 xeqi: seangrove, frozenlock : there isn't alot code wise that clojars needs. The bigger thing it needs a revenue stream to support a real operations person. Next would be a registered DMCA agent, a UI refresh

21:20 TEttinger: clojure is not quite fast enough to do near-instant large board updates when using vectors, at least on one thread. with arrays it's easy

21:21 namccarty: i am going to bring the idea of making the tile library oss now and he is going to be like "Back in my day, we didn't have open source, we had to use EULA's uphill both ways. In a snow storm. In hell. In Jail"

21:21 bring up the idea to the other owner of this startup that is

21:21 TEttinger: heh

21:22 well, I might use it, if it's easy enough to port my existing algos.

21:22 I've been meaning to revamp my code a bit

21:22 it uses 1D arrays because they're much easier to work with in clojure

21:22 but I never did the utility functions

21:23 namccarty: ive got like 30 pages in this notebook that just seek to answer the question "What is a tile?"

21:23 I'm pretty sure the answer to P=NP? is hiding in there somewhere

21:24 TEttinger: haha

21:24 tiles do vary a lot depending on the game

21:25 http://www.roguetemple.com/z/hyper.php

21:25 excellent weird tiles

21:25 namccarty: we are trying to do something simmilar with our big game

21:26 we are attempting to lie to the user and present them with a geometry in which hexes can be used to make a sphere-ish shape

21:26 that is mostly a rendering trick though

21:27 i should say, a geometry in which they can be used to me a sphere-ish shape without distorting the hexes

21:28 and there are a few other fiddily endgame things that mess with the conceptions of space

21:28 basically what we want to do is have something that could be used to play all games that could be played on a board

21:28 the space that board is in doesn't have to be eudlician

21:29 TEttinger: https://www.shapeways.com/model/455240/light-purple-d60.html?li=user-profile&materialId=26 this is a good board for imitating spheres/

21:30 namccarty: well, the thing is, we don't want the player to be able to tell they are on a sphere for the first part of the game

21:32 our big project is sort of our own unique take on a 4x game

21:33 We want the user to become the pre-science humans that think the heavier an object is, the faster it falls, that the earth is flat, and that the sun goes around it

21:44 hmmm, on the tiles being able to contain maps composed of tile. I think one way to do it is have a type of link that you must follow if the tile you are on has one

21:44 and make the tile that "contains" the sub-map unable to actually contain anything other than this link

21:44 dnolen: Bronsa: hey I couldn't apply that try* -> try patch to CLJS master

21:45 Bronsa: dnolen: I saw the comment, I'm making another patch

21:51 dnolen: updated

21:54 dnolen: Bronsa: applied to master, thanks!

21:56 Bronsa: dnolen: it's awesome to contribute a patch to cljs and watch it get merged in less than 24h, thanks!

21:56 dnolen: Bronsa: np

22:01 TEttinger: namccarty, have you seen ultima ratio regum?

22:01 namccarty: no, no i have not

22:02 TEttinger: http://www.ultimaratioregum.co.uk/game/info/

22:02 namccarty: neat, it appears to share a lot of the features we are trying to go for

22:04 TEttinger: his isn't open source, but you could probably glean something from his postings

22:28 `cbp: hum

22:28 can I prevent evaluation of a fn with a macro and turn it into a list? preferably with qualified symbols

22:28 I feel like I'm missing something :P

22:28 bitemyapp: `cbp: not unless the form is available to you

22:29 `cbp: function objects are opaque in all lambda calculi.

22:29 seangrov`: bitemyapp: My mind started wandering about thinking what it would be like if macros could modify function bodies in a way limited to themselves...

22:29 bitemyapp: `cbp: this is actually a trade-off made against a whole different way of thinking about programming, but I don't know how much you want me to start babbling about higher kinded type systems.

22:29 seangrov`: Don't know what it would be good for though

22:30 TEttinger: wat?

22:30 $google wat programming language

22:30 lazybot: [Wat — Destroy All Software Talks] https://www.destroyallsoftware.com/talks/wat

22:30 `cbp: bitemyapp: np

22:30 I have this but I feel silly https://www.refheap.com/19510

22:30 bitemyapp: TEttinger: I'm contrasting lambda calculi with "black box" function objects as opposed to turing machines fed godel numbered strings.

22:31 `cbp: yes, that only works because it's an anonymous function and you're suspending eval of the "fn"

22:32 `cbp: typically when you pass functions as "arguments" it's just a reference to a black box function. Conceptually, a glorified pointer to an object that executes over its lexical scope.

22:32 this where we take a detour into the "objects are bad closures! Closures are bad objects!" c2 wiki vacation.

22:32 TEttinger: bitemyapp, I meant to find http://axisofeval.blogspot.com/2011/09/kernel-underground.html

22:32 which has a link to wat

22:32 bitemyapp: `cbp: but, within the expansion of a macro, the rules change can you have access to the enclosed forms such as they exist at macro-expansion time.

22:33 seangrov`: bitemyapp: That was a moment of enlightment for me when I first came to the same conclusion, re: c2 story

22:33 TEttinger: wat is like lisp with fexpr s instead of sexpr s

22:33 bitemyapp: `cbp: obviously this doesn't work if f is the name of a defn'd function.

22:33 `cbp: bitemyapp: yeah. I just wanted to do this because rethinkdb allows "lambdas" into their queries which have to be turned into protobufs which means turning the fn inside out. At least if I wanna keep the construction of these fns with familiar syntax

22:33 bitemyapp: seangrov`: understanding it certainly improved my faculties :)

22:34 `cbp: you probably want a custom fn[a-z] macro or function.

22:34 TEttinger: `cbp, have you seen Prismatic/Plumbing ?

22:34 bitemyapp: `cbp: this is not an unprecedented thing, and TEttinger makes a good point by pointing to Prismatic's libraries.

22:34 coventry: `cbp: Have look at the source for clojure.test.deftest or technomancy's serializable functions.

22:35 `cbp: okies

22:35 I havent seen plumbing no

22:35 * `cbp goes on github

22:35 TEttinger: https://github.com/Prismatic/plumbing

22:35 bitemyapp: `cbp: Prismatic's libraries are always interesting.

22:35 Can't say that I necessarily want to leap into writing Prismatic-jure instead of Clojure though :)

22:36 seangrov`: bitemyapp: There was a proposal somewhere to potentially attach a function's source code as metadata, so you could possibly write a function that did some crazy stuff

22:36 TEttinger: I'm kinda a contributor to hiphip, which is cool beans.

22:36 seangrov`: Scope would be a problem, but that might not be an issue for some use cases

22:36 bitemyapp: seangrov`: I could do great and terrible things with that, hahahaha

22:36 seangrov`: TEttinger: hardcore :)

22:36 TEttinger: as in I submitted a pull request that was awful

22:36 bitemyapp: TEttinger: hiphip is also one of the more library'ish libraries they released.

22:37 seangrov`: ztellman and the prismatic people are imposingly impressive

22:37 TEttinger: but it inspired w01fe to fix my code

22:37 bitemyapp: I get the point of plumbing and graph but I'm still a bit o_O about it.

22:37 TEttinger: the best kind of PR.

22:37 amalloy: seangrov`: if you're interested, technomancy's serializable-fn does allow you to attach a function's source code and lexical closures as metadata

22:37 bitemyapp: the, "where's my broken toy, please fix" PR

22:37 amalloy: i haven't followed the discussion closely enough to know whether that's relevant

22:38 seangrov`: amalloy: Ah wow, that's pretty crazy. I don't remember what I wanted it for anymore, but I feel like it could be fun

22:38 TEttinger: bitemyapp, haha. really my PR actually did work, it AOT compiled where hiphip master didn't, but it had awful style.

22:40 `cbp: bitemyapp: so what do you think I should do? Have a serializable fn macro?

22:41 coventry: `cpb: It's just an example of how to pull the fn form out. Where you stick depends on your application.

22:41 TEttinger: his answer was (load-string (impl/slurp-from-classpath "hiphip/type_impl.clj"))

22:41 bitemyapp: `cbp: is it a feature needed for an initial release?

22:41 amalloy: seangrov`: yeah, i think it's mostly not that useful, but pretty neat. (let [x 1] (serializable/fn [y] (+ x y))) prints as exactly that, and has metadata available for inspection if you want to do more than round-trip it through pr-str/read-string/eval

22:41 bitemyapp: `cbp: if you've already gotten down to the lambda stuff it seems like the library could cut a release soon and then people could start testing.

22:41 TEttinger: which uses an agh, (slurp (.getResourceAsStream (clojure.lang.RT/baseLoader) file))

22:41 bitemyapp: `cbp: or is it more fundamental than I am imagining?

22:42 `cbp: bitemyapp: well considering lambdas are required for things like map, filter, create-index, etc. I think its pretty fundamental yeah

22:42 bitemyapp: oh, well then.

22:42 coventry: `cbp: What's the app you're working on?

22:42 `cbp: coventry: a clojure driver for rethinkdb

22:42 bitemyapp: serializable-fn seems the most "baked" way to do this. It's unclear to me whether you actually want arbitrary serialized fns or just a DSL.

22:43 coventry: he's picking up the abortive experiment I performed and doing the actual work to make a library.

22:43 coventry: Cool.

22:43 `cbp: coventry: https://github.com/bitemyapp/revise still pretty amorphous at this point

22:44 bitemyapp: amorphous is doing it more credit than it deserves.

22:44 it's a blast zone of some REPL snippets poking at a local rethinkdb instance.

22:44 `cbp: :P

22:44 bitemyapp: I already do stuff with Datomic and Korma (SQL), a third batch of db tooling is a bridge too far.

22:45 luckily, the protocol buffers tooling for Clojure is decent.

22:54 seangrov`: bitemyapp: I'm wondering the same things as this user https://github.com/korma/Korma/issues/137

22:55 Somehow using maps doesn't seem to work - I thought I remembered it working before

22:59 Ah, nevermind, where seems to work, I was using where*

22:59 When in doubt, read the source... then read the tests.

23:02 yeoj___: does anyone know why clojure.java.jdbc with-connection doesn't work with :as-arrays? true ?

23:03 it seems like it only works with jdcb/query , but not with with-query-results or anything

23:06 `cbp: yeoj___: as-arrays? is an option for query

23:06 yeoj___: https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L630-L649

23:07 yeoj___: `cbp: ok, but it doesn't work on "with-query-results"

23:07 `cbp: sounds good. i need to get use to looking at the source more.

23:08 TEttinger: yeoj___: the other options are here https://github.com/clojure/java.jdbc/blob/master/src/main/clojure/clojure/java/jdbc.clj#L144

23:08 yeoj___: i'm just trying to dump a giant database table to a text file output, and trying to understand the most efficient/correct way to do it with lazy seqs

23:09 TEttinger: what kind of hardware is this running on? I'm wondering if parallel writes make sense on SSDs but not on HDDs.

23:09 `cbp: yeoj___: I would use the dbms for that but to each his own i guess :P

23:10 yeoj___: `cbp: well, ideally, someday, is to build a sort of etl layer in clojure.

23:11 `cbp: i have to start somewhere. Pentaho did it with kettle. It seems to me clojure would have more potential for doing things in parallel

23:13 TEttinger: I wonder if datamic has support for some of this already

23:14 yeoj___: http://michakurt.blogspot.com/2011/01/minimalistic-etl-with-clojure.html

23:14 yeoj___: TEttinger: ohhh cool.

23:14 thanks.

23:15 TEttinger: I like searching!

23:15 np

23:17 yeoj___: TEttinger: i want to use it, and maybe extend parts to use bulk loaders with named pipes.

23:17 TEttinger: https://github.com/kyleburton/clj-etl-utils

23:17 yeoj___: TEttinger: i have lofty dreams for a not good programmer.

23:17 TEttinger: this looks like a more finished version of that post

23:17 heh

23:20 coventry: Is there a way to pull out all of the data in a general (deftype) instance? Like (deftype a [b]) (gimme (user.a. 5)) should give me back [5]?

23:22 gfredericks: coventry: probably just reflectively?

23:23 coventry: gfredericks: Sounds plausible. Do you have any suggestions for where to look in the (reflect) map? It's huge.

23:24 Oh, wait, that was for a defrecord. Let me try a deftype.

23:26 Yep, still huge. Maybe I can read it out of the builder in Compiler.java.

23:38 gfredericks: coventry: (deftype Foo [a b c])

23:38 (->> Foo .getFields (map (memfn getName))) ;; => ("a" "b" "c")

23:39 looks like there's more noise if you start adding protocols

23:40 maybe add a (remove #(re-matches #"const__\d+"))

23:40 yeoj___: TEttinger: that was such a great blog post. :) I have to figure out how that entire library works... i'd love to be able to contribute.

23:41 coventry: gfredericks: Thanks, that is a huge step forward. Is there also a way to pull out the values of a b and c from (Foo. [1 2 3])?

23:42 Also, memfn is very cool.

23:42 gfredericks: coventry: (clojure.lang.Reflector/getInstanceField foo "a")

23:45 coventry: Awesome. Thanks a lot.

23:48 gfredericks: memfn and partial: two great ways to use more characters but fewer octothorps and generated classes.

Logging service provided by n01se.net