#clojure logs

2016-03-16

00:11rhg135maybe deep down you knew
00:38sdegutisPerhaps.
00:38sdegutisWhy is all the code I've ever written in my past terrible?
00:39rhg135has anyone else besides you said that? We're our worst critics.
00:39sdegutisIt's almost as if (is-code-good? code) is implemented as (.before (:date-written code) (java.util.Date.))
00:39sdegutisOr perhaps (constantly false).
00:40sdegutisHmm. Nobody has seen my code, so nobody can say that.
00:40sdegutisOops that should be .after not .before
00:40sdegutisAlso it's cleaner looking this way (. (:date-written code) after (java.util.Date.)) but I don't know if that's valid syntax.
00:40sdegutis,(. (java.util.Date.) before (java.util.Date.))
00:41rhg135(constantly false) sounds right
00:41clojurebotfalse
00:42rhg135,(. (java.util.Date.) (before (java.util.Date)))
00:42clojurebot#error {\n :cause "java.lang.Class cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Class cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval49 invokeStatic "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval49 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval49 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Compiler eval "Compiler.java" 692...
00:42rhg135,(.. (java.util.Date.) (before (java.util.Date))) ; yay
00:42clojurebot#error {\n :cause "java.lang.Class cannot be cast to clojure.lang.IFn"\n :via\n [{:type java.lang.ClassCastException\n :message "java.lang.Class cannot be cast to clojure.lang.IFn"\n :at [sandbox$eval73 invokeStatic "NO_SOURCE_FILE" 0]}]\n :trace\n [[sandbox$eval73 invokeStatic "NO_SOURCE_FILE" 0]\n [sandbox$eval73 invoke "NO_SOURCE_FILE" -1]\n [clojure.lang.Compiler eval "Compiler.java" 692...
00:42rhg135aww
00:43rhg135,(.. (java.util.Date.) (before (java.util.Date.))) ; heh
00:43clojurebotfalse
00:44rhg135you just need to squint a bit at that exception
01:04sdegutiswait, what?
01:04sdegutisOh, missing period.
01:04sdegutisHeh.
01:04sdegutis,(. (java.util.Date.) (before (java.util.Date.)))
01:04clojurebotfalse
01:04sdegutisclojurebot: YOU SUCK
01:04clojurebotIt's greek to me.
01:04sdegutisexactly.
01:06rhg135Don't be mean to her!
01:20sdegutisYou.. you gave it a /name/ ???
01:23sdegutisGoodnight rhg135
01:24rhg135You must be in Europe
01:24rhg135Those timezones
01:25sdegutisHaha.
01:26sdegutis,(java.util.Date.)
01:26clojurebot#inst "2016-03-16T05:26:17.092-00:00"
01:26sdegutisHmm, yeah that's about 5 hours off.
01:26sdegutisGood night.
04:59zipperHow can I find out how to identify the library I want from clojars? For example all I know is that I want to use `Thread/sleep`
05:01ben_vulpesthat'd be a java call, zipper
05:01ben_vulpes,(.sleep Thread 50)
05:01clojurebot#error {\n :cause "No matching method found: sleep for class java.lang.Class"\n :via\n [{:type java.lang.IllegalArgumentException\n :message "No matching method found: sleep for class java.lang.Class"\n :at [clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 53]}]\n :trace\n [[clojure.lang.Reflector invokeMatchingMethod "Reflector.java" 53]\n [clojure.lang.Reflector invokeInstanceMe...
05:01ben_vulpesor something like that
05:02ben_vulpes,(sleep Thread. 50)
05:02clojurebot#error {\n :cause "Unable to resolve symbol: sleep in this context"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.RuntimeException: Unable to resolve symbol: sleep in this context, compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyze "Compiler.java" 6688]}\n {:type java.lang.RuntimeException\n :message "Unable to resolve symbol: sleep in this...
05:02zipperben_vulpes: Let me google how to make a java call from clojure
05:02qsys'(Thread/sleep 50)
05:02qsys,(Thread/sleep 50)
05:02clojurebotnil
05:02qsyssleep is a static of class 'Thread'
05:03qsysso you call it with (Thread/sleep xx)
05:03qsyshttp://clojure.org/reference/java_interop
05:07zipperI get a null pointer exception on `((Thread/sleep 1000) (println "hi"))`
05:07zipperEven though it does delay and prints as expected.
05:07zipperThen the exception comes later.
05:08qsysThread/sleep returns nil
05:09lumayou're calling the return value of Thread/sleep as a function
05:09qsysso your expression evaluates, if I'm right, to (nil (println "hi"))
05:09lumait returns nil (and so does println), so you're actually calling (nil nil)
05:09luma,(nil nil)
05:09clojurebot#error {\n :cause "Can't call nil, form: (nil nil)"\n :via\n [{:type clojure.lang.Compiler$CompilerException\n :message "java.lang.IllegalArgumentException: Can't call nil, form: (nil nil), compiling:(NO_SOURCE_PATH:0:0)"\n :at [clojure.lang.Compiler analyzeSeq "Compiler.java" 6875]}\n {:type java.lang.IllegalArgumentException\n :message "Can't call nil, form: (nil nil)"\n :at [clojure.la...
05:09qsysand than 'nil' is a 'function call'
05:09qsysthx luma :p
05:09zipperI see
05:10i-blisqsys: wrap in a do
05:10luma,(do (Thread/sleep 1000) (println "hi"))
05:10clojurebothi\n
05:10i-blis,(do (Thread/sleep 3000) :value)
05:10clojurebot:value
05:41zipperHey why would this require be failing on me https://www.refheap.com/4ecaf595303df887e0cad70e5
05:42hiredmanthere is no namespace core.async
05:43ridcully_is :gen-class a thing in cljs?
05:43hiredmannope
05:43ridcully_guessed so
05:44zipperI'm not using cljs
05:45zipperIt seems that I am though. I am currently just simulating uploads.
05:45ridcully_but require-macro/include-macros is cljs only (right?)
05:45zipperHere's a better one then https://www.refheap.com/2bb002a66f61f1c2641410321
05:46zipperImproved and the error has reduced.
05:46zipperridcully_: I am learning so much in parallel it's confusing.
05:47zipperFilenotFoundException hmmm maybe it hasn't downloaded the lib
05:52zipperHow can I see the return values of `ret-num` in the repl?
05:54AndreasODraw multiple objects on seesaw canvas, not knowing amount or places beforehand?
07:24aurelianhi there... I need to collect some data by doing some api calls, but now I have to add another data source, another service that will basically return same kind of data.
07:24aureliannow, I've been trying to figure out what's the best way to do that, should I use defprotocol or definterface or just stick with simple fn and not overthink this thing?
08:31adam2Hi there !
08:34adam2I have a bit of a hard time finding good doc about macros in clojurescript
09:15iMadperHi. I have following code to read logs into list from a file. (println "loading file done in: " (time (def lines (str/split-lines (slurp "log2"))))) However it runs extermely slow. (~3000ms) (compare to golang or Crystal-lang in 100ms) May I know what's the correct way? :-)
09:16iMadperThe log2 is about 300MB
09:18iMadperoops, it should be read as "(~13000ms)"
09:20opqdonutyou could write your own loop that uses BufferedReader.readLine
09:20opqdonutand you could also profile slurp and split-lines separately
09:20dysfunslurp is really meant for reading small files
09:21iMadperopqdonut: Thanks a lot. I will give it a try.
09:21dysfunand split-lines is probably not horrifically efficient
09:21iMadperopqdonut: slurp is slow as well..
09:21opqdonutit seems split-lines just calls java's String.split
09:21dysfunif you need high performance IO, the java reader stuff is worth looking into
09:21opqdonutbut still, if you have lots of lines it doesn't make sese to read the file into a huge string and then split
09:22iMadperdysfun: Yeah you are right. Slurp is slow for a big file.
09:22opqdonuthttps://clojure.github.io/clojure/clojure.java.io-api.html lots of useful stuff here
09:22dysfunslurp is more a convenience for when you're in the repl and want to play with some data
09:22iMadperI see. Thanks you all.
09:22opqdonute.g. (input-stream "filename") should give you something you can call .readLine on
09:22iMadperI'll try some other api. :-)
09:23opqdonutsorry, (reader "filename")
09:26dysfunbufferedreader is good because it will read in large chunks
09:27dysfunso you're trying to parse a logfile?
09:27iMadperdysfun: yes.
09:27dysfunis it a widely used format?
09:27iMadperdysfun: No.
09:27dysfunah
09:28dysfundo you have to read a lot of them?
09:28dysfunas in is performance a hard requirement here?
09:28iMadperdysfun: not a hard requirement. I just want to know why my program is so slow...
09:29dysfunah right. well if you don't have strong performance requirements, you might find something like parse-ez quite helpful
09:29dysfunbut you'll have to google it because i don't have a browser installed yet on this machine :)
09:30iMadperdysfun: Yeah, I can google it even if I'm in China. lol
09:30dysfunoh is google forbidden at the minute?
09:30iMadperyes.
09:30dysfunand baidu has been serving malware in its ads
09:30dysfunquality
09:31iMadperSometimes you just won't get the correct answer by using Baidu...
09:32dysfuni remember at my college (a top 20 college in britain, thus very attractive for rich chinese parents to send their kids off to get educated)
09:33dysfunwe were having an 'everyone in the year' presentation sort of thing and the woman on the stage said "be sure to google tiananmen square while you're here"
09:33iMadperlol~
09:34rkslol
09:35rksdid anyone heard about shenlanguage
09:35rks?
09:35rksi just visited their website
09:35dysfunno, what's their USP?
09:36rksyou can visit their website http://shenlanguage.org/
09:37winkwas that the one with the license kerfuffle?
09:37rksa lisp dialect that have types, pattermatching like prolog
09:37dysfunhrm, interesting
09:37dysfunprobably not interesting enough for me to bother learning, but interesting enough to look at
09:38rksit grew some interest on me
09:38dysfuni'm sceptical that lisps with type systems work terribly well
09:39rksi see
09:39dysfuni like haskell's type system, i like clojure, but the intersection of them is a bit weird
09:39rksin clojure in have schema / typeclojure
09:39dysfunand syntax for type annotations is universally awful
09:39rks*it
09:40rksi agree
09:40rksmade in china :)
10:10sdegutisIs there some nifty way to replace nils with zero when adding?
10:10sdegutisfnil comes to mind, but I don't remember why it's there
10:11sdegutis,(+ ((fnil + 0) nil))
10:11clojurebot0
10:21sdegutisNever mind.
10:27pyrhola
10:38faxmodemque tal?
10:38oracle123I have some code as data in a file, but how to read it out as code?
10:38oracle123(read-string (slurp "my.ini" :encoding "utf-8"))
10:39oracle123I use that code, but it doesn't work
10:39oracle123The content of the file is {:accounts 1 :bidding? false :start-webdriver? true}
10:39oracle123But the result of read-string is empty
10:40opqdonutdoes the slurp work on its own?
10:40opqdonutbecause that does look correct
10:40oracle123it works for (slurp "my.ini" :encoding "utf-8")
10:40opqdonutwhat's the result of that?
10:40oracle123it should show the good result
10:41wink(:accounts (read-string (slurp "my.ini" :encoding "utf-8"))) -> 1
10:41winkworks for me
10:41oracle123If I println , then the result of slurp is {:accounts 1 :bidding? false :start-webdriver? true}
10:41oracle123
10:41winkmaybe your file contents is different from what you pasted
10:41oracle123not sure whether the encoding is the problem
10:42oracle123Original it works on my linux, but when I share it with my friend who are on windows, then it failed
10:42oracle123So I save it in UTF-8 in notepad on windows and copy to linux
10:43opqdonutyou could use (seq (slurp "my.ini" :encoding "utf-8")) to see what characters the file contains
10:43opqdonutin case there is something weird there
10:44winkmaybe try a clojure.string/trim around slurp as well
10:46oracle123I tried trim, still doesn't work
10:46opqdonutwhat did seq give?
10:46oracle123if use seq, I could see \return \newline
10:47oracle123is that the problem?
10:47winkshould not if you use trim
10:47opqdonutthat's not a problem anwyay
10:47oracle123
10:47oracle123(println (seq (load-config "/home/oracle/clojure/lein/page_scan_controller/config_test_no_chinese.ini")))
10:47opqdonut,(read-string "{:hello 1}\r\n")
10:47clojurebot{:hello 1}
10:47oracle123( { : a c c o u n t s 1 : b i d d i n g ? f a l s e : s t a r t - w e b d r i v e r ? t r u e }
10:47oracle123
10:48opqdonutno don't println it
10:48opqdonutjust run it and show what you see in the repl
10:48opqdonutor if you're not in a repl use prn
10:49opqdonutprn is what you should use when debugging, it doesn't hide stuff
10:49oracle123(\ \{ \: \a \c \c \o \u \n \t \s \space \1 \space \: \b \i \d \d \i \n \g \? \space \f \a \l \s \e \space \: \s \t \a \r \t \- \w \e \b \d \r \i \v \e \r \? \space \t \r \u \e \} \return \newline)
10:49oracle123
10:49oracle123that's the prn
10:49opqdonutyeah that looks ok
10:50oracle123then why read-string return nothing?
10:51opqdonutare you certain it returns nothing? does nothing mean it returns nil?
10:52prohoboNOTHING
10:52oracle123in cider, it shows nothing, but when check it's type, it's clojure.lang.Symbol
10:53opqdonuthmm
10:53oracle123I can't see anything if run the read-string
10:53oracle123but if use (type (read-string (load-config "/home/oracle/clojure/lein/page_scan_controller/config_test_no_chinese.ini")))
10:54opqdonutmaybe the first empty character in that string is some sort of weird non-breaking whitespace
10:54opqdonutwhich gets read as a symbol
10:54oracle123ok, let me delete the leading invisible char
10:55opqdonut,(read-string "\u00A0{:hello 1}")
10:55clojurebot 
10:55opqdonutsomething like that
10:55opqdonutmy repl shows a ? character instead of an empty line
10:56opqdonutit might be the utf-8 byte order mark, created by notepad
10:56opqdonut,(read-string "\uFEFF{:hello 1}")
10:56clojurebot
10:56opqdonutno idea why it shows up as "\ " and not \uFEFF or something
10:57oracle123yes, must because of the notepad, since when I work on linux native file, it works well
10:58oracle123but faield when work on the file coped from window notepad
10:58oracle123any workaround?
10:59oracle123In windows the repl show ?, in linux it show nothing
10:59opqdonutdon't have BOMs in files
10:59opqdonutis the best solution
11:00oracle123so don't use notepad?
11:00opqdonutyeah
11:00oracle123then use what editor? the custome is not IT guys
11:00oracle123and I need to give them a tool to edit the file
11:00oracle123I have put the configuratoin in the file,
11:01opqdonutwell you can ask them to save as ascii
11:01opqdonutor perhaps you can remove the BOM when reading
11:01oracle123But I have Chinese in the data
11:01opqdonutoh ok
11:01oracle123then how to remove BOM?
11:02opqdonutclojure.string/replace
11:02opqdonutfor instance
11:02opqdonut,(clojure.string/replace "\uFEFF{:hello 1}" #"\uFEFF" "")
11:02clojurebot"{:hello 1}"
11:02oracle123great, let me try :)
11:05opqdonutgoogling reveals lots of problems with BOMs in clojure, it's kinda dumb that the reader doesn't support it
11:08oracle123yeap, it works, thanks very much
11:08dysfunopqdonut: that should probably be anchored to the start of string. the string is otherwise invalid
11:08opqdonutI don't think the BOM can occur anywhere else
11:08dysfunnot and be valid, yes
11:08opqdonutbut sure, why not
11:09opqdonutoracle123: you can use #"^\uFEFF" as the replacement regex for added safety
11:09dysfunif you can't trust a tool not to put a BOM except at the beginning of the string, you can't trust it to spit out unicode, period
11:09opqdonutwould also give performance in case the string is long
11:09dysfunthat was the main reason i suggested it, yeah :)
11:09opqdonut"if you can't trust a programming language to hand BOM you can't trust it to handle unicode, period"?
11:09opqdonut*handle
11:10dysfunclojure handles utf-8 absolutely fine
11:10oracle123should it be a bug? of just as design?
11:10dysfunwell, i do think it is a bug, but i don't know whether reporting it would result in it being fixed
11:10opqdonutI think it's a bug, but opinions may vary
11:11dysfunthere is an argument that you should be decoding the string, for example
12:57amalloythe BOM should be handled when reading the file, not when processing the string
12:57amalloywhatever file-reading mechanism load-config is using
12:58amalloyit should already be gone by the time you call read-string
12:59dysfunit should, but also clojure should be quite capable of skipping over a BOM
13:46adam1Hey there, any expert to generously give me a hint about macros in clojurescript ?
13:48rhg135They have to be in. .clj files that you require-macros in
13:48adam1Yes, but i get a "Could not locate pro/macro__init.class or pro/macro.clj on classpath" error and I'm not sure why
13:49adam1I've got a macro.clj file in the same directory as my *.cljs file, have specified the right namespace...
13:50rhg135Does that file actually load? Look at the cause there
13:51rhg135Squint at it
13:53adam1Hmmm
13:54rhg135You can probably get better information trying to require it in a clj repl. Keep in mind the expansions will not work
13:55adam1Not quite sure what you mean by "squint", my english is pretty decent nonetheless :p
13:57adam1But I can require the macro file from the repl
13:57rhg135I mean those traces sometimes require you to look at them differently
13:58rhg135That's strange, maybe there's more people that actually use cljs
13:59adam1I'll try to figure it out, quite weird indeed
14:16adam1Well, kinda works now
14:19justin_smithben_vulpes: do you want Thread/currentThread ?
14:19justin_smithugh, n/m, scrollback, sorry
14:52sdegutisMy muscle memory suddenly went blank, I can't remember how to jump to the definition of a symbol, or what that's even called in Cider. Anyone remember?
14:53amalloyM-.
14:53sdegutisOh right, C-u M-.
14:53sdegutisThanks amalloy.
14:54sdegutisamalloy: we may not see eye to eye on everything, but you're a swell chap and a mighty fine Clojurian at that
14:54amalloyC-u? what does it do without that prefix?
14:54sdegutisamalloy: I think it asks you to specify what symbol without the prefix.
14:54sdegutisamalloy: with the prefix, it just jumps to the symbol under your cursor.
14:54amalloylame. it should be the opposite imo
14:54sdegutisFor sure.
14:55amalloyit's the opposite in slime
14:55sdegutisIsn't that a predecessor of Cider? I vaguely remember that name.
14:56sdegutisOh right, it's the CL thing.
14:56sdegutisHaha, "Common Lisp".
14:56justin_smithand alos a cider precessor
14:56amalloy"precessor": it was a cesspool before cider was?
14:56sdegutisHaha. "Cesspool."
14:56justin_smithoops, heh
14:57amalloyps i don't feel that strongly about cider. just an opportune pun
14:57justin_smithamalloy: https://en.wiktionary.org/wiki/precessor
14:57justin_smith:P
14:57justin_smithamalloy: I read a novel from the 18th century recently, I think it did damage
14:57sdegutisGood day, gentlemen.
14:57amalloy"obsolete" in 1913. rip
14:57justin_smithlike I said, it's all 18th century literature's fault
14:58amalloyalmost as outdated as slime
15:01sdegutisHmm, seems the chatter died down in here. Welp, back to being productive for me I guess.
15:38rhg135justin_smith: that's not a unfortunate thing. now we have things like anyways, ain't, and bad meaning good
15:39RedNifreHeya. I first installed Clojure from the Ubuntu repository and got an outdated version but I could start .clj files with "clojure bla.clj". I got rid of that version and used leiningen instead. Does the leiningen repl only work for projects or can I start a single file with it?
15:39RedNifreWhen I try "lein run somefile.clj" it looks for a namespace in a missing project file.
15:40RedNifreAlso, is it possible to write a shebang and execute clj files like "./somefile.clj"?
15:40rhg135I want to say yes, but that will only help if you have no deps
15:40justin_smithRedNifre: on linux a jar file is executable, so you can do ./clojure-1.8.jar somefile.clj
15:40rhg135and yes to shebang
15:41justin_smithoh, yeah #!/path/to/clojure.jar on the first line of the file
15:41hiredmanit is
15:42hiredmanhow to do that is kind of complicated, because it turns out that how the shebang line is handled isn't entirely standard on different unix like systems
15:42rhg135if you have deps, just make a project
15:42hiredmanosx is kind of the easiest to make work, linux takes more work
15:42rhg135or inlein I guess
15:42justin_smiththere's that new thing hyPiRion did, is that inlein?
15:42hiredmanosx is easy to make work because it handles multiple arguments to the program in the shebang line like you would expect
15:43rhg135yeah that thing
15:43rhg135I've never used it, but it should work here
15:44RedNifreHm, sounds like I couldn't just hand a .clj script to somebody else though. I guess making a jar is more reliable, huh?
15:44rhg135yeah
15:44hiredmanyeah
15:44rhg135windows...
15:45rhg135also, deps
15:46hiredmanhttps://gist.github.com/hiredman/a8fb63ec64704ecb967f this style shebang works on osx
15:48hiredmanon linux I've done stuff like https://gist.github.com/hiredman/0ecf33119a470339c89e so the file ends up valid shell and valid clojure
15:48rhg135yay for hardwiring paths, but I didn't know linux didn't habdle arguments
15:48hiredman(with the actually clojure code following that)
15:50hiredmanyou can actually avoid all that, by putting the java -jar clojure.jar bits in a shell script, and using that as the shebang line, but there is no standard way to do that
15:52rhg135maybe I only dreamt it worked
15:52RedNifreHm, could I just put #!clojure at the beginning of the file and tell people to make sure they alias clojure="path/to/the/clojure.jar" ?
15:52rhg135I could have sworn I tried the former and it ran fine
15:52justin_smithI don't think a shebang will check aliases for the first line
15:52hiredmanI am not sure aliases work for that, and you need the whole java bit, not just the clojure jar
15:52RedNifrejar it is then.
15:53hiredmanthe jar is easier to deal with dependencies too
15:53rhg135plus it's pretty easy to run still
15:54rhg135java -jar ...
15:54RedNifreDifferent topic, I have a problem about namespaces. I think I might kinda understand namespaces, not sure. To learn clojure I thought it might be fun to write a tiny text adventure. What I have right now is a dictionary from commands to functions, i.e. { "look" (fn [gamestate] ...) "take" (fn [gamestate] ...)} etc. Would it be a good idea to somehow turn that into a command namespace and replace it with (defn look [gamestate] ...) (defn t
15:54RedNifreake [gamestate] ...) etc.?
15:55justin_smithRedNifre: having an explicit map from string to action is a nice way to isolate your implementation from the text UI
15:56rhg135I think either would work, but being explicit is nice
15:56justin_smithrather than some scheme which ends up being essentially "take user input, automated transform, then eval", which is much messier
15:56justin_smithrhg135: my concern is the code that ends up mapping from the user input to the functions - if you don't have a hash-map with the mapping, you end up just giving the user a weird repl
15:57justin_smithwhich I mean hey, a repl is a UI too I guess, but might as well give them a real one if that's what it is
15:57rhg135not really if you limit it to just ns-resolve
15:58RedNifreBut if I had the commands in a namespace I could have language based mappings so it would still be clean i.e. (def EN {"look" look}) (def DE {"schau" look}) etc. Or would that be (def EN {"look" command/look})? Hm.
15:58justin_smith,(ns-resolve *ns* 'eval) rhg135: nope
15:58clojurebot#'clojure.core/eval
15:58justin_smithit's jut a weird repl, even with ns-resolve
15:59rhg135you could tag your vars, but it is messy as you say
15:59RedNifreOkay, so I'll keep the {"string" (fn..)} thing. What would be a good use for namespaces then?
15:59justin_smithnow you could make an explicit hash-map lookup in the definitions of that ns alone, but the real hash-map in the file has the advantage of being more explicit
15:59rhg135look it up in ns-publics too
16:00rhg135indeed
16:01justin_smithRedNifre: namespaces are for making collections of functions that combine to provide some kind of domain of functionality, where your project is easier to understand, maintain, and use if the functions are grouped in that way
16:01justin_smithfunctions plus a few constant values too I guess
16:01RedNifreBut doesn't that sound EXACTLY like "bunch of game commands"?
16:01justin_smithRedNifre: absolutely not
16:02justin_smithRedNifre: I would make that hash map from command names to functions in one ns, and define the individual functions in namespaces separated by theme or type of action
16:02justin_smithstart with oen or two, split them as they become messy
16:03RedNifreAlright, I'll keep it as is and see where I'll end up.
16:03RedNifreThanks for the feedback.
16:48ben_vulpesanyone ever get "NoClassDefFoundError org/apache/http/conn/ManagedHttpClientConnection com.amazonaws.http.protocol.SdkHttpRequestExecutor.doSendRequest " when using amazonica?
16:49amalloyprobably a dependency-version conflict
16:49hiredman^-
17:03ben_vulpesexciting!
17:05ben_vulpesamalloy: shall i just start snipping libs out until i find the conflicting one?
17:06amalloysee what `lein deps :tree` thinks
17:06amalloyit'll point out conflicts
17:06amalloy(you probably have a lot of conflicts that are just lurking, and then this one that's actually doing damage)
17:09ben_vulpesamalloy: good grief
17:09ben_vulpesbeen doing this long? :P
17:09amalloydoing what long?
17:11ben_vulpesworking with clojure, answering questions in irc
17:13amalloyyes
17:14ben_vulpesit shows
17:14ben_vulpes(thank you)
18:18kellytkIs there a channel for lisp web dev? I found noone in #om
18:19rhg135I don't think there is any I know of
18:20kellytkOh, thank you rhg135
18:21rhg135here is usually pretty useful
18:21TEttingeryep
18:25rhg135#clojurescript can be nice too, but dnolen is also here ;)
19:34gfredericksis there a clojure-flavored lisp somewhere that aims at purity & simplicity and a formal spec?
19:35amalloydang gfredericks, you are complecting '&' and 'and'
19:35rhg135purity? as in haskell with ()
19:35amalloyyou are forbidden from participating in this simple lisp
19:35amalloyrhg135: what does () have to do with it?
19:36rhg135it doesn't really
19:36rhg135you can have lists without ()
19:36gfredericksoh I also forgot to say that I was imagining not a full general-purpose language
19:36gfredericksso IO not strictly necessary
19:37amalloygfredericks: lambda calculus
19:37gfredericksyou could say what I'm imagining is more of an edn-processing subset of clojure
19:38gfredericksbut that isn't afraid to break compatibility to eradicate edge cases
19:38gfredericksor to simplify things
19:38gfrederickse.g., only one integer type
19:39gfredericksno vars
19:39hiredmanhave you heard of klambda?
19:39rhg135lambda calculus has only one type
19:39gfredericksnope
19:41gfrederickssomething to do with shen?
19:41hiredmanit is the langauge for bootstrapping shen, I guess
19:41gfredericksaah
19:42hiredmanI tend to think of those sorts of things as urlisps
19:43hiredmanthey are sort of like ir languages in compilers, or bytecodes in runtimes
19:43gfredericksI think I keep imagining it as a language that could be used to describe business logic in a sterile and easy-to-analyze environment
19:43gfredericksand especially could be implemented in any clojure dialect fairly easily, following a spec so as to give identical behavior
19:43hiredmanclojure without '.'
19:44gfredericks'.' meaning interop?
19:44hiredmanyeah
19:44gfredericksyeah that'd be a big part of it
19:44gilchMaybe implement edn in Scheme?
19:44rhg135specs, pfft. C has done fine so far without those
19:45hiredmanthere is so overlap with this with sandboxing
19:45gfredericksyes absolutely
19:45hiredmanwhich I have spent time thinking about re clojurebot
19:45gfredericksexecuting untrusted code is another use case
19:46gfredericksAWS lambda etc
19:46gilchWISP is Clojure-like.
19:47gfrederickslooks JS oriented?
19:47hiredmanfor sandboxing at various times I have looked at adding hooks to the compiler so you could take control over how it compiles special forms and writing an interpreter for clojure
19:49hiredmanbut it sounds like the difference is, while for sandboxing I largely wanted clojure semantics, with some extra control points
19:50gfredericksyeah definitely
19:50hiredmanwhile you want a total subset of clojure
19:50gfredericksexcept the parts I don't like :)
19:50gfredericksI figured a first pass impl could either be an interpreter or naive compile to clojure forms
19:51hiredmanyou would like to be able to specify transforms over datastructures
19:51gfredericksfor the spec part you mean?
19:51gfredericksor the compiler?
19:52hiredmanI am restating what I think your goal is, so you can tell me I am wrong
19:52hiredman:)
19:53gfredericksoh you mean the purpose of the language then?
19:53hiredmanyeah
19:54gfredericksyeah that's totally fair
19:54gfredericksanother use case would be implementing something like jq but for edn
19:54gfrederickson that note if I took this seriously I might have to fork edn
19:54hiredmanhave you seen specter?
19:54gfredericksthe marz thing?
19:54hiredmanI haven't used it, but it seems like that
19:54hiredmanyeah
19:54gfredericksnot in detail
19:54gfrederickspresumably I'll see it a month from now
19:54gilchpixie is also Clojure-like
19:54hiredmanindeed
19:55gfredericksif I could get away with a subset of edn I could name it ed
19:58TEttingerthen someone forks that, ned
19:58TEttingernicely extensible data
19:59rhg135then someon forks that, yay oss
19:59hiredmanso specter has you specify a path (sort of like update-in, but more powerful) then you can either select out whatever is there or transform whatever is there
19:59hiredmanso sort of like a more powerful version of get-in or update-in
20:00hiredmanthe transform of course can be an arbitrary clojure function, which may not be what you want
20:00hiredmanbut I dunno, I am not sure some restricted form of clojure is the best way to express a restricted set of changes
20:01gfredericksportability and exactness and simplicity are a big motivation for me
20:01hiredmanthere are lots of dsls for this kind of (jq, xslt, sql, etc)
20:02gfrederickssure
20:02hiredman(specter)
20:03hiredmanthere are, I think, regexes style libraries for clojure datastructures, that you could use to build some kind of sed for clojure data structures
20:04hiredmanalso hello haskell and lens and prisms and traversals oh my
20:07hiredmangiven lenses, I think you can model something like jq as pushing and popping lenses on a stack, which is actually kind of similar to zippers
20:09hiredmanhttps://gist.github.com/hiredman/acf9d25ec013d694e2bb
20:09hiredmanvery zipper like
20:12gfredericksI'm still fixated on something that smells like a general purpose language
20:12hiredmanwell, so clojure is a general purpose language, why not use that?
20:14hiredman(this is like the fourth or fifth macro I've written named flense that does something relective on a class, but the end result is entirely different)
20:14gfredericksbecause I also want something a lot less messy than clojure
20:15gfredericksboth w.r.t. platform stuff, other weird edge cases, and impurity
20:16hiredmanis this subset going to ship with its own std library?
20:18gfrederickshiredman: yeah, though maybe heavily backed by clojure where appropriate; I'd want it to be logically untied to clojure
20:21hiredmanso you are thinking a real language, that you would write a program in (as opposed to a fragment of a program I guess?) where you would define functions that could be reused in other parts of the program?
20:23gfrederickshiredman: yeah I think that and the related question of libs are the biggest thing I'm not sure about
20:24gfredericksand probably like 20 other thorny issues I haven't even thought of yet
20:26hiredmanthere is a design space between clojure and more declarative data dsls (like sql, specter, etc), but I have a heard time imagining something in that design space being particular useful
20:26gfredericksyeah :/
20:28rhg135specter itself leans on clojure to actually manipulate data
20:33gfredericksI've just got this soft spot for perfect ideal abstractions without messy host/perf-based edge cases
20:35gfredericksugh and I'd have to have opinions about exception handling too, this would be the biggest yak...
20:36amalloyjust declare your language unexceptional
20:36gfredericksnothing can crash
20:37gfredericksyou could take the haskell approach and say you can throw errors but not catch them
20:37gfredericksoh geez and what about laziness I hate everything
20:38amalloyyou can catch them in haskell though
20:38amalloyit's just discouraged
20:38gfredericksonly in IO right?
20:38amalloywell, in the monad that your errors live in. so you can catch IO exceptions in IO, or Either exceptions in Either...
20:39gfredericksI was talking about (head []) in particular
20:40rhg135division by zero too
20:40gfredericksright
20:43amalloyright, those are IO exceptions
20:44gfredericksand the others don't apply because gfrlang doesn't have monads
20:44rhg135I guess technically moving electrons qualifies as io