workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
clojurians
clojure
also, lucky they did those better things, because they made spec! and now that validation is trivially added in a uniform way rather than ad-hoc
2017-12-08T17:50:35.000227
Aldo
clojurians
clojure
<@Kareen> my line of question was in general not with respect to only core members.
2017-12-08T17:53:44.000027
Deandrea
clojurians
clojure
it’s was more of “i’ve seen this GIGO thing be used as a rationale in the context of the clojure community and i’m curious what motivates it.”
2017-12-08T17:54:18.000346
Deandrea
clojurians
clojure
right, I was assuming we were specifically talking about core
2017-12-08T17:54:41.000169
Kareen
clojurians
clojure
<@Deandrea> The community cannot change clojure.core without the approval of one person. If someone else gives a rationale for what changes in clojure.core, or does not change in clojure.core, it is based on their interpretation/guesstimate of the reasons.
2017-12-08T17:55:40.000292
Micha
clojurians
clojure
hey, someone write specs for the clojure.set functions and file a patch
2017-12-08T17:57:26.000237
Sonny
clojurians
clojure
there you go :)
2017-12-08T17:57:44.000253
Kareen
clojurians
clojure
My interpretation is that "can't be bothered to add the checks" seems unlikely for things like clojure.set functions, since many people would have been happy to provide patches for those years ago if they were desired by the core developer team. spec being a far more general tool is fantastic, and I'm glad it was created.
2017-12-08T17:57:52.000244
Micha
clojurians
clojure
that’d be like, useful
2017-12-08T17:57:59.000059
Sonny
clojurians
clojure
you don’t even have to wait for them to be in core to use them
2017-12-08T17:58:10.000329
Sonny
clojurians
clojure
<@Micha> i understand that, however, my question was more broad in scope. i’m not calling out clojure core, the libraries, or the members. it was a question for the room in the context of the community purely because i’ve seen it be a rationale for doing something not bound by the performance reason.
2017-12-08T17:58:16.000345
Deandrea
clojurians
clojure
just put ’em in a namespace and load them
2017-12-08T17:58:20.000034
Sonny
clojurians
clojure
the typing thing, well, that’s effectively a fallacy (in my opinion).
2017-12-08T17:59:13.000132
Deandrea
clojurians
clojure
to say “i won’t do _x_ because typing” can be a fine argument in certain situations but in general it’s very weak.
2017-12-08T17:59:45.000272
Deandrea
clojurians
clojure
the point was simply that you see that kind of beahaviour less in typed languages (at an unacceptable cost). again. not a rationale. a statement
2017-12-08T18:00:59.000054
Aldo
clojurians
clojure
in my experience, writing specs for core stuff can bring out many subtle questions. going through those and teasing apart what is expected, what works but is unexpected, and what doesn’t work now but we might want to work in the future has some measure of art to it.
2017-12-08T18:01:00.000243
Sonny
clojurians
clojure
the way i read that argument is “my program won’t/will have this set of properties because (not) typing”.
2017-12-08T18:01:04.000223
Deandrea
clojurians
clojure
I don't understand what "typing" you mean here :) the fingers on a keyboard one or the holy war one
2017-12-08T18:01:48.000346
Kareen
clojurians
clojure
<@Kareen> fingers on the board.
2017-12-08T18:02:07.000066
Deandrea
clojurians
clojure
i don’t believe in arguing about static vs dynamic typing. it’s a pointless endeavor. folks should be open to good ideas period and stop obsessing about typing discipline.
2017-12-08T18:02:56.000163
Deandrea
clojurians
clojure
congrats on clojure 1.9.0!
2017-12-08T18:03:01.000395
Johana
clojurians
clojure
i’m actually filled with a bit of dread now because it means i have to finish garden 2.0.0. :joy:
2017-12-08T18:03:34.000081
Deandrea
clojurians
clojure
I’m celebrating with some Templeton Rye 6 year myself :)
2017-12-08T18:03:43.000087
Sonny
clojurians
clojure
Your rye should be older than your programming language :slightly_smiling_face:
2017-12-08T18:04:54.000028
Bibi
clojurians
clojure
I celebrated by upgrading our dev branch and pushed to staging
2017-12-08T18:05:13.000072
Johana
clojurians
clojure
Or scotch
2017-12-08T18:05:15.000289
Bibi
clojurians
clojure
I have some scotch that would qualify, but I keep coming back to this Templeton lately
2017-12-08T18:05:37.000341
Sonny
clojurians
clojure
3pm PST, I’m in for 1.9.0 scotch :smile:
2017-12-08T18:06:07.000022
Charity
clojurians
clojure
line ’em up
2017-12-08T18:06:23.000172
Sonny
clojurians
clojure
Congratulations Alex
2017-12-08T18:06:27.000071
Charity
clojurians
clojure
"Ahhh, the 1.9.0 --- that was a good version for Scotch..."
2017-12-08T18:06:42.000214
Micha
clojurians
clojure
ahaha
2017-12-08T18:06:48.000217
Deandrea
clojurians
clojure
:smile:
2017-12-08T18:06:51.000186
Charity
clojurians
clojure
they really don’t know how to do version numbers well in scotch
2017-12-08T18:06:57.000055
Sonny
clojurians
clojure
branching strategies are crazy
2017-12-08T18:07:09.000022
Sonny
clojurians
clojure
it’s like they were all drunk or something
2017-12-08T18:07:31.000092
Sonny
clojurians
clojure
on to Clojure 1.10 :)
2017-12-08T18:07:53.000037
Sonny
clojurians
clojure
<@Sonny> Out of curiosity, was it just waiting for bug reports or actually still fixing stuff in the last few weeks?
2017-12-08T18:07:59.000156
Johana
clojurians
clojure
well the last few weeks has mostly been me rewriting the docs over and over at Rich’s direction :)
2017-12-08T18:08:21.000317
Sonny
clojurians
clojure
Gotta make sure the docs don't over-promise :slightly_smiling_face:
2017-12-08T18:08:43.000335
Micha
clojurians
clojure
but also giving it some soak time in case anything came up
2017-12-08T18:08:46.000037
Sonny
clojurians
clojure
Sorry, I couldn't resist. Bad me[
2017-12-08T18:08:56.000173
Micha
clojurians
clojure
no, that’s true :)
2017-12-08T18:09:05.000330
Sonny
clojurians
clojure
<@Micha> as long as the specs are valid :wink:
2017-12-08T18:09:13.000090
Johana
clojurians
clojure
may all your specs be valid
2017-12-08T18:09:21.000052
Sonny
clojurians
clojure
scottish blessing I think
2017-12-08T18:09:33.000042
Sonny
clojurians
clojure
:thumbsup_all: to the CLI stuff.
2017-12-08T18:10:15.000187
Deandrea
clojurians
clojure
Hi! Can you guys give me an idea of how to try to resolve this? I have a test that calls a functions. This functions executes an async task. Locally if I use a `(Thread/sleep 4000)` I can assert my data just fine. But, after I build my application on travis, the build stop in this test and never finalize the build. Someone hava already seen this?
2017-12-08T18:12:04.000318
Audie
clojurians
clojure
<@Audie> are you able to patch your test (or code) in such a way that it does not require the task to be executed asynchronously? i know that’s not answering your question, however, it’s one i would ask myself in that situation.
2017-12-08T18:14:03.000124
Deandrea
clojurians
clojure
<@Deandrea> I don’t see a way to do that. I have to call this async function and wait for the entire process to finish. Otherwise, when I go to the database the data is not there yet
2017-12-08T18:16:37.000219
Audie
clojurians
clojure
`(Thread/sleep)` is the only way I thought how to do it
2017-12-08T18:18:00.000254
Audie
clojurians
clojure
<@Audie> you could use a promise or a future.
2017-12-08T18:18:31.000336
Deandrea
clojurians
clojure
<@Audie> actually i think a promise sounds like it might do the trick. you could create a promise, then execute your async task and, upon completion, deliver a value to the promise. at the end of the test you could simply dereference the promise as to block the thread and keep the build from exiting.
2017-12-08T18:21:08.000253
Deandrea
clojurians
clojure
``` (let [p (promise )] (do-async-stuff ,,, (deliver p some-val)) (deref p)) ```
2017-12-08T18:21:48.000190
Deandrea
clojurians
clojure
someone else might have a more elegant solution.
2017-12-08T18:22:57.000164
Deandrea
clojurians
clojure
but if use promise i’ll have to change the async task to put a value in the promisse right?
2017-12-08T18:23:11.000288
Audie
clojurians
clojure
sounds like that’s the place in the code you need to patch.
2017-12-08T18:23:34.000077
Deandrea
clojurians
clojure
so, yes. you need to be able to deliver to the promise when the async task completes. i’m guessing there’s probably a function or something that gets handed to whatever does the async work.
2017-12-08T18:24:31.000251
Deandrea
clojurians
clojure
i hope i’m helping… :sweat_smile:
2017-12-08T18:25:21.000101
Deandrea
clojurians
clojure
I see.. thanks for the help! I’ll try to fix this
2017-12-08T18:29:38.000098
Audie
clojurians
clojure
```(defn foo [x] {:post (some? %)} x)``` may look like it works but it actually asserts `some?` (truthy) and then asserts `%` (the value returned from `foo`) so it needs to be ```(defn foo [x] {:post [(some? %)]} x)``` although the following actually works too -- but looks odd: ```(defn foo [x] {:post (%)} x)``` (`[%]` works the same as `(%)` here -- it's just a sequence of forms to evaluate with `%` bound to the function result. _This was a surprise to me when I tried it in the REPL!_
2017-12-08T18:35:14.000023
Daniell
clojurians
clojure
for implementing a forth interpreter, is vector or list better matched for storing the stack ?
2017-12-08T18:40:13.000041
Berry
clojurians
clojure
<@Daniell> yes, that was a typo.
2017-12-08T18:40:30.000030
Deandrea
clojurians
clojure
thank you for catching that.
2017-12-08T18:40:39.000156
Deandrea
clojurians
clojure
<@Berry> if you use conj/peek/pop, vectors and lists behave the same as stacks
2017-12-08T18:41:21.000211
Kareen
clojurians
clojure
<@Deandrea> I was genuinely surprised it "worked" -- I rarely use `:pre`/`:post` so I nearly always have to look up the syntax!
2017-12-08T18:41:34.000149
Daniell
clojurians
clojure
<@Kareen>: sure, but I suspect they have different performance characteristics
2017-12-08T18:41:50.000112
Berry
clojurians
clojure
I tend to use vectors as stacks just because `pop-n` and `peek-n` are easier to implement efficiently on vectors
2017-12-08T18:41:52.000171
Kareen
clojurians
clojure
<@Berry> +1 for vectors. and enjoy the concatenative journey. :slightly_smiling_face:
2017-12-08T18:42:01.000107
Deandrea
clojurians
clojure
<@Berry> no, all those operations are constant time on both vectors and lists
2017-12-08T18:42:07.000090
Kareen
clojurians
clojure
<@Kareen>: I think vector is log_32 #-elemes, which is &lt;= 5 in most caeds, but technically log n
2017-12-08T18:42:31.000019
Berry
clojurians
clojure
Hey <@Berry> If you want Clojure + Forth, take a look at <https://gershwin.github.io/> :slightly_smiling_face:
2017-12-08T18:43:01.000135
Daniell
clojurians
clojure
I was actually sufficiently awed by Gershwin at one point that I tried it out at work and wrote a few functions in the "Forth" style of Clojure! :slightly_smiling_face:
2017-12-08T18:43:51.000099
Daniell
clojurians
clojure
<@Berry> no that's not correct, conj/pop/peek on vectors are amortized constant time, not log_32, nth/assoc are log_32 on vectors
2017-12-08T18:44:12.000247
Kareen
clojurians
clojure
<@Daniell>: I've lost track the # of afternoons I've lost due to you providing fasicnating links.
2017-12-08T18:44:16.000167
Berry
clojurians
clojure
(but since it relies on a fork of Clojure and wasn't being updated, I quickly went back to pure Clojure)
2017-12-08T18:44:31.000204
Daniell
clojurians
clojure
<@Kareen>: conj has to be log_32 time as it has to create a new node for every level of the b-tree
2017-12-08T18:45:15.000020
Berry
clojurians
clojure
clojure's persistent vectors are not b-trees
2017-12-08T18:45:36.000319
Kareen
clojurians
clojure
I thought they were btrees with 32 fanout -- if not btrees, what are they?
2017-12-08T18:45:58.000254
Berry
clojurians
clojure
<http://hypirion.com/musings/understanding-persistent-vector-pt-1>
2017-12-08T18:46:25.000004
Kareen
clojurians
clojure
<@Berry> if you’re interested have a look at factor, joy, cat, and kitten in this space as well.
2017-12-08T18:46:50.000266
Deandrea
clojurians
clojure
factor is a ton of fun.
2017-12-08T18:47:13.000243
Deandrea
clojurians
clojure
<@Berry> in particular <http://hypirion.com/musings/understanding-persistent-vector-pt-3>
2017-12-08T18:47:17.000098
Kareen
clojurians
clojure
this is the optimization that makes conj amortized constant time
2017-12-08T18:47:26.000236
Kareen
clojurians
clojure
same for pop/peek
2017-12-08T18:47:55.000120
Kareen
clojurians
clojure
1. the depth of the tree is log_32 n 2. when we do a conj, we have to create a new node at each level of the tree ^-- which is the two above statements is false ? -- because if they're both true, it's log_32 n time EVERY TIME
2017-12-08T18:48:31.000363
Berry
clojurians
clojure
2 is not true
2017-12-08T18:49:07.000290
Kareen
clojurians
clojure
``` Instead of keeping the rightmost leaf in the tree itself, we keep a direct reference to it in the vector header: That's the last block which has been added to the vector head since last blogpost. The reference to the rightmost leaf node is called the tail. ``` ah
2017-12-08T18:49:55.000250
Berry
clojurians
clojure
that's clever; bronsa++
2017-12-08T18:49:59.000135
Berry
clojurians
clojure
well I didn't come up with any of this
2017-12-08T18:50:15.000146
Kareen
clojurians
clojure
thanks for correcting me on this time, I've been thinking conj was log_32 n time
2017-12-08T18:50:33.000086
Berry
clojurians
clojure
:smile:
2017-12-08T18:50:33.000299
Deandrea
clojurians
clojure
wrt "what are they", I've heard the clj vector impl called bitmapped vector trie, not sure if there's a better name
2017-12-08T18:50:49.000176
Kareen
clojurians
clojure
<@Daniell>: I feel like we can get most of forth in clojure by defining macro `f-&gt;`, where it behaves like `-&gt;` except 1. if it sees a constant (number, kw, string), it pushes it to the stack 2. all functionsin it take stack as input and produces stack as output
2017-12-08T18:52:17.000298
Berry
clojurians
clojure
<@Berry> the thing is though you’ll need to come up with a way to call out how much of the stack to consume for fn’s that have multiple arities.
2017-12-08T18:57:08.000126
Deandrea
clojurians
clojure
e.g. how do you interpret `["foo" "bar" "baz" str]`?
2017-12-08T18:57:32.000165
Deandrea
clojurians
clojure
<https://twitter.com/brandonbloom/status/528262785642545153> this is still my favourite impl of stack programming in clojure :)
2017-12-08T18:58:11.000004
Kareen
clojurians
clojure
<https://github.com/brandonbloom/factjor> for a more useful impl
2017-12-08T18:58:49.000051
Kareen
clojurians
clojure
:+1:
2017-12-08T18:59:53.000016
Deandrea
clojurians
clojure
<@Deandrea>: afaik, forth doesn't support var-arity functions, so f-&gt; won't either
2017-12-08T19:00:52.000297
Berry