Fork me on GitHub
#clojure
<
2020-12-07
>
devn03:12:40

Is as-> technically an anaphoric macro? :thinking_face:

devn03:12:20

or does it fail the test because it doesn’t force the use of a pre-determined binding name like it or this?

Alex Miller (Clojure team)03:12:06

no b/c you supply the name

devn03:12:07

By definition of “anaphor”, it seems to be, but most of the anaphoric macros I’ve come across presuppose the binding.

Alex Miller (Clojure team)03:12:33

or at least how I think about it

devn03:12:43

> (https://en.wiktionary.org/wiki/linguistics) An https://en.wiktionary.org/wiki/expression https://en.wiktionary.org/wiki/refer to another expression. In stricter uses, an expression referring to something earlier in the https://en.wiktionary.org/wiki/discourse or, even more strictly, only reflexive and reciprocal pronouns. (Granted, this is a pretty vague definition)

devn03:12:10

@alexmiller yeah, that was kind of my thinking. It is close though!

Alex Miller (Clojure team)03:12:50

the only thing I would consider anaphoric in clojure is proxy

devn03:12:55

it’s kind of meta-anaphor, but then I suppose you could take that argument too far and call let an anaphoric macro because it lets you introduce a name and use it in different positions

Alex Miller (Clojure team)03:12:01

which uses this as a magic symbol

devn03:12:57

ah, interesting. I did not know that.

Alex Miller (Clojure team)03:12:51

well even stuff like with-open - anything that expands to a let would be in that category

devn03:12:09

condp is closer than let in terms of shape I suppose

devn03:12:33

(than let I mean)

devn03:12:47

but well, it’s lets all the way down folks 🙂

devn03:12:16

eh, i retract that. it feels closer in the purely definitional sense

devn03:12:53

Thanks for coming to my TED Talk.

devn03:12:48

Change of subject: I really love clojure-lsp.

devn03:12:50

I don’t know why I resisted trying it out for so long, but as an emacs user I feel like I got a lot for a little bit of configuration. Specifically, I was recently working on an old project that had a lot of dead code in it. Once I had clojure-lsp running, I managed to delete a ton (literally I think somewhere around 2k LOC) of unused code and uncover multiple subtle bugs inline with the clj-kondo integration.

devn03:12:30

I should add for anyone not using emacs, the benefits are there for other editors as well. Specifically, global unused declarations are highlighted. Cursive checks most of the boxes, but not this one. In addition, the clj-kondo integration is neat. It also has a cljfmt integration which I am not currently using because politics. Either way, I feel like adding it to my toolkit was worth the effort and would encourage y’all to check it out regardless of editor. Seems like tooling the whole community regardless of editor could benefit from.

👍 6
☝️ 3
delaguardo14:12:58

I wonder why clojure is hardly depends on org.clojure/spec.alpha and org.clojure/core.specs.alpha ? when I try to exclude spec.alpha I’m getting nasty exception

delaguardo14:12:58

~ on ☁️  (eu-west-1) took 23s 
❯ clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.1" :exclusions [org.clojure/spec.alpha]}}}' -Stree 
org.clojure/clojure 1.10.1
  . org.clojure/core.specs.alpha 0.2.44

~ on ☁️  (eu-west-1) took 2s 
❯ clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.1" :exclusions [org.clojure/spec.alpha]}}}'       
Exception in thread "main" java.lang.ExceptionInInitializerError
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at clojure.lang.RT.classForName(RT.java:2211)
	at clojure.lang.RT.classForName(RT.java:2220)
	at clojure.lang.RT.loadClassForName(RT.java:2239)
	at clojure.lang.RT.load(RT.java:449)
	at clojure.lang.RT.load(RT.java:424)
	at clojure.core$load$fn__6839.invoke(core.clj:6126)
	at clojure.core$load.invokeStatic(core.clj:6125)
	at clojure.core$load.doInvoke(core.clj:6109)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5908)
	at clojure.core$load_one.invoke(core.clj:5903)
	at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
	at clojure.core$load_lib.invokeStatic(core.clj:5947)
	at clojure.core$load_lib.doInvoke(core.clj:5928)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$load_libs.invokeStatic(core.clj:5985)
	at clojure.core$load_libs.doInvoke(core.clj:5969)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$require.invokeStatic(core.clj:6007)
	at clojure.core.server$loading__6721__auto____8842.invoke(server.clj:9)
	at clojure.core.server__init.load(Unknown Source)
	at clojure.core.server__init.<clinit>(Unknown Source)
	at java.lang.Class.forName0(Native Method)
	at java.lang.Class.forName(Class.java:348)
	at clojure.lang.RT.classForName(RT.java:2211)
	at clojure.lang.RT.classForName(RT.java:2220)
	at clojure.lang.RT.loadClassForName(RT.java:2239)
	at clojure.lang.RT.load(RT.java:449)
	at clojure.lang.RT.load(RT.java:424)
	at clojure.core$load$fn__6839.invoke(core.clj:6126)
	at clojure.core$load.invokeStatic(core.clj:6125)
	at clojure.core$load.doInvoke(core.clj:6109)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5908)
	at clojure.core$load_one.invoke(core.clj:5903)
	at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
	at clojure.core$load_lib.invokeStatic(core.clj:5947)
	at clojure.core$load_lib.doInvoke(core.clj:5928)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$load_libs.invokeStatic(core.clj:5985)
	at clojure.core$load_libs.doInvoke(core.clj:5969)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$require.invokeStatic(core.clj:6007)
	at clojure.core$require.doInvoke(core.clj:6007)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.lang.Var.invoke(Var.java:384)
	at clojure.lang.RT.doInit(RT.java:491)
	at clojure.lang.RT.init(RT.java:467)
	at clojure.main.main(main.java:38)
Caused by: java.io.FileNotFoundException: Could not locate clojure/spec/alpha__init.class, clojure/spec/alpha.clj or clojure/spec/alpha.cljc on classpath.
	at clojure.lang.RT.load(RT.java:462)
	at clojure.lang.RT.load(RT.java:424)
	at clojure.core$load$fn__6839.invoke(core.clj:6126)
	at clojure.core$load.invokeStatic(core.clj:6125)
	at clojure.core$load.doInvoke(core.clj:6109)
	at clojure.lang.RestFn.invoke(RestFn.java:408)
	at clojure.core$load_one.invokeStatic(core.clj:5908)
	at clojure.core$load_one.invoke(core.clj:5903)
	at clojure.core$load_lib$fn__6780.invoke(core.clj:5948)
	at clojure.core$load_lib.invokeStatic(core.clj:5947)
	at clojure.core$load_lib.doInvoke(core.clj:5928)
	at clojure.lang.RestFn.applyTo(RestFn.java:142)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$load_libs.invokeStatic(core.clj:5985)
	at clojure.core$load_libs.doInvoke(core.clj:5969)
	at clojure.lang.RestFn.applyTo(RestFn.java:137)
	at clojure.core$apply.invokeStatic(core.clj:667)
	at clojure.core$require.invokeStatic(core.clj:6007)
	at clojure.main$loading__6721__auto____8974.invoke(main.clj:11)
	at clojure.main__init.load(Unknown Source)
	at clojure.main__init.<clinit>(Unknown Source)
	... 55 more

delaguardo14:12:58

the repl can start if I’m excluding only core.specs.alpha but any macroexpansion give me another one

~ on ☁️  (eu-west-1) 
❯ clojure -Sdeps '{:deps {org.clojure/clojure {:mvn/version "1.10.1" :exclusions [org.clojure/core.specs.alpha]}}}' 
Clojure 1.10.1
user=> (let [x 1])  
Syntax error macroexpanding clojure.core/let at (REPL:1:1).
Could not locate clojure/core/specs/alpha__init.class, clojure/core/specs/alpha.clj or clojure/core/specs/alpha.cljc on classpath.
user=> 

Alex Miller (Clojure team)14:12:16

I don't understand your question. you seem to be asking why it doesn't depend on it but showing why it does

Alex Miller (Clojure team)14:12:08

macro specs are checked on expansion and that happens in the compiler

vlaaad14:12:11

I think the question is why clojure does depend on spec

Alex Miller (Clojure team)14:12:26

just answered that

👍 3
Alex Miller (Clojure team)14:12:39

you can actually turn that off

Alex Miller (Clojure team)14:12:16

(see https://clojure.org/guides/faq#skip_macros) but you still probably need the dep even in that case

delaguardo14:12:00

mostly I wonder why stable clojure hardly has a hard dependency on spec library with alpha in the name

andy.fingerhut14:12:38

Minor English nit: "clojure hardly depends" can be interpreted as "clojure barely depends". I think if you said "clojure has a hard dependency on spec library" it would be clearer.

delaguardo14:12:15

thanks! didn’t know that.

andy.fingerhut14:12:16

Also, I suspect that when they created the dependency, they did not expect that it would be alpha for as long as it has been. The dependency is only for stricter syntax checking of some macro invocations, currently.

Alex Miller (Clojure team)14:12:58

the spec api is still alpha (and will likely change). clojure's usage of that is internal and users dependency on it is optional.

delaguardo14:12:26

thanks for those links, but I’m still don’t know how to promote stability of clojure when there is an alpha library in dependencies. I have no problems with this personally but was asked trying to present clojure to the group of Scala/Java developers. And I don’t know how to explain because there is no (at least not on my radars) roadmap for spec2

Alex Miller (Clojure team)14:12:54

alpha here means "subject to future change", not "unstable"

Alex Miller (Clojure team)14:12:27

don't even try to tell me Scala people don't understand "subject to future change"

delaguardo15:12:19

they certainly understand that) I will give it another try

Alex Miller (Clojure team)15:12:59

I would happily put Clojure's language stability up against Scala's any day :)

delaguardo15:12:27

same as I 😄

Darrell15:12:03

Any idea why compiling an uberjar hangs at “Processing pom.xml”?

kenny15:12:12

Are you using depstar?

Alex Miller (Clojure team)15:12:59

take a thread dump - ctrl-\ on *nix/mac

kenny15:12:27

I had this same issue (specifically due to Neanderthal doing some funky stuff at init). If he's using depstar, I'll bet its no shutdown-agents call. Sean fixed that in a newer release.

kenny15:12:05

Oddly, however, I would get a blocked for far more than the usual 60s...

Alex Miller (Clojure team)15:12:09

if it waits for about 1 minute, and then shuts down...

Darrell15:12:15

I’m not using depstar that I know of. I did add at-at prior to this which is the only change I can think of that might cause this.

Alex Miller (Clojure team)15:12:42

the jvm won't exit if there are non-daemon threads running

Alex Miller (Clojure team)15:12:53

so if that launches those, you might need to call some kind of shutdown functino

Darrell15:12:35

What am I looking for in the thread dump? (I’m still somewhat new to Clojure and JVM)

Alex Miller (Clojure team)15:12:20

is the main thread still running? if so, what's it doing?

Alex Miller (Clojure team)15:12:38

if not, there must be another non-daemon thread (won't say daemon) that's doing something, so what is it - if it's an "agent" thread, that's the result of a future or something

Alex Miller (Clojure team)15:12:15

(shutdown-agents) would probably "fix" it but might be an issue with some code that has undesired top-level effects

Alex Miller (Clojure team)15:12:14

seems like a common issue that comes up is building an uber jar where the uber jar accidentally contains the directory where the uberjar is being made and it never finishes?

Darrell15:12:14

Full thread dump OpenJDK 64-Bit Server VM (11.0.8+10-jvmci-20.2-b03 mixed mode, sharing):

Threads class SMR info:
_java_thread_list=0x00007fddbf9e1520, length=13, elements={
0x00007fddbb8d0800, 0x00007fddbb8d1800, 0x00007fddbb8ce000, 0x00007fddbb015000,
0x00007fddbb028000, 0x00007fddbb028800, 0x00007fddbd01c800, 0x00007fddbd01d800,
0x00007fddbb8cf000, 0x00007fddbbba8800, 0x00007fddbd3cf000, 0x00007fddc0025800,
0x00007fddbd008800
}

"Reference Handler" #2 daemon prio=10 os_prio=36 cpu=0.89ms elapsed=1185.92s tid=0x00007fddbb8d0800 nid=0x3903 waiting on condition  [0x0000700004392000]
   java.lang.Thread.State: RUNNABLE
	at java.lang.ref.Reference.waitForReferencePendingList([email protected]/Native Method)
	at java.lang.ref.Reference.processPendingReferences([email protected]/Reference.java:241)
	at java.lang.ref.Reference$ReferenceHandler.run([email protected]/Reference.java:213)

"Finalizer" #3 daemon prio=8 os_prio=34 cpu=0.44ms elapsed=1185.92s tid=0x00007fddbb8d1800 nid=0x3a03 in Object.wait()  [0x0000700004495000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait([email protected]/Native Method)
	- waiting on <0x00000007000b3b08> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove([email protected]/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x00000007000b3b08> (a java.lang.ref.ReferenceQueue$Lock)
	at java.lang.ref.ReferenceQueue.remove([email protected]/ReferenceQueue.java:176)
	at java.lang.ref.Finalizer$FinalizerThread.run([email protected]/Finalizer.java:170)

"Signal Dispatcher" #4 daemon prio=9 os_prio=35 cpu=0.27ms elapsed=1185.90s tid=0x00007fddbb8ce000 nid=0x5503 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"JVMCI-native CompilerThread0" #5 daemon prio=9 os_prio=35 cpu=6802.76ms elapsed=1185.90s tid=0x00007fddbb015000 nid=0x5603 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"C1 CompilerThread0" #6 daemon prio=9 os_prio=35 cpu=2588.99ms elapsed=1185.90s tid=0x00007fddbb028000 nid=0xa503 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE
   No compile task

"Sweeper thread" #7 daemon prio=9 os_prio=35 cpu=87.29ms elapsed=1185.90s tid=0x00007fddbb028800 nid=0x5803 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Common-Cleaner" #8 daemon prio=8 os_prio=34 cpu=2.59ms elapsed=1185.79s tid=0x00007fddbd01c800 nid=0xa203 in Object.wait()  [0x0000700004caa000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait([email protected]/Native Method)
	- waiting on <no object reference available>
	at java.lang.ref.ReferenceQueue.remove([email protected]/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x00000007000b3cc8> (a java.lang.ref.ReferenceQueue$Lock)
	at jdk.internal.ref.CleanerImpl.run([email protected]/CleanerImpl.java:148)
	at java.lang.Thread.run([email protected]/Thread.java:834)
	at jdk.internal.misc.InnocuousThread.run([email protected]/InnocuousThread.java:134)

"Service Thread" #9 daemon prio=9 os_prio=31 cpu=0.07ms elapsed=1185.75s tid=0x00007fddbd01d800 nid=0x9f03 runnable  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"Libgraal MBean Registration" #10 daemon prio=1 os_prio=27 cpu=47.68ms elapsed=1185.47s tid=0x00007fddbb8cf000 nid=0x9c03 waiting on condition  [0x0000700004fb3000]
   java.lang.Thread.State: TIMED_WAITING (sleeping)
	at java.lang.Thread.sleep([email protected]/Native Method)
	at org.graalvm.compiler.hotspot.management.LibGraalMBean$Factory.run(jdk.internal.vm.compiler.management/LibGraalMBean.java:602)

"mysql-cj-abandoned-connection-cleanup" #13 daemon prio=5 os_prio=31 cpu=55.09ms elapsed=1180.55s tid=0x00007fddbbba8800 nid=0x9203 in Object.wait()  [0x0000700005ace000]
   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait([email protected]/Native Method)
	- waiting on <no object reference available>
	at java.lang.ref.ReferenceQueue.remove([email protected]/ReferenceQueue.java:155)
	- waiting to re-lock in wait() <0x0000000707995448> (a java.lang.ref.ReferenceQueue$Lock)
	at com.mysql.cj.jdbc.AbandonedConnectionCleanupThread.run(AbandonedConnectionCleanupThread.java:91)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1128)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"pool-1-thread-1" #14 prio=5 os_prio=31 cpu=105.19ms elapsed=1176.74s tid=0x00007fddbd3cf000 nid=0x6803 waiting on condition  [0x0000700005bd1000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x00000007079dfdb0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:2081)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:1170)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:899)
	at java.util.concurrent.ThreadPoolExecutor.getTask([email protected]/ThreadPoolExecutor.java:1054)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1114)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"pool-1-thread-2" #15 prio=5 os_prio=31 cpu=102.22ms elapsed=1176.73s tid=0x00007fddc0025800 nid=0x6903 waiting on condition  [0x0000700005cd4000]
   java.lang.Thread.State: WAITING (parking)
	at jdk.internal.misc.Unsafe.park([email protected]/Native Method)
	- parking to wait for  <0x00000007079dfdb0> (a java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
	at java.util.concurrent.locks.LockSupport.park([email protected]/LockSupport.java:194)
	at java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await([email protected]/AbstractQueuedSynchronizer.java:2081)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:1170)
	at java.util.concurrent.ScheduledThreadPoolExecutor$DelayedWorkQueue.take([email protected]/ScheduledThreadPoolExecutor.java:899)
	at java.util.concurrent.ThreadPoolExecutor.getTask([email protected]/ThreadPoolExecutor.java:1054)
	at java.util.concurrent.ThreadPoolExecutor.runWorker([email protected]/ThreadPoolExecutor.java:1114)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run([email protected]/ThreadPoolExecutor.java:628)
	at java.lang.Thread.run([email protected]/Thread.java:834)

"DestroyJavaVM" #16 prio=5 os_prio=31 cpu=10565.18ms elapsed=1174.33s tid=0x00007fddbd008800 nid=0x2803 waiting on condition  [0x0000000000000000]
   java.lang.Thread.State: RUNNABLE

"VM Thread" os_prio=35 cpu=99.20ms elapsed=1185.96s tid=0x00007fddbb8d0000 nid=0x4a03 runnable

"GC Thread#0" os_prio=35 cpu=97.19ms elapsed=1186.04s tid=0x00007fddbb819800 nid=0x2e03 runnable

"GC Thread#1" os_prio=35 cpu=89.39ms elapsed=1184.73s tid=0x00007fddbd19c000 nid=0x6103 runnable

"GC Thread#2" os_prio=35 cpu=89.51ms elapsed=1184.73s tid=0x00007fddbb2a4000 nid=0x6203 runnable

"GC Thread#3" os_prio=35 cpu=89.57ms elapsed=1184.73s tid=0x00007fddbb28d000 nid=0x9703 runnable

"GC Thread#4" os_prio=35 cpu=93.94ms elapsed=1184.73s tid=0x00007fddbb2ab800 nid=0x9503 runnable

"GC Thread#5" os_prio=35 cpu=90.34ms elapsed=1184.73s tid=0x00007fddbb2ac800 nid=0x9403 runnable

"GC Thread#6" os_prio=35 cpu=11.71ms elapsed=1175.34s tid=0x00007fddbbaff000 nid=0x8e03 runnable

"G1 Main Marker" os_prio=35 cpu=2.92ms elapsed=1186.04s tid=0x00007fddbc03d800 nid=0x5203 runnable

"G1 Conc#0" os_prio=35 cpu=20.02ms elapsed=1186.04s tid=0x00007fddbb81a800 nid=0x5003 runnable

"G1 Conc#1" os_prio=35 cpu=22.31ms elapsed=1182.01s tid=0x00007fddbd1b1800 nid=0x9303 runnable

"G1 Refine#0" os_prio=35 cpu=2.41ms elapsed=1186.04s tid=0x00007fddbb8bb000 nid=0x4e03 runnable

"G1 Young RemSet Sampling" os_prio=35 cpu=514.15ms elapsed=1186.04s tid=0x00007fddbb018000 nid=0x3203 runnable
"VM Periodic Task Thread" os_prio=36 cpu=1195.26ms elapsed=1185.76s tid=0x00007fddbd011000 nid=0x5a03 waiting on condition

JNI global refs: 21, weak refs: 0

Heap
 garbage-first heap   total 317440K, used 138191K [0x0000000700000000, 0x0000000800000000)
  region size 1024K, 132 young (135168K), 20 survivors (20480K)
 Metaspace       used 33435K, capacity 40958K, committed 41136K, reserved 1081344K
  class space    used 6630K, capacity 9000K, committed 9136K, reserved 1048576K

Darrell15:12:15

I don’t see any mention of agents or futures in that.

Darrell15:12:23

Yeah; it’s at-at. When I comment that out and rebuild it finishes.

Alex Miller (Clojure team)15:12:07

it's waiting on those pool-1-thread-N - must be a executor pool of non-daemon threads started by at-at

Alex Miller (Clojure team)15:12:01

probably you have a namespace that is starting that at the top level (or maybe just require'ing at-at does it)

Alex Miller (Clojure team)15:12:16

if the former, you can put that in a delay

Darrell15:12:35

I… think I follow? 😄 I have my at-at code in the main file outside of any functions. Are you saying I should move that to its own function?

Darrell15:12:07

I was also doing (:use overtone.at-at) because trying to :require it was causing an error (that I can’t recall now)

Alex Miller (Clojure team)15:12:01

yes, should probably be in its own function. uberjar often means compiling, which means loading, which means that code is getting run while you are making the uberjar

Alex Miller (Clojure team)15:12:15

the :use is probably fine

Darrell15:12:31

That makes sense. I’ll try that. Thanks @alexmiller!

William Skinner18:12:44

Does cheshire or other support streaming a giant JSON file that looks like:

{
  "members": [
    ... potentially GBs of data
  ]
}

noisesmith18:12:50

cheshire's parsed-seq should handle that, just be sure you don't leak the head of the result so it is held by a GC root

noisesmith18:12:01

I thought I'd find a similar lazy function in data.json, but I'm not seeing it

hiredman18:12:54

I believe, but I am not 100% sure, that parsed-seq only handles cases like [..gbs of data..]

noisesmith18:12:39

oh, that would make sense, that's also too bad

hiredman18:12:50

the thing is most clojure json libraries parse json into clojure datastructures, which as a model, doesn't really generically match with streaming

hiredman18:12:45

if you look at streaming xml parsers (and I believe streaming json parsers function similarly) what you get it kind of a stream of events

dpsutton18:12:59

You could jq piped to another file to unnest it

hiredman18:12:30

jackson, the java library chesire is built on does streaming json decoding, but the model for consuming the stream of events like START_ARRAY, START_OBJECT, etc, is radically different from using clojure datastructures

William Skinner18:12:09

yeah I think I'm going to have to write some of this is in java to unnest the array element

paulocuneo00:12:00

maybe advance the reader til it reaches \[, then pass it to cheshire parsed-seq? hopefully will stop parsing at the \] and ignore the rest of the buffer

hiredman18:12:36

if you do the unnesting using jackson, you may then be able to pass the event stream into cheshire's internal parse function to get clojure data out https://github.com/dakrone/cheshire/blob/master/src/cheshire/parse.clj

noisesmith18:12:39

it seems like some json lib could return a lazy seq instead of vector, and lazy-seq of vector tuples instead of maps, it would be clumsier to use in the general case but it would allow stream oriented processing without blowing up the VM

noisesmith18:12:05

I guess each level of nesting would still be at least one stack frame though

hiredman18:12:12

yeah, you start doing things like have custom map and vector types which lazily walk the parse stream, but explode if you try to call = on them

noisesmith18:12:23

as opposed to true streaming, which would have map-start/ map-end events etc. with no nesting

Christos20:12:01

Hello, I have installed Datomic dev-local, and try to run a simple query on the “Movies” db but I get the error: :db.error/not-an-entity Unable to resolve entity: :release/name

Christos20:12:30

Any ideas? What am I dong wrong? Many thanks in advance!

p-himik20:12:26

Might get better traction in #datomic

Christos08:12:44

You are right 🙂 Many thanks!