This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-09-01
Channels
- # aleph (7)
- # bangalore-clj (1)
- # beginners (89)
- # boot (5)
- # clara (21)
- # cljs-dev (2)
- # cljsrn (57)
- # clojure (58)
- # clojure-austin (1)
- # clojure-conj (1)
- # clojure-italy (5)
- # clojure-losangeles (3)
- # clojure-russia (4)
- # clojure-sanfrancisco (4)
- # clojure-spec (31)
- # clojure-uk (67)
- # clojurebridge (4)
- # clojurescript (56)
- # cursive (92)
- # data-science (4)
- # datomic (15)
- # emacs (23)
- # events (1)
- # fulcro (121)
- # gorilla (2)
- # jobs-discuss (1)
- # juxt (1)
- # lambdaisland (6)
- # lumo (13)
- # off-topic (11)
- # om (1)
- # onyx (17)
- # overtone (5)
- # parinfer (9)
- # planck (3)
- # re-frame (21)
- # reagent (95)
- # ring-swagger (7)
- # spacemacs (58)
- # vim (13)
- # yada (2)
Is there a library for kafka with a core.async facade that works with kafka 0.11.0.0? kinsky
seems to be broken for >= 0.10.1.0
Ok I'm working with macros seriously for the first time. I have this body
`(~(edn/read-string f) ~@args)
, where f is an argument. However I need f to be evaluated, not just a symbol or a list (in case I want to pass, say (str g)
as f). How can I do this in a macro? Right now, I'm getting a class cast excpetion when I try to run the macro(defmacro run
[f & args]
`(~(edn/read-string (eval f)) ~@args))
(macroexpand '(run (str 'Math/max) 120 12))
And you could do:
(defmacro run
[f & args]
`((resolve (edn/read-string ~f)) ~@args))
(macroexpand '(run (str '+) 120 12))
@U1C03090C - f
will be evaluated automatically. Macros return an expression, and that expression is automatically evaluated, so since f
is part of the expansion, it will be evaluated. I'm guessing your class cast exception might be something else. Is args
a sequence?
I once wrote a blog post that has some good tips for writing macros and helps explain some of these concepts. Unfortunately, the blog is currently offline. (I'm hoping to get it online again soon.) In the meantime, I'll attach the content of the post for your reading pleasure.
How would you go about 'securing' a value in a data structure so that it would masked whenever printed. But when passed into the destination function (a java method) it was unmasked
Anyone actively using Kafka ? I was wondering, the Apache Kafka site lists 2 GH projects for Kafka bindings (https://cwiki.apache.org/confluence/display/KAFKA/Clients#Clients-Clojure.1) though one is has a failing build & no change in 2 years while the other has had no changes in 5(!) years. Are clojure people not using Kafka or is using the Java interop good enough(tm)?
We are using Kafka, but tbh we've not bothered with any of the clojure libs. We're just calling the Java stuff directly and have our own very thin shim over the top to, for e.g. turn a consumer into a lazy sequence of messages our code can read from
Is there a special naming convention for functions in clojure that throw an error instead of returning nil?
For example, I could have a function which finds a database record by ID and returns nil if it does not exist, and another function which throws an error if it does not exist
@pseud we're doing the same as @carr0t , wrapping the Java client. I'd be cautious about combining intrinsically I/O kafka with lazy sequences though, just my opinion
Works quite well in our case. Avoids the needs for loops etc, and just stops doing anything when we have no messages to consume
We do have to be careful that the lazy sequence is actually consumed when the output is side-effects, but we've got a standard pattern for that
Kinsky does not work with Kafka 10.1.0 or later, I ended up just using the java interop directly, works ok for general cases
Java interop is often the best option, even if clojure wrappers exist
yeah, I often have the feeling people are using a clojure wrapping not for pragmatic reasons but for aesthetic or sentimental ones
and that they could save a lot of trouble by using the java API for the thing directly
Which is the canonical github repo for clojure-protobuf? Is it ninjudd/clojure-protobuf, or flatland/, or ghaskins/, or some other?
@gonewest818 flatland says it is forked from ninjudd
And so does ghaskins.
(GitHub shows forked from at the top of the page under the repo)
@seancorfield right, however those forks look more active, as if maybe ninjudd has moved on to other things.
Have you checked Clojars to see where the most recent builds are coming from? (I haven't looked yet, but that's where I'd go next)
Wow, that's probably even more confusing...
The only version I see there more recent than the one ninjudd pushed (which is under org.flatland!) is https://clojars.org/org.clojars.brunchboy/protobuf
And that's July 2015.
Despite that, it does look like ghaskins version is the most up-to-date ... so, yeah, it does look like ninjudd/flatland's version is way old. So I guess it'll depend on which version of Google protobuf you want under the hood since ghaskins' version is much more recent...
@seancorfield @gonewest818 honestly, the whole state of protobufs on jvm is indeed a bit of a mess
IIRC, there were two main things I did from the ninjudd base: 1) I got rid of the implicit ties to a specific protobuf tooling, and 2) I got rid of attempts to compile protoc and auto-protoc compile
That said, using cljs+protobufjs on nodejs is much more pleasant than trying to use clj+jvm
Wow, thanks for all the responses... I was at the hardware store picking up odds and ends, and besides I'm on vacation right now so it isn't super urgent but yeah, clarifying the situation for clj+jvm seems like a step forward for the community. At very least, having an active project with more obvious namespace correlation between github and clojars would save people the head scratching.
It would be nice if Clojars had ways to sort the list of projects by date/version/group ID and maybe a "refine search" option too. Clojars is open source so anyone could send in PRs for that sort of stuff.
http://crossclj.info is useful too https://crossclj.info/ns/protobuf/0.6.2/project.clj.html
It can be very hard to figure out whether the original GH project has been abandoned -- and sometimes, just because a fork has more recent commits, it doesn't mean it's a good, safe, solid update on the original (and it can take a while for a fork to build up a good head of "downloads" steam). Definitely looks like yours should be the go-to choice tho' now @ghaskins -- 💯 for giving the project new life!
I forked an old Axis wrapper Clojure project to see if I could get it working with Clojure 1.3. I did, but in the end it didn't do enough for me and I switched to raw Axis via interop. But I got pinged for help with Axis for years after forking that project! Lots of people looking for a better solution but no one seemingly able to create one (me included).
@seancorfield I know what you mean: I went looking for protobuf integration years ago and the landscape was a mess and confusing (old, didn't work, etc). The only thing that ended up working for me was the fork+patch we are discussing now. To your point, I added extra entropy to the messy landscape with my approach, but it does seem to work and thus satisfied my initial itch. I would be willing to try to clean up namespaces, etc, but I didn't want to step on the toes/attribution of the original contributors, thus the retained flatlands/ninjudd namespaces etc. Open to suggestion for the best way forward so the community has a robust option, though.