workspace
stringclasses
4 values
channel
stringclasses
4 values
text
stringlengths
1
3.93k
ts
stringlengths
26
26
user
stringlengths
2
11
clojurians
clojure
for eg. `(def xs (take 1 (drop 40000000 (iterate inc 1)))`
2017-12-15T18:08:18.000065
Jonas
clojurians
clojure
sometimes the repl messes things up
2017-12-15T18:09:04.000347
Jonas
clojurians
clojure
since it assigns the whole sequence to `*1`
2017-12-15T18:09:38.000161
Jonas
clojurians
clojure
which means it is hanging onto the head
2017-12-15T18:09:45.000139
Jonas
clojurians
clojure
try `(first (take 1 (drop 40000000 (iterate inc 1))))`
2017-12-15T18:10:05.000148
Jonas
clojurians
clojure
but `(println (take 1 (drop 40000000 (iterate inc 1))))` will also run out of memory
2017-12-15T18:10:18.000127
Lester
clojurians
clojure
same
2017-12-15T18:10:33.000040
Lester
clojurians
clojure
hm
2017-12-15T18:10:35.000195
Lester
clojurians
clojure
puzzling
2017-12-15T18:10:40.000354
Lester
clojurians
clojure
will it?
2017-12-15T18:12:31.000243
Rebeca
clojurians
clojure
it does
2017-12-15T18:12:50.000020
Jonas
clojurians
clojure
on the <http://repl.it|repl.it> site
2017-12-15T18:12:55.000052
Jonas
clojurians
clojure
oh
2017-12-15T18:12:58.000337
Rebeca
clojurians
clojure
who knows what <http://repl.it|repl.it> does
2017-12-15T18:13:03.000202
Rebeca
clojurians
clojure
as someone who runs a publicly accessible code sandbox, I can tell you they are never vanilla and extrapolating behavior to the "real" thing is fraught
2017-12-15T18:14:59.000356
Rebeca
clojurians
clojure
is core.async still active?
2017-12-15T19:07:19.000143
Williemae
clojurians
clojure
or is there a preferred alternative now
2017-12-15T19:07:26.000018
Williemae
clojurians
clojure
there’s definitely nothing that replaces it
2017-12-15T19:07:38.000110
Margaret
clojurians
clojure
i guess there’s a little activity, going through the commit history. It’s always a little disconcerting when you look at a repo and the only thing that’s changed in the last few months is the version number :stuck_out_tongue:
2017-12-15T19:11:22.000009
Williemae
clojurians
clojure
one factor here is how strong clojure is for compatibility - which means clojure libraries don’t need to churn to stay compatible
2017-12-15T19:12:28.000099
Margaret
clojurians
clojure
(comparatively at least to other ecosystems)
2017-12-15T19:12:45.000159
Margaret
clojurians
clojure
yeah fair enough.
2017-12-15T19:13:01.000132
Williemae
clojurians
clojure
and core.async is not something that would be getting many security updates - if outside data is directly driving core.async that’s your security problem right there
2017-12-15T19:14:05.000157
Margaret
clojurians
clojure
it’s mainly a bunch of macros
2017-12-15T19:14:14.000018
Margaret
clojurians
clojure
<@Williemae> Many people new to Clojure are surprised that a lot of heavily used libraries seem to be "inactive" based on the commit history. This is often due to a library being stable, mature, and "complete" -- since it is common for libraries to have a narrow focus and therefore they are often smaller and simpler than you might find in other languages.
2017-12-15T19:25:34.000010
Daniell
clojurians
clojure
It also seems like some stable libraries that have been in use for years and are still maintained are still at a sub-one version number, which I find disconcerting.
2017-12-15T19:27:31.000198
Thu
clojurians
clojure
hard to imagine “complete” software ;)
2017-12-15T19:28:00.000012
Williemae
clojurians
clojure
So if you can't necessarily go by commits or github stars how can you tell?
2017-12-15T19:29:31.000203
Floretta
clojurians
clojure
<https://crossclj.info> is useful for seeing which libs are used by open source projects
2017-12-15T19:30:22.000174
Margaret
clojurians
clojure
and anything from the clojure.core team will say prominently that it isn’t ready for usage if that’s the case
2017-12-15T19:30:54.000056
Margaret
clojurians
clojure
<@Williemae> here's my take on the same question from several months ago. It comes up a lot in the Clojure community: <https://www.reddit.com/r/Clojure/comments/5vjq54/whats_the_reason_of_clojure_having_lots_of/de2w8vx/>
2017-12-15T19:44:01.000262
Buck
clojurians
clojure
How often do Java standard libs change?
2017-12-15T19:56:10.000127
Silas
clojurians
clojure
<@Thu> I think that's mostly a weird historical quirk. Leiningen templates typically create a 0.1.0-SNAPSHOT project (I think?) and so folks start from there and go to 0.1.1 etc...
2017-12-15T19:57:04.000137
Daniell
clojurians
clojure
I do feel something in Clojure which is sometimes weird is certain things are like half standard libs, yet library. Like core.async, you can pretty much consider it a part of the standard library, yet you need to pull it in as a dependency to use it.
2017-12-15T19:57:45.000108
Silas
clojurians
clojure
I’ve had people look askance when I update to a 1.x.x release - my reasoning being that this means bumping to that promises that the public facing api won’t change until that 1 becomes a 2
2017-12-15T19:58:11.000056
Margaret
clojurians
clojure
...also, we used to have a monolithic Clojure Contrib library which was versioned along with Clojure itself and was at 1.2.0 when it was deprecated and broken up into the seed of what we have today -- and they all started out at 0.1.0(!). I believe one of them has reached 1.0.0 (maybe more than one? but only a few).
2017-12-15T19:58:37.000127
Daniell
clojurians
clojure
(that is, when I bump up my own project version from 0.x.x to 1.x.x)
2017-12-15T19:58:39.000102
Margaret
clojurians
clojure
`clojure.java.jdbc` for example just released `0.7.4` yesterday after about six years of updates.
2017-12-15T19:59:16.000030
Daniell
clojurians
clojure
I just happen to be coming over from the javascript/node community where 0.x.x means “use at your own risk” and “1.x.x” means “ready for public consumption”
2017-12-15T19:59:37.000037
Thu
clojurians
clojure
any particular reason to never call a release 1.0.0 ?
2017-12-15T19:59:46.000094
Margaret
clojurians
clojure
@Justin yeah in my experience version strings are much less meaningful in the clojure ecosystem
2017-12-15T20:00:13.000294
Margaret
clojurians
clojure
I see lots of libraries that seem to be asymptotically approaching 1.0.0, which is fine as long as you understand what the convention is.
2017-12-15T20:00:24.000006
Thu
clojurians
clojure
for context, clojure.data.json had an incompatible api change before 1.0.0 and there was an uproar about the incompatibility (we wouldn’t have nearly as many cheshire users today if that had never happened I think)
2017-12-15T20:01:26.000005
Margaret
clojurians
clojure
But if you are just casually investigating, say, a react javascript stack vs. a reasonml stack vs. clojurescript, you can be left with the impression that everything is half-assed and broken because nothing has reached a “stable” release, which I think is a mistaken impression.
2017-12-15T20:01:45.000199
Thu
clojurians
clojure
It's definitely mistaken, that's basically software astrology
2017-12-15T20:02:41.000131
Buck
clojurians
clojure
"well you were born in the year 1.0.0, so that means you're still young but your API is stable" - sure, ok :slightly_smiling_face:
2017-12-15T20:03:15.000156
Buck
clojurians
clojure
<@Thu> There's also a cultural thing in Clojure about version numbers -- best seen in Rich Hickey's Spec-ulation talk (but he's hinted at it in a few other talks) -- that they don't really matter: libraries should grow through accretion of functionality (only) and never break backward compatibility for a particular group/artifact. So Clojurians don't "care" that a library has a low version number, as long as it provides the functionality they want...
2017-12-15T20:05:33.000148
Daniell
clojurians
clojure
...and libraries are often small and focused so it's also often easy to switch out a single library, and of course you end up with a large combination of libraries.
2017-12-15T20:06:19.000032
Daniell
clojurians
clojure
If the community really thinks that version numbers don’t matter, why not change them to what a lot of programmers expect? Just lop the 0 off if the library is stable. Boom, easy change in perception. Just my 2 cents as a newbie.
2017-12-15T20:08:54.000062
Thu
clojurians
clojure
``` (defn fu [obj funcs] (reduce (fn [val [k f]] (update val k f)) obj funcs)) (fu {:a 1 :b 2 :c 3 :d 4} {:a inc :b dec :d #(* % %)}) ``` I created this function, `fu`, short hand for `function update`, is there a builtin like it takes two maps as arguments; the second specifies how to update the first
2017-12-15T20:09:04.000145
Berry
clojurians
clojure
Here's a great thread about backward compatibility (on a library that has reached 0.14.2 after close to seven years of development) <https://github.com/clj-time/clj-time/issues/196>
2017-12-15T20:09:45.000106
Daniell
clojurians
clojure
<@Daniell> I think the backwards-compatibility culture is great. No arguments there.
2017-12-15T20:13:51.000127
Thu
clojurians
clojure
<@Thu> essentially, Clojure has a different set of cultural norms when it comes to software compatibility that get us the result we're after. It's rare for people to be burned by breakages between versions, so there is literally no pressure on the community to organize around a version number scheme, because it would convey no useful information.
2017-12-15T20:16:51.000034
Buck
clojurians
clojure
Other communities (especially extremely large, diverse communities) use version numbers as a mechanism for signaling how much confidence you should have in their software
2017-12-15T20:17:39.000109
Buck
clojurians
clojure
<@Thu> The specific issue in that thread is that we all decided that we couldn't change the implementation since it would change the API and so it would need to use a different group/artifact in order not to cause problems (because an application can easily pull in multiple versions of the same group/artifact and only one will win -- so that must provide an API that _every library you pulled in_ can still use).
2017-12-15T20:18:48.000088
Daniell
clojurians
clojure
(and the transient dependency conflict issue is also partly why folks are so conservative about change here -- since small, focused libraries get widely used by other libraries!)
2017-12-15T20:20:03.000192
Daniell
clojurians
clojure
<@Buck> <@Daniell> Yea I totally get what you guys are saying, and I think all that is really great and commendable. What I’m saying is instead of sticking on 0.x.x forever, just bump to 1.x.x. That communicates “stable, use me” to every potential recruit from JS/node and probably lots of other communities as well. You don’t have to go full semver, since, as you guys are pointing out, that isn’t useful given the cultural norms.
2017-12-15T20:21:56.000121
Thu
clojurians
clojure
&gt; for context, clojure.data.json had an incompatible api change before 1.0.0 and there was an uproar about the incompatibility (we wouldn’t have nearly as many cheshire users today if that had never happened I think) I guess if you’re not using major versions to indicate breaking changes then your versioning system may be somewhat arbitrary. In that case maybe think about using the Ubuntu versioning system.
2017-12-15T20:24:24.000128
Williemae
clojurians
clojure
<@Buck> thanks for the link, i’ll give it a read
2017-12-15T20:24:50.000140
Williemae
clojurians
clojure
I understand what you’re saying there but it’s often difficult to know if you’re looking at a timeless `g722.c` or someone’s half-baked lib that they haven’t touched in 3 years unless you have greater context on the community.
2017-12-15T20:26:45.000007
Williemae
clojurians
clojure
The reason why not is pretty simple. If I went to the JS community and said "please just write software that is generally backwards compatible so I don't have to care about the version number", it would not fly very far. Not because there's anything wrong with the JS community, it's just that I'm asking them to change a cultural norm to suit myself.
2017-12-15T20:27:24.000107
Buck
clojurians
clojure
The kubernetes project for instance has yet another set of cultural norms that differ from JS and Clojure communities. It goes on and on.
2017-12-15T20:28:09.000050
Buck
clojurians
clojure
(which is an interesting read, by the way: <https://kubernetes.io/docs/reference/deprecation-policy/>)
2017-12-15T20:28:51.000042
Buck
clojurians
clojure
but yes i would rather have something that works and is stable than something that has bugs and people are constantly fiddling with, if those are my options.
2017-12-15T20:29:10.000006
Williemae
clojurians
clojure
<@Buck> Except that the suggestion is that you could change something that you yourself are saying doesn’t matter to you and is arbitrary anyway and might help people use clojure.
2017-12-15T20:29:21.000016
Thu
clojurians
clojure
Clojure has areas that need help much more seriously :slightly_smiling_face: The person it would be helping is the newcomer who is initially confused, but pretty quickly learns the ropes. If anything I think this cultural norm has become a source of pride and rite of passage. And from a technology perspective, we're starting to explore a world where we leave version numbers behind *entirely*, if you read between the lines of Rich's keynote from last year.
2017-12-15T20:35:14.000025
Buck
clojurians
clojure
I think all your comments are perceptive though, you are totally right that it's confusing to a newcomer more accustomed to different norms. There are many more things in Clojure that will bake your noodle than just this, trust me :wink:
2017-12-15T20:37:43.000052
Buck
clojurians
clojure
Personally I don’t mind the version numbers so much. In a lot of cases they’re pretty arbitrary/meaningless. Sometimes it’s useful to indicate that stuff will break (or at least stop your package manager from updating to the breaking changes) but for the most part the numbers are not terribly valuable information.
2017-12-15T20:38:30.000029
Williemae
clojurians
clojure
I’ve been updating the DigitalOcean API last night/today to add some new features to it that they’ve added in the past couple years and it’s pretty remarkable how little code it is. I’ve only really toyed around with Clojure a bit but now that I’m more independent I want to use it more seriously. It’s pretty nice having a rest api wrapper that is only, you know, ~3 lines of code per call
2017-12-15T20:40:43.000057
Williemae
clojurians
clojure
Really the only time I'm properly alert for a sense of "abandonment" is when the code interfaces with another system that I know has evolved a great deal since then. Like, a Kafka wrapper that's several years old.
2017-12-15T20:42:20.000049
Buck
clojurians
clojure
But oftentimes I'll open that project up and read the source (because most of the time it's 3 lines long so it's quick to read :wink: ) to see what approach they took. The cost of spinning my own, updated take on it is often pretty low.
2017-12-15T20:43:17.000089
Buck
clojurians
clojure
(I mostly do C++ to pay the bills though so the levels of verbosity are quite different heh)
2017-12-15T20:44:05.000078
Williemae
clojurians
clojure
My office mate is trying to convince me of the virtues of modern C++ template metaprogramming because now there are control structures or some such in there
2017-12-15T20:45:04.000079
Buck
clojurians
clojure
So I'm quietly waiting for the right moment to re-implement his thing in a couple of lines of macro :wink:
2017-12-15T20:45:44.000048
Buck
clojurians
clojure
well, constexpr makes templates nicer so you can do stuff like `if constexpr (std::is_same&lt;T, U&gt;()) { .. } else { ... }` instead of having specialization or doing the integral constants hack.
2017-12-15T20:47:10.000021
Williemae
clojurians
clojure
so there are some nice things in modern c++, but it’s still pretty verbose compared to clojure
2017-12-15T20:47:33.000095
Williemae
clojurians
clojure
that said you gotta pick the right tool… I doubt I’m gonna write any media servers in Clojure anytime soon, likewise I doubt I’m going to make a rest service in C++ anytime soon.
2017-12-15T20:48:39.000151
Williemae
clojurians
clojure
Is there a Clojure function that will take: as input: ``` float sum (int n, float * in) { float ans = 0.0 ... return sum } ``` then, compile this function, and let me call it, passing it an int and float-array ?
2017-12-15T20:48:55.000029
Berry
clojurians
clojure
<@Berry> compile it such that you can invoke it from java?
2017-12-15T20:50:22.000093
Buck
clojurians
clojure
yeah, I want it to take the string, compile it as a . function, then load it so I can invoke it from Clojure via Java
2017-12-15T20:50:42.000102
Berry
clojurians
clojure
I think something like crossClj is actually a better way to judge maturity, reliability etc. Would be nice if there was a little github badge thing that would show the number of projects that have a dependency on the current repo. And maybe show how many new things took a dependency on it in the last month.
2017-12-15T20:53:17.000107
Silas
clojurians
clojure
I'm having a hard time wrap my mind over this code
2017-12-15T21:10:26.000072
Krysta
clojurians
clojure
How exactly does this code work?
2017-12-15T21:10:41.000037
Krysta
clojurians
clojure
also `(def fib (concat [1 1] (lazy-seq (map + (rest fib) fib))))`
2017-12-15T21:11:10.000008
Krysta
clojurians
clojure
I can write it, but I don't fully understand it
2017-12-15T21:11:20.000065
Krysta
clojurians
clojure
<@Krysta> I'll attempt to explain the `fib` definition... It's an infinite lazy sequence that starts with 1, 1, ... so that's `fib` within the body, so `(rest fib)` is 1, ... and so you're asking `map` to apply `+` to successive elements of both sequences (`map` produces its results in lazy chunks) so it'll produce 1 + 1 = 2, so now `fib` is 1, 1, 2, ... and we move on to the next element of each sequence argument to map and it produce 2 + 1 = 3, so now `fib` is 1, 1, 2, 3, ...
2017-12-15T21:25:09.000080
Daniell
clojurians
clojure
and now `map` adds 3 (from `(rest fib)` ) to 2 (from `fib`) and gets 5... `fib` is 1, 1, 2, 3, 5, ... and so on, step-by-step
2017-12-15T21:26:27.000022
Daniell
clojurians
clojure
The `lazy-seq` call just ensures that what's inside it doesn't try and evaluate anything until that part of the sequence is realized (asked for).
2017-12-15T21:27:11.000125
Daniell
clojurians
clojure
Does that help <@Krysta>?
2017-12-15T21:27:17.000104
Daniell
clojurians
clojure
<@Daniell> it helps a lot~ thx~
2017-12-15T21:43:45.000004
Krysta
clojurians
clojure
what's a good color for comment on a white background? I'm starting to find it's really important ot read the comments I write, they're just as important as code
2017-12-16T00:20:48.000024
Berry
clojurians
clojure
<@Berry> maybe check out the Nord color scheme for inspiration: <https://github.com/arcticicestudio/nord>
2017-12-16T00:23:46.000001
Buck
clojurians
clojure
or any solarized theme for your editor
2017-12-16T00:23:56.000040
Buck
clojurians
clojure
More inspiration here, esp. if you use IntelliJ: <http://color-themes.com/>
2017-12-16T00:24:25.000063
Buck
clojurians
clojure
If you want really general color stuff, you can visit <http://www.colourlovers.com> and find colors that are complementary, suggested palettes, etc
2017-12-16T00:25:07.000049
Buck
clojurians
clojure
maybe the right _emacs_ solution is to have a command taht toggles comments betseen #888 and #000 , depending on whether I want to read comments or not
2017-12-16T00:25:54.000045
Berry
clojurians
clojure
There's a ton of stuff you can do in emacs, including using org-mode in your comments, which supports folding
2017-12-16T00:26:39.000024
Buck
clojurians
clojure
I don't know if anyone else is doing this, or is this is intentional: I'm currently reading a book on type theory, taking notes in the form as comments --- and then IK convert these comments into SPEC definitions; so spec is turning into "executable invariants"
2017-12-16T01:09:27.000062
Berry
clojurians
clojure
can `|` be used in clojure at all? I want a way to separate elments in a vector, say `[:a :b :c | 1 2 3 | "more info" ]`
2017-12-16T02:52:43.000043
Berry
clojurians
clojure
<@Eliana> thanks for having responded! I am not sure why most experts ignored, is it because they seldom write transducers or they considered the topic too basic to their taste
2017-12-16T03:04:09.000014
Kalyn