This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-10-31
Channels
- # aleph (1)
- # announcements (2)
- # beginners (105)
- # braveandtrue (1)
- # cider (61)
- # clara (47)
- # cljdoc (29)
- # cljs-dev (5)
- # clojure (61)
- # clojure-austin (14)
- # clojure-brasil (1)
- # clojure-india (3)
- # clojure-italy (4)
- # clojure-mexico (1)
- # clojure-nl (2)
- # clojure-spec (37)
- # clojure-uk (95)
- # clojurescript (73)
- # cursive (12)
- # data-science (1)
- # datomic (26)
- # duct (10)
- # emacs (5)
- # fulcro (47)
- # hoplon (6)
- # hyperfiddle (3)
- # jobs-discuss (3)
- # kaocha (2)
- # leiningen (3)
- # nrepl (8)
- # off-topic (3)
- # onyx (2)
- # re-frame (31)
- # reitit (16)
- # shadow-cljs (36)
- # spacemacs (46)
- # specter (16)
- # tools-deps (13)
- # yada (22)
https://ferret-lang.org interesting
yes, but no code available except https://github.com/nakkaya/ferret Oh well...
But hey, there's a lot of hipsters out there who convince management that V8/NodeJS is "faster and more lightweight" than the JVM
for those that don't want to click link: >I wrote and deployed (to production) some Clojure code at Netflix just yesterday. Among other things at Netflix the Mantis Query Language (MQL an SQL for streaming data) which ferries around approximately 2 trillion events every day for operational analysis (SPS alerting, quality of experience metrics, debugging production, etc) is written entirely in Clojure. >This runs in nearly every critical service, ~3000 ASGs and easily > 100k servers and Clojure allows us to also compile it for our NodeJS services as well.
I think there's a lot of Clojure running out there but folks just don't write about it as a matter of course -- it all goes smoothly and without drama and folks are just too busy getting s* done.
I blogged a lot about Clojure when I got started. Recently, not so much. Clojure evolves slowly, it's stable, it "just works". I haven't felt the need to blog about stuff much lately.
I agree, although I think Kubernetes has some very interesting and positive implications for clojure.
I'm always reminded of those old Bently? ads, "Move along youngster, you'll know when you're ready."
so I have a coll of maps I want to dedupe by a key in each map; I was going to just copy clojure.core/distinct
and introduce an arg f
to dedupe by, and call it distinct-by
. Am I missing something by going this route? Meaning, is there a better built-in approach?
you could copy the distinct code and use sorted-set-by to create the initial value for the internal accumulator
@zilti I think in many cases it less about the VM and more about the ecosystem (libs, docs, etc..)
Is there a way in clojure to create a java class with a typed field? Adding type metadata to the field in defrecord
doesn't do anything unless it's a primitive type.
I believe except for some primitive types, no. It is recommended to use Java to create a class with full control over the options.
Is there a reason for this?
A reason that Clojure doesn't provide all the knobs for class creation that Java does? I think because it would be a lot of work to implement all of those knobs in Clojure, and the Java compiler is right there.
And this work cannot be re-used in ClojureScript.
usage of the field in the body of an inline extend type or implementing the interface will see the effect of the type hint
I just need to specify the type of the field for interop purposes, and not have it just be Object
.
Yes, java wants to inject something based on an annotation.
It does.
another resource: https://puredanger.github.io/tech.puredanger.com/2011/08/12/subclassing-in-clojure/
last I checked this was a special syntax used in some places that extends the basic type hint syntax, but the general type hint syntax used everywhere doesn't include it
it is correct that type hints don't support annotations, but that is because they aren't part of the type hint but just generally part of metadata attached to a field
This will put the RInject
annotation on the redisson
field, but the type is Object
. Verified by examining the generated class file.
the :tag ...
part is the type hint, the other part (which is used as an annotation) is "other stuff in the metadata map"
Yes, sorry, misread your earlier point.
https://dev.clojure.org/jira/browse/CLJ-252 imported from assembla
Is it? It would break a lot of the untyped assumptions in the map interface records implement
deftypes don't implement the map interface, so in theory they should be fine, the tricky thing is, because defrecord is built on deftype, ensuring that the underlying machinery respects the hints for deftypes, and just uses Object for defrecord
This turns out to be an odd case, because the Java framework I'm using (Redisson) has a bug in their logic that checks if the field designated for injection can be assigned an object of type RedissonClient
. Obviously that should work fine for an field of type Object
, but they got the arguments switched.