This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # aws-lambda (1)
- # bangalore-clj (4)
- # beginners (66)
- # boot (13)
- # cider (9)
- # cljs-dev (44)
- # cljsjs (3)
- # clojure (181)
- # clojure-austin (2)
- # clojure-greece (6)
- # clojure-italy (2)
- # clojure-russia (64)
- # clojure-sg (1)
- # clojure-spec (68)
- # clojure-uk (60)
- # clojurescript (66)
- # conf-proposals (12)
- # cryogen (1)
- # cursive (3)
- # datomic (44)
- # graphql (1)
- # hoplon (2)
- # jobs (2)
- # jobs-discuss (3)
- # keechma (2)
- # liberator (6)
- # luminus (2)
- # nyc (1)
- # off-topic (92)
- # om (10)
- # onyx (17)
- # parinfer (39)
- # pedestal (8)
- # proton (11)
- # re-frame (110)
- # reagent (2)
- # remote-jobs (11)
- # ring-swagger (9)
- # rum (2)
- # sql (2)
- # test-check (6)
- # untangled (138)
@qqq re MySQL https://dev.mysql.com/doc/refman/5.7/en/insert-on-duplicate.html. (Sorry for answering this old question, it looked like the latest one in slack but now I got the rest...)
Slack's UI blocks on notification sends. So if your notification agent locks up, slack will silently lock up every time someone pings you. That's been a fun few hours finding out.
@gmercer @yonatanel @dominicm : thanks!
what a mess: https://www.reddit.com/r/webdev/comments/6i2yow/i_passionately_hate_webpack/
i feel like i just blinked and grunt/gulp became deprecated to this confusing build tool
it's a curious thing, that clojurians often stress (immutable) data over functions. but afaics, an immutable datum is indistinguishable from a "pure" (nullary) function. so why stress data over functions? after all many clj data structures behave as functions, maps for example. "everything is a function" works a lot more smoothly than "some things are fns and some are data", no?
but functions are opaque and easily have hidden side effects, sanely constructed data is transparent and lacks side effects
clojure’s design tends to prefer explicit and transparent over implicit and hidden
but really lazy-seqs are in a fuzzy place here, since someone can easily hide side effects in the generator, or it could just be very expensive resources wise to generate item n+1
"functions", by definition, have no side effects. theoretically, at least, there are no data, only functions (lambda calculus).
computational routines may have side-effects, but then they do not represent functions.
"functions", by definition, have no side effects. - that's only one (and not the most common) usage of the word "function" in programming
"a subroutine may be called a procedure, a function, a routine, a method, or a subprogram." (https://en.wikipedia.org/wiki/Subroutine)
well, people can use a word however they please, of course. but "function" is pretty well-defined.
it has different meanings in different contexts, and in the context of programming languages, I often use "function" and "subroutine" interchangably
obviously there are no (or few) true functions in a program. but we can and do entertain the fiction which helps us reason.
then how do you distinguish between routines that emulate fns (no side effects) and those that do not? anyway my point is about the elevation of "data".
ever heard of pure functions? 🙂
anyway, I also found it interesting that in some programming languages (like elm, maybe haskell?), vars are simply 0-arity functions
in those languages they're also used ("invoked") the same way as functions, whereas in lisp or C-like languages, application must be requested explicitly (using parentheses)
but clojure's point is that data is better because it's transparent: it can be serialized, it wears its nature on its sleeve
fwiw i've been trying (again!) to grok category theory. there, you can discard objects (data?) in favor of arrows (fns?)
how do you iterate over a function? how do you transform a function?
'(1 2 3) can be manipulated more directly than
(fn  (cons 3 (cons 2 (cons 1 nil))))
in the vm we have available, introspecting a fn is sloppy and error prone
in that same vm, introspecting data is straightforward
@pesterhazy that's just syntax. the result is the same.
@mobileink it’s not just syntax - the type of (fn …) is just a class, and you can’t walk its internals - you have to make it return somethign, unless you want to be an oracle and interpret its bytecode
@mobileink could you help me clarify my thinking by distinguishing what you’re talking about from macros, which are the treatment of a representation of code as if it were data?
wow I just saw that @noisesmith made my point already, sorry for reiterating without attributing
@noisesmith they both must be evaluated before you can do anything with them. adding fn just rearranges things.
i understand. i guess what i don’t understand is what representation of a function we are treating as data. some notion of its internal logic? but a representation of that logic that is neither a. whatever incidental bytecode results or b. syntax?
take maps or vectors as an example. usually treated as data. but i maintain it's better to think of them as fns - which clojure does.
but I can check for keys in a map easier than I can check for which arguments a function accepts
our functions don’t reveal themselves the way our data does
what if a map could hold keys representing predicates? could there be a way for a map to be a transparent
cond of some kind?
it’s not an accident, it’s fundamental to the language’s model, and the model you want would require writing a new vm
it wouldn’t allow using the host vm like we do now (if we care about efficiency like, at all)
but a map is “typed” in a way that a function is not - you can introspect and see exactly the args it responds to
not just the types of args, but specific arg values
yes, definitely; the case i was asking about would require some first-class notion that the map is keyed by a subset of functions
@pesterhazy , @noisesmith we can also write
(fn  (fn  .... )), but so what?
@noisesmith what do you mean by "introspect"? keys?
or anything else that lets me look at the structure contained inside the map
functions as we know them have implicit structure that is a side effect of their bytecode as it acts on an input
a hash-map has an explicit well known structure
I’d be interested to see how the language you are suggesting would work, but it seems very strange to me
even in the languages I know of that have inspectable functions (unlike clojure), they aren’t inspectable in a declarative form one can easily reason about
the point i'm failing to make is that there is no prinicipled reason to privilege data over fns, conceptually. the stuff we've been talking about is mostly implementation detail.
or, the diff between a simple clojure map qua fn and a big hairy defn is one of degree, not kind.
does anyone use elasticsearch? i'm thinking of adding logging from some applications and the indexing from a .NET application seems really slow
there are some internals you can manipulate, like the size of the internal bulk-indexing queue
do you use outside processes to send things (like logstash) or do you index from your applications?
usually over a pretty long period--or rather we could afford to wait. rare that we’ve had to write all of them cold. if we did, the bottleneck would probably be calculation, not indexing, since they’re the result of a fairly compute-intensive process
if we had to outright replace the index from known good data, i think it took…8 hours? but that’s highly anecdotal/secondhand
apologies if you already know any of these other points, but they were new to us, so in case they help: * ES loves bulk writes instead of many small requests * docs cannot be partially updated; they’re always outright replaced, even if using things like the groovy API to perform updates “in place”