clojure

New to Clojure? Try the #beginners channel. Official docs: https://clojure.org/ Searchable message archives: https://clojurians-log.clojureverse.org/
2020-09-14T00:15:23.360100Z

What I think has more potential isn't a visual editor, but a more semantic aware editor where the editor guarantees that all edits always compiles and are valid syntax. I've thought about this before, but every-time you'd def, instead of using some text id which is the def name, the editor would provide an auto-generated GUID for it instead, and there's be meta similar to docstring that would be docname which is the name you'd normally be entering. That type of thing. I mean we get close-ish to this in Clojure already if you use strict strutural editing, but this goes beyond and assume your editor has lots of semantic knowledge, and the UI is not strictly letting you modify text free-form. Unison: https://www.unisonweb.org/ comes closest as I know to what I'm talking about.

2020-09-14T00:44:43.360600Z

Recommend this talk about it if you're interested: https://www.youtube.com/watch?v=gCWtkvDQ2ZI

alexmiller 2020-09-14T00:50:21.361500Z

Object reference writes are always atomic

chepprey 2020-09-14T00:51:43.361700Z

I'm certainly not writing (nor seeking to recommend writing) such code! I was just curious, I hadn't before considered the possible differences of tearing between 32/64bit jvms. On my specific question about long tearing on a 64bit jvm, the JLS appears to say tearing is technically still possible, as the copying of longs is JVM implementation dependent, so you may not officially depend on atomic longs.

borkdude 2020-09-14T07:42:17.364Z

When implementing an interface / protocol with multiple overloads in defrecord / reify this readme https://clojure.org/reference/protocols seems to suggest writing (foo [ ] ...) multiple times. But later on in the readme I see:

(extend-type MyType
  Countable
    (cnt [c] ...)
  Foo
    (bar [x y] ...)
    (baz ([x] ...) ([x y zs] ...)))
What's the official syntax?

2020-09-14T07:46:17.365100Z

It isn't the same for extend type vs reify or defrecord

2020-09-14T07:48:48.368300Z

For defrecord / deftype you do a method per arity (like java without types, because it ends up generating methods for each), for extend type it is like fns with a different body per arity because it actually macro expands to a fn

borkdude 2020-09-14T07:51:25.368500Z

thanks

unbalanced 2020-09-14T15:13:14.372200Z

Can anyone recommend a Clojure product/library/tool similar to Python's celery (aka task execution from a queue -- https://docs.celeryproject.org/en/stable/getting-started/introduction.html). Or does everyone just kind of roll their own for that sort of work in Clojure?

emccue 2020-09-14T15:27:25.372300Z

https://github.com/crabhi/celery-java

emccue 2020-09-14T15:27:31.372600Z

I think you can just use celery

emccue 2020-09-14T15:28:54.372800Z

I haven't gone far enough to know what to recommend, but my money is on there being pretty robust Java solutions you can use

emccue 2020-09-14T15:35:28.373100Z

quartz or whatever the heck

lukasz 2020-09-14T16:20:49.373300Z

@goomba are you planning to use RabbitMQ? Is celery compatibility required (e.g. you have python publishers/consumers)?

unbalanced 2020-09-14T16:34:39.373500Z

no, just looking for similar conceptual functionality

p-himik 2020-09-14T16:37:34.373700Z

After a few years with Celery, I would not recommend it to anyone. :) But I got pretty bitter with the whole Python ecosytem. With that being said, I couldn't find any complete replacement. Here are some links with similar/related stuff that I've gathered, maybe they will be helpful: - http://immutant.org/documentation/current/apidoc/immutant.messaging.pipeline.html - http://www.quartz-scheduler.org/ - https://github.com/prepor/twarc - https://redisson.org/ - https://github.com/gresrun/jesque - https://github.com/apache/storm - http://www.onyxplatform.org/

🔥 3
unbalanced 2020-09-14T16:45:57.374600Z

@p-himik agreed re:Celery 😉 Dang awesome list or resources!!

lukasz 2020-09-14T16:53:53.375500Z

We have built our own RabbitMQ library/component https://github.com/nomnom-insights/nomnom.bunnicula - currently processing millions of jobs every day

p-himik 2020-09-14T17:03:19.375800Z

Does it handle computation DAGs?

unbalanced 2020-09-14T18:54:27.377Z

(was that to me or @lukaszkorecki. @p-himik?)

p-himik 2020-09-14T18:57:28.377300Z

lukasz

lukasz 2020-09-14T19:07:31.377500Z

@p-himik no, it's a "simple" job publisher/consumer thing. DAGs etc are out of scope (not sure how it would all work to be honest, it's not something we need, at least as a "hard" concept)

👍 1
Franklin 2020-09-14T20:09:15.378500Z

Hey, I'm trying to upgdate my dependencies with lein ancient and I keep getting this: "Syntax error compiling var at (midje/util/exceptions.clj:75:3).\nUnable to resolve var: aviso.exception/traditional in this context\n"

Franklin 2020-09-14T20:09:27.378900Z

Does anyone know how this could be fixed?

seancorfield 2020-09-14T20:19:24.379900Z

@franklineapiyo Sounds like a version conflict between one or more libraries. Do you have stuff in your ~/.lein/profiles.clj file? That's often the most common cause of problems with Leiningen.

Franklin 2020-09-14T20:22:59.380300Z

Yes I do. bu the only thing in there is {:user {:plugins [[lein-ancient "0.6.15"]]}}

seancorfield 2020-09-14T20:26:03.380900Z

And you're getting the exception from lein ancient itself? Or when you try to run the project after it has updated it?

seancorfield 2020-09-14T20:26:24.381400Z

(or are you just trying to get a report of outdated dependencies to update them yourself?)

Franklin 2020-09-14T20:28:15.381800Z

I'm getting this from just running lein ancient

Franklin 2020-09-14T20:31:21.382600Z

I've tried to run lein ancient interactive mode and this only happens when I try to upgrade midje, clojure or dk.ative/docjure

Franklin 2020-09-14T20:31:50.383100Z

trying to upgrade any one of them or all of them at the same time causes this error

dpsutton 2020-09-14T20:34:05.384800Z

not sure if this will help, but try lein with-profile -dev [whatever goes here]

seancorfield 2020-09-14T20:35:11.386Z

You could just update these things manually -- but the problem looks like recent versions of Midje depend on that var, which was introduced in Aviso Pretty 0.1.15, which all happened a few years ago.

Franklin 2020-09-14T20:35:57.386500Z

Running that... I get Reflection warning, dk/ative/docjure/spreadsheet.clj:642:17 - call to org.apache.poi.ss.util.CellReference ctor can't be resolved.

seancorfield 2020-09-14T20:36:03.386800Z

I don't really trust any tools that try to update my project configuration "automatically"...

Franklin 2020-09-14T20:37:37.388600Z

But @seancorfield, I don't see Aviso Pretty anywhere in my project.clj... I'm a bit of a newb.. how should I update something that isn't in my project.clj... I think it's a dependency of something that's in my dependencies correct?

seancorfield 2020-09-14T20:38:48.389200Z

Part of me feels like saying "Stop using Midje -- that's part of your problem"... 🙂

seancorfield 2020-09-14T20:39:57.390600Z

Since this is probably going to be a fair bit of hand-holding to get to the bottom of this and you're fairly new to Clojure, perhaps share your project.clj file in #beginners where folks have opted in to spending more time digging into basic problems like this (I'm happy to continue digging into it in #beginners )

Franklin 2020-09-14T20:40:24.390800Z

sweet!

seancorfield 2020-09-14T20:40:58.391400Z

(there's an expectation in this channel that you can mostly debug dependency conflicts on your own)