clojure

New to Clojure? Try the #beginners channel. Official docs: https://clojure.org/ Searchable message archives: https://clojurians-log.clojureverse.org/
grav 2021-06-29T06:30:21.113100Z

Why is there a #queue tagged literal in ClojureScript, but not in Clojure?

quoll 2021-06-29T11:23:23.131800Z

Clojure has a built-in persistent queue but it’s awkward to work with it. You need to do things like: (into clojure.lang.PersistentQueue/EMPTY [1 2 3]) I’m guessing that Rich built it because it’s a described structure in Okasaki, but he didn’t see enough general utility in the structure to expose it via functions in core, or (eventually) via a reader. (Personally I’ve only needed it once). When ClojureScript readers were written, I’m thinking that David (or Antonio, who’s name is also attached to that line) added queue to the readers thinking that it would be handy to have. After all, queues were ported over, like everything else, so why not make them easier to use? Different developers, different motivations.

quoll 2021-06-29T11:24:44.133100Z

The only way I know to find out for sure is to ask them 🙂

grav 2021-06-29T12:34:37.134900Z

Makes sense! Thanks for the answer 🙂

grav 2021-06-29T12:35:04.135100Z

Oh, btw great defn episode, really enjoyed it @quoll :)

quoll 2021-06-29T12:35:54.135500Z

Thank you

quoll 2021-06-29T12:36:14.136100Z

(I’ve no idea what I said 😆)

😄 1
robert-stuttaford 2021-06-29T06:32:13.113400Z

Hoping someone here has this handy: https://twitter.com/RobStuttaford/status/1409758371167735813

✅ 1
robert-stuttaford 2021-06-29T07:06:46.114700Z

thanks @grav and @tero.matinlassi!

robert-stuttaford 2021-06-29T07:10:50.114900Z

yeah @wilkerlucio’s gist is what i needed!

🙏 1
Endre Bakken Stovner 2021-06-29T14:40:36.138300Z

It is usually called version sort or natural sort.

1
grav 2021-06-29T06:42:44.113600Z

Wouldn't you need to tokenize beforehand so that each element is a pair of string,number? Something like

(->> ["item_10" "item_2"] (map #(re-matches #"(.+?)(\d+)" %)) (map (fn [[_ a b]] [a (Integer/parseInt b)])) sort)

grav 2021-06-29T06:43:23.113800Z

If there isn't a regular pattern in each input element, then I'd immediately think that sorting would be ambiguous

grav 2021-06-29T06:44:03.114Z

Eg ["10_item" "item_2"]

Tero Matinlassi 2021-06-29T06:50:17.114400Z

Maybe this is helpful? https://medium.com/@wilkerlucio/natural-sorting-in-clojure-script-123749bf3ba

2021-06-29T10:20:08.118400Z

I'm looking for a function that gives me a snapshot of jvm stats (heap, threads, classloading, gc...) as clojure data. I'm aware of jvm metrics libs like micrometer and dropwizard, but I'm looking for something dependency free. not too hard to create myself, but ofc if it exists I'll use it 😉

2021-06-29T11:57:11.134200Z

is there anyway to get clojure.pprint/pprint to work with *print-meta*?

2021-06-29T11:58:58.134300Z

(binding [*print-meta* true]
  (clojure.pprint/pprint (with-meta {:foo 1} {:bar 2})))
;; => ^{:bar 2} {:foo 1}

💡 1
2021-06-29T12:01:25.134500Z

I found this - https://clojure.atlassian.net/browse/CLJ-1445 and suspecting I’m on an older Clojure version perhaps since the above example doesn’t print the meta for me

2021-06-29T12:02:15.134700Z

Yep, Clojure 1.10.1

kenny 2021-06-29T15:54:19.146900Z

We have started to get a "java.io.IOException: Connection reset by peer" in our production environment (stacktrace in thread). The exception is coming from a call using the Java 11 HTTP client. We have not changed our Java version (running Azul 11.0.10-11.45.27) in some time. I have seen the exception come from a call to two different services. One that we are running internally (AWS API Gateway -> Datomic NLB -> Ion HTTP), and the other is Auth0's management API. This exception indicates that the remote server has dropped the connection. The part I cannot figure out is why it has "suddenly" started occurring. We have been continuously deploying new releases, and some of those releases may have changed the classpath deps, but I cannot see how any dep change would affect the Java 11 HTTP client library. I'm a bit at a loss on how to debug this. Does anyone have any insights into this particular exception or what could provoke something like this?

kenny 2021-06-29T15:55:06.147Z

elided internal code calls

alexmiller 2021-06-29T16:26:18.147300Z

while you may not have changed anything, AWS may have

alexmiller 2021-06-29T16:26:47.147500Z

just another variable to consider

kenny 2021-06-29T16:27:13.147700Z

My thought as well. Likelihood slightly decreased by the two different services causing the issue. No idea if Auth0 runs on AWS & uses the same services.

kenny 2021-06-29T16:31:13.147900Z

My current thought on a fix is to just retry those exceptions since it seems that a subsequent call will go through. It feels so wrong since I have such a poor understanding of the root problem.

alexmiller 2021-06-29T16:36:09.148100Z

seems similar to things datomic team spent a whole lot of time looking at (was aws related), but I don't know the details

👀 1
seancorfield 2021-06-29T16:38:42.148400Z

We've also seen an increase of this error with our AWS-based services (mostly Elastic Search but also a few third party services that are hosted on AWS).

😮 1
kenny 2021-06-29T16:38:58.148600Z

I have found some references to AWS services on Auth0's blog, so I think they have at least some things running there. I could totally see this being related to an AWS level change. If that is so, tracking that down to a repro to present to them seems like a very time consuming task 😬

rutledgepaulv 2021-06-29T16:39:14.148900Z

there are a lot of subtle things around nlbs... let me dig up some posts

seancorfield 2021-06-29T16:39:42.149100Z

We also see more random timeouts as well, so we are having to build in more retry logic etc.

kenny 2021-06-29T16:40:09.149600Z

@seancorfield thanks for that info. Very helpful. How are you thinking to tackle it? Retry IOException w/ "Connection reset by peer" string?

rutledgepaulv 2021-06-29T16:40:17.149800Z

when did medium add a paywall? 😞

kenny 2021-06-29T16:41:32.150100Z

Thanks @rutledgepaulv. Will read through. I'm definitely not an expert on the intimate details of NLBs.

seancorfield 2021-06-29T16:43:10.150300Z

@kenny Two-fold approach: yes, retry on certain IOExceptions and also add explicit timeouts and retries on some calls. Not all calls can safely be retried so there's no one-size-fits-all approach 😐 It's very annoying...

rutledgepaulv 2021-06-29T16:43:14.150500Z

np. here's another i was remembering.. https://www.niels-ole.com/cloud/aws/linux/2020/10/18/nlb-resets.html

seancorfield 2021-06-29T16:43:37.150800Z

@rutledgepaulv Medium's had a $5/month paywall for a long time. I pay. Lots of great content on there.

kenny 2021-06-29T16:44:10.151Z

If you have the info readily available @seancorfield, what other IOExceptions are you retrying?

seancorfield 2021-06-29T16:44:25.151200Z

(I think I pay about $40/month now for written content online?)

seancorfield 2021-06-29T16:44:39.151400Z

@kenny I don't have specifics I can share, sorry.

1
kenny 2021-06-29T16:47:36.151700Z

@seancorfield would you be able to share which HTTP client library you are using that you've been seeing these connection reset messages?

seancorfield 2021-06-29T16:47:53.151900Z

http-kit

seancorfield 2021-06-29T16:48:20.152100Z

(we have legacy code that still requires Java 8 even though most of our code is on Java 11)

kenny 2021-06-29T18:25:36.152400Z

@rutledgepaulv That first article was great! I am definitely seeing a good number of TCP_Target_Reset_Count in the CW metrics. However, they don't align as perfectly as I'd like with when I am seeing the connection reset exception thrown. I am now wondering if the IOException "Connection reset by peer" exception can be thrown in a situation that isn't the remove server sending a RST packet.

👍 1
2021-06-29T19:56:02.153100Z

New to Clojure and have been using Atom + Chlorine, but have heard great things about VS Code + Calva. I was wondering what differences / pros / cons there are between the two? Should I switch?

mauricio.szabo 2021-07-01T13:35:24.245600Z

Charlie, about the nREPL and Socket-REPL: nREPL is more powerful, Socket-REPL is simpler. In fact, most (if not all) Clojure implementations implement Socket REPLs (Lumo, Plank, BB, Clojure, Clojerl, ClojureCLR, etc) and only a few implement nREPL (Clojure, ClojureCLR and BB AFAIK). You can do everything you do in nREPL with a socket REPL, but it's way harder and sometimes it doesn't work that well. That being said, I also only use a socket-repl so maybe it's not a big deal 😄

p-himik 2021-06-29T19:58:47.153200Z

Sean Corfield has written a post about it: https://corfield.org/blog/2020/11/09/vscode-clover/

seancorfield 2021-06-29T20:05:47.153500Z

Chlorine and Clover are essentially the same, using a Socket REPL, which I like. Calva is great: it provides a lot of useful functionality and you can use it with Clover. In the Calva settings, turn the nREPL UI off and then you get all of Calva's great features with Clover's Socket REPL instead of nREPL.

seancorfield 2021-06-29T20:08:04.154300Z

I switched because Atom just doesn't have the same level of support as VS Code: VS Code is updated more often, has much better/broader extension support, and is much more widely used. Since you're already using Chlorine, you should be able to switch to VS Code + Clover and retain the exact same editing experience -- you can have the same hot keys, the same config.cljs customization, and so on.

seancorfield 2021-06-29T20:09:07.155400Z

Then you can add Calva (and turn off the nREPL UI), and benefit from built-in LSP (static analysis), clj-kondo, auto-formatting, great paredit support, rainbow parens, etc. Without needing a whole bunch of extensions added -- just Clover and Calva.

p-himik 2021-06-29T20:10:35.155900Z

@seancorfield Since you're here - do you work with jar files in any way? With IDEA+Cursive it's so easy, I sometimes don't get it how people don't look at the sources of libraries they use. It's as easy as looking at your own files, even if a library is in a jar with compiled classes. Last time I checked, there was no Java support for VSCode that would be advanced enough for that kind of navigation/search.

seancorfield 2021-06-29T20:14:43.156100Z

Non-Clojure JAR files you mean?

seancorfield 2021-06-29T20:16:10.156300Z

I can see the docs or source for any Clojure code, even in JAR files...

nate sire 2021-06-29T20:18:18.156500Z

It sounds like you are exceeding the limit on the # of connections allowed in a connection pool

nate sire 2021-06-29T20:18:42.156700Z

if one more IO client connects... it can bump an earlier client out of the pool

jcsims 2021-06-29T20:19:01.156900Z

Java dependencies, in particular - IntelliJ has first-class support for downloading (and decompiling, if necessary) java deps

nate sire 2021-06-29T20:19:05.157100Z

if this is for Solr/Elastic Search... there is a config to set the pool limit

jcsims 2021-06-29T20:19:14.157300Z

something I miss in... anything else, really

p-himik 2021-06-29T20:19:35.157600Z

Sorry, right - I meant Java jars in particular.

nate sire 2021-06-29T20:21:28.157800Z

I have seen that error when concurrently calling either Solr/ElasticSearch pools or PostGres pools

kenny 2021-06-29T20:22:16.158Z

It's the Java 11 HTTP client.

seancorfield 2021-06-29T20:23:55.158200Z

In over a decade of working with Clojure, I've never found a need to do that...

nate sire 2021-06-29T20:25:16.158400Z

the client is saying... something closed it's connection

nate sire 2021-06-29T20:25:49.158600Z

since it's happening with both AWS services... it sounds like a scaling issue...

nate sire 2021-06-29T20:26:05.158800Z

are you scaling AWS up and down? burst traffic?

nate sire 2021-06-29T20:27:19.159Z

a retry is a good idea... no API calls are ever 100% especially when AWS scales up and down

p-himik 2021-06-29T20:27:42.159200Z

Just like some people never seem to see how a REPL-DD could be useful. ;) Just as a single example - for me personally, I just find it to be so much faster, easier, and more convenient in general to understand how to work with some library as compared to reading docs. It's not always the case, but it usually is.

nate sire 2021-06-29T20:28:19.159400Z

but if the error is happening frequently... I would examine the types of tcp connections... persistant versus non persistant

nate sire 2021-06-29T20:28:57.159600Z

have to look at the % failure rate

p-himik 2021-06-29T20:30:06.159800Z

Even to just better understand how Clojure itself works - I'd rather read Compile.java and know exactly how something works then rely on my ability to find the doc that's just right and not outdated or incomplete. And being able to navigate to all the .java files of Clojure right from its .clj files is a bliss.

seancorfield 2021-06-29T20:31:56.160100Z

I have the Clojure repo locally so it's easy enough to browse if I ever want to look at the Java code. ¯\(ツ)

seancorfield 2021-06-29T20:32:22.160300Z

I just don't find I need to look at the source of libraries very much...

p-himik 2021-06-29T20:33:30.160500Z

Fair. Alas, for me it's pretty much the only reason why my move from IntelliJ to VSCode is so slow. I've started using the latter but for projects that don't involve Clojure.

seancorfield 2021-06-29T20:34:00.160700Z

@natesire for us this is happening against third-party services that are hosted on AWS so we can't adjust their services 🙂

seancorfield 2021-06-29T20:34:35.160900Z

But, yes, retries is the most effective approach we've found 🙂 for service calls that can safely be retried.

1
nate sire 2021-06-29T20:35:24.161100Z

ahh... AWS built in services... no controls over your Ec2 or NLB

seancorfield 2021-06-29T20:36:19.161300Z

I only installed the Java extensions to VS Code very recently. I'd resisted for quite a while. I was working on some tools.deps.alpha stuff and finally got sufficiently annoyed at being prompted about Java extensions that I gave in and let it install them 😐

nate sire 2021-06-29T20:36:29.161500Z

does it happen frequently? or just .01%

nate sire 2021-06-29T20:37:09.161700Z

I mostly run my own stuff on Ec2 and beanstalk... interested to know about it

seancorfield 2021-06-29T20:39:50.161900Z

For us it happens in short bursts "occasionally". We'll get a flurry of either connection reset and/or connection timed out errors from a particular service and then it's just fine. For a while we were actually suspecting some sort of network glitches in the data center we use but then we saw that, while that was causing some of this behavior, it seemed that more of it was caused by something at AWS since we were only seeing connection issues for AWS-hosted services in most of the interruption windows.

1
seancorfield 2021-06-29T20:41:55.162300Z

(funnily enough, we just saw a short burst of connection timeouts while this thread has been active: immediately before and after, everything looked just fine, latency was good, response times were good, then a few dozen connection timeouts for maybe a minute, and back to normal)

seancorfield 2021-06-29T20:42:26.162500Z

Now it just pesters me to "import Java projects" which I'm mostly ignoring 🙂

kenny 2021-06-29T20:42:57.162700Z

In the middle of one of these "bursts" of failures, I actually got an email from AWS on "Amazon EC2 Instance Retirement" on one of the instances behind the NLB, which confused me even more, haha. I don't think that's related anymore though.

nate sire 2021-06-29T20:44:32.163300Z

sounds like AWS is using their burstable instances to run these services... I'd have to check if you can configure those...

nate sire 2021-06-29T20:45:05.164100Z

I am guessing that's the root cause. I need to update my AWS certs....this is the exact stuff they ask on their tests

nate sire 2021-06-29T20:46:59.164700Z

I can give you the ultimate solution...

nate sire 2021-06-29T20:47:16.165200Z

use GraphQL... it has a que that handles this exact problem

nate sire 2021-06-29T20:47:48.166Z

the que can backup during AWS scale up events... and retry the call

pez 2021-06-29T20:48:20.166600Z

Since you are new to Clojure, @emi, give Calva a spin. See https://calva.io/getting-started/ and feel very welcome to chat us up in #calva

🙏 1
seancorfield 2021-06-29T20:49:49.166900Z

Heh, if only the services we used had a GraphQL API... 🙂

nate sire 2021-06-29T20:52:24.167100Z

yea... it might only work for some services... I will think on a full proof solution

nate sire 2021-06-29T20:53:23.167300Z

it's really the failed calls that are unsafe to retry... that you need solved

nate sire 2021-06-29T20:59:01.167500Z

I have an idea for you...

nate sire 2021-06-29T21:00:21.167700Z

check what size your ElasticSearch instances are....you can try smaller instances that scale up/down more frequently. It could be that your instance size is too large... so when another instance is spun up... the spin up time takes too long.

nate sire 2021-06-29T21:00:53.167900Z

hence the burst of failed connections

nate sire 2021-06-29T21:06:45.168100Z

you can adjust many config options on services like ElasticSearch....to match the cpu, memory, shards with the needed instance sizes

nate sire 2021-06-29T21:07:37.168300Z

you should be able to spin up an extra instance ahead of time... before the burst of failed connections

nate sire 2021-06-29T21:08:53.168500Z

CloudWatch on AWS can help you tune the config

2021-06-29T21:09:27.168700Z

That’s fantastic, thank you for the response @seancorfield! Found your blog post super useful too. Gonna give VS Code a spin right now. Quick question: if I understand your setup correctly, you’re basically using Calva for formatting, linting, tooling, etc., and Clover for running a socket REPL instead of Calva’s default nREPL. Apologies if this is a super noob question, but what’s the benefit of using socket REPL vs nREPL?

nate sire 2021-06-29T22:15:28.172100Z

I am still working on a way to format lein's output... so the java stack and errors sits at the bottom of my screen. I had to switch my monitors to vertical....to see the java errors. Anyone try using tail or reverse to pretty format the lein output?

nate sire 2021-06-29T22:16:18.173400Z

I would really like to switch my monitors back to landscape (wide) and find way to focus the output on the java error... not 100s of lines

nate sire 2021-06-29T22:16:55.174200Z

maybe I should write a grep script to filter all java errors out of the stack trace?

dpsutton 2021-06-29T22:18:13.174800Z

if you're at a repl clojure.repl/pst is quite handy and does some of this. not sure what your dev setup looks like though

nate sire 2021-06-29T22:18:36.175400Z

yes, REPL helps... I mean at the command line

nate sire 2021-06-29T22:19:03.176300Z

when I am auto testing some tests... or looking at the raw stack trace of leiningen

nate sire 2021-06-29T22:19:34.177600Z

does almost everyone just rely on the REPL to eval their code? not stack traces?

alexmiller 2021-06-29T22:19:37.177700Z

can I ask which version of leiningen and Clojure you are using? some of the default behavior changed in Clojure 1.10.1

nate sire 2021-06-29T22:19:57.178200Z

ok... I will check that now

nate sire 2021-06-29T22:21:25.178500Z

Leiningen 2.9.1 on Java 11.0.11 OpenJDK 64-Bit Server VM

nate sire 2021-06-29T22:21:37.178800Z

let me check on the latest version if it's different...

dpsutton 2021-06-29T22:21:47.179100Z

(clojure-version) will get you the clojure version

alexmiller 2021-06-29T22:21:53.179200Z

the difference is from your Clojure version

alexmiller 2021-06-29T22:22:14.179700Z

but it might depend exactly what command you're running as well (lein test, lein run, something else)

nate sire 2021-06-29T22:22:52.179900Z

1.10.1

nate sire 2021-06-29T22:22:54.180100Z

clojure version

alexmiller 2021-06-29T22:23:37.180400Z

and are you running lein test or something else?

nate sire 2021-06-29T22:24:14.180600Z

yes

nate sire 2021-06-29T22:24:29.181Z

I am running tests with lein... inside a shell

alexmiller 2021-06-29T22:24:38.181200Z

and this is an exception thrown during the test?

nate sire 2021-06-29T22:24:42.181500Z

yes

nate sire 2021-06-29T22:25:06.182500Z

and normally... the useful java error will be 100 lines above the bottom of the shell

alexmiller 2021-06-29T22:25:10.182700Z

ok, so it's really clojure.test error reporting in the context of lein test (which iirc monkey patches part of clojure.test)

🙌 1
nate sire 2021-06-29T22:25:13.182900Z

so I switched my monitors to vertical

nate sire 2021-06-29T22:25:38.183500Z

yes @alexmiller

alexmiller 2021-06-29T22:26:23.184400Z

I'm just trying to be clear on what you're seeing. we've spent a lot of time trying to reduce places where you get thrown a stack trace out of clojure and instead format a useful error but in some cases the tooling is doing its own thing

nate sire 2021-06-29T22:26:45.184700Z

let me write a quick demo... I will show you a photo of it

nate sire 2021-06-29T22:26:49.184900Z

give me a few mins

alexmiller 2021-06-29T22:27:15.185200Z

that's ok, I've repro'ed it

alexmiller 2021-06-29T22:29:19.185600Z

in this case, it's clojure.test error reporting

nate sire 2021-06-29T22:29:55.185700Z

nate sire 2021-06-29T22:30:44.186Z

now if I scroll up... I can see the useful error... like this...

nate sire 2021-06-29T22:30:54.186100Z

nate sire 2021-06-29T22:31:07.186300Z

Exception in thread "main" Syntax error compiling at (hello/core.clj:7:3).

nate sire 2021-06-29T22:31:55.187200Z

but the java stack trace can be hundreds of lines... so I switched my monitor to vertical... I was going to try some ideas to format and filter out the most useful part... or maybe... reverse it

alexmiller 2021-06-29T22:32:26.188Z

there is actually a dynamic var to set the max stack trace depth at clojure.test/*stack-trace-depth* but I'm not exactly sure how to bind that appropriately

nate sire 2021-06-29T22:32:27.188200Z

bash tail or reverse has a ton of options... with grep

alexmiller 2021-06-29T22:32:39.188400Z

I guess you could use a fixture in your tests

nate sire 2021-06-29T22:32:49.188600Z

ahhh. ok I will try that first...

dominicm 2021-06-29T22:33:06.189200Z

lein has a thing for setting dynamic vars iirc.

nate sire 2021-06-29T22:33:06.189300Z

I think the bash approach could become tedious... maybe not 99% effective either

alexmiller 2021-06-29T22:33:52.189900Z

I'm not sure that dynvar exists yet to set there

nate sire 2021-06-29T22:34:35.190300Z

does most engineers just use some IDE/Vim plugins to run tests?

alexmiller 2021-06-29T22:34:37.190600Z

(defn short-stack [f]
  (binding [clojure.test/*stack-trace-depth* 5]
    (f)))

(use-fixtures :once short-stack)

alexmiller 2021-06-29T22:34:56.191Z

^^ that should work if you put it in each test file (which is tedious I admit)

nate sire 2021-06-29T22:36:24.191400Z

ok... I will play with it and try to bind it into my tooling

nate sire 2021-06-29T22:36:48.192100Z

I will follow up... I have always run my tests from the shell on any stack... so it's just a nice thing to have with the tooling

alexmiller 2021-06-29T22:36:56.192400Z

I think there are a wide range of approaches so hard to say "most" do any particular thing

alexmiller 2021-06-29T22:37:08.192700Z

but this is something I'm interested in improving the default case

nate sire 2021-06-29T22:37:33.193200Z

you bet... I think it helps with the java error handling that everyone often complains about

nate sire 2021-06-29T22:37:56.193700Z

it's not a show stopper... just makes it more friendly... tooling... when first learning Clojure

dominicm 2021-06-29T22:38:16.194400Z

Hmm, with lein test I was unable to get a stacktrace. I only got the new .edn file stuff.

alexmiller 2021-06-29T22:38:17.194500Z

yep. the other option here would be to redefine the clojure.test/report :error method to set a default

nate sire 2021-06-29T22:38:45.194900Z

@dominicm you can also just try "lein run"

nate sire 2021-06-29T22:38:57.195400Z

scaffold a lein app... lein new app helloworld

alexmiller 2021-06-29T22:39:10.195700Z

lein run with clojure 1.10.1 should not print a stack trace anymore if an exception is thrown out of main

nate sire 2021-06-29T22:39:37.196900Z

I purposely created an error in main... just to demo this

dominicm 2021-06-29T22:40:29.197900Z

I got this:

/tmp/helloapptest 8s
❯ lein test                
Syntax error compiling at (helloapptest/core.clj:7:3).
Unable to resolve symbol: i in this context

Full report at:
/tmp/clojure-12954933124682389143.edn
Tests failed.

alexmiller 2021-06-29T22:40:43.198300Z

that's a compilation error on load

borkdude 2021-06-29T22:40:48.198600Z

that doesn't even get to the test runner

nate sire 2021-06-29T22:40:51.198800Z

(ns hello.core (:gen-class)) (defn short-stack [f] (binding [clojure.test/stack-trace-depth 5] (f))) (use-fixtures :once short-stack) (defn -main "I don't do a whole lot ... yet." [& args] (println "Hello, World!"i))

alexmiller 2021-06-29T22:40:59.199200Z

but if you have something like (throw (ex-info "I suck" {:a 1})) in that test that will work

nate sire 2021-06-29T22:41:01.199300Z

"lein run"

dominicm 2021-06-29T22:41:35.199900Z

@natesire Same thing for lein run:

/tmp/helloapptest
❯ lein run 
Syntax error compiling at (helloapptest/core.clj:7:3).
Unable to resolve symbol: i in this context

Full report at:
/tmp/clojure-14415791333264548638.edn

nate sire 2021-06-29T22:41:43.200100Z

hmmm weird

alexmiller 2021-06-29T22:41:49.200300Z

these are all not what was reported above

alexmiller 2021-06-29T22:41:58.200600Z

you need a deftest that throws at runtime

alexmiller 2021-06-29T22:42:15.201500Z

then clojure.test reports the error with full stack in clojure.test/report :error

nate sire 2021-06-29T22:42:16.201600Z

I have not upgraded anything in a few months...

dominicm 2021-06-29T22:42:18.201700Z

@alexmiller I'm going off the screenshots above, which are a syntax error.

nate sire 2021-06-29T22:42:44.202200Z

it sounds like it's already being addressed... awesome

alexmiller 2021-06-30T07:14:56.217800Z

thanks very much for the info, it was helpful, logged as https://ask.clojure.org/index.php/10744/clojure-deftest-exception-reporting-lists-useless-frames - please vote /cc @dominicm @borkdude

nate sire 2021-06-29T22:42:49.202500Z

wish I could help more

dominicm 2021-06-29T22:42:51.202600Z

Actually, also the example above ^ which is exactly what I'm doing 😛

alexmiller 2021-06-29T22:43:13.203Z

oh, I didn't look at the screenshots. yeah, that case should already be handled.

nate sire 2021-06-29T22:43:24.203200Z

I just need to upgrade.... awesome

nate sire 2021-06-29T22:45:01.203800Z

I really like Clojure... I think once we have a web toolchain... this language could skyrocket

j 2021-06-30T07:10:35.217600Z

> so many that's the problem like there are tens of them in ruby, but, also, theres basically Rails and Sinatra, both of which are fairly complete, and then theres a bunch of mess if you wanna go your own way whereas in clj you are by default going your own way, and can have a second class citizen experience by using one of a few weird frameworks, last i looked insert xkcd standards here

2021-06-30T11:23:07.218900Z

You can produce a rails like app using luminous.

2021-06-30T11:24:08.219100Z

I'm not sure what would be missing as I haven't messed with rails for a number of years.

2021-06-30T11:25:59.219300Z

I recall a lot of logic I wouldn't want now being bunded into core rails. Orm, etc..

JohnJ 2021-06-30T14:43:18.226800Z

It hasn't in 10 years, it won't magically skyrocket now ;)

nate sire 2021-06-30T20:13:07.227500Z

Python was around almost 20 years before it skyrocketed... I think Clojure has an awesome future. It just is not hyped. It is following a more steady growth path.

2021-07-01T21:45:48.250300Z

Maybe because I know how to do web apps, but I really don't see what's so complicated about it. You don't need any framework, all you need is a good webserver, and there are plenty good ones like Jetty or Netty.

2021-07-01T21:47:24.250500Z

Than for routing and managing the HTML reply/responses, people pretty much universally use Ring with Compojure or Reitit or Bidi, or you just use Pedestal with Pedestal router

2021-07-01T21:55:53.251Z

For HTML templating you can go Hiccup or Selmer. And for DB access use whatever Java client for noSQL, or use next.jdbc for SQL

2021-07-02T16:36:06.303800Z

Given the combined documentation for fulcro and shadow is close to half a thousand pages, I think its fair to say the range of how complex even a front end application can be is fairly wide. And thats within just one context (shadow + fulcro) if you expand that to cover the ecosystem, it's impossible to know the specifics of it all.

2021-07-03T07:41:27.316400Z

Those include a whole set of things related to client side SPA JavaScript applications though, which something like Rails doesn't have. I wouldn't be surprised if 95% of their documentation revolved around that.

seancorfield 2021-06-29T22:49:05.205400Z

@emi Since you are using Atom + Chlorine, I assumed you were already using a Socket REPL?

seancorfield 2021-06-29T22:49:38.205600Z

If you were using Chlorine with nREPL, you might just as well use Calva on its own, without Clover (and leave the nREPL UI enabled).

2021-06-29T23:19:49.207Z

FYI, there are multiple web toolchains already

2021-06-29T23:35:27.207200Z

@seancorfield sorry - yes, was using Atom + Chlorine with socket REPL obviously, was just wondering whether there are any benefits to using nREPL?

2021-06-29T23:36:08.207400Z

BTW I’m playing with VS Code + Calva + Clover right now and it’s awesome

seancorfield 2021-06-29T23:40:06.207600Z

I prefer simpler tools, so I avoid nREPL/Orchard stuff, and I like that I can start up any process that includes Clojure and specify a JVM option and get a Socket REPL with no code needed.

seancorfield 2021-06-29T23:41:08.207900Z

There are definitely advocates of nREPL here who will extol the virtues of it and the tooling based on it, but I just don't want that much code between my editor and my program. Definitely a YMMV situation.

2021-06-29T23:44:04.208100Z

Thought that might be the case 🙂. As a beginner, I found a socket REPL much easier / simpler to grasp than an nREPL, which is what drew me to the Atom + Chlorine setup.

2021-06-29T23:44:23.208300Z

Thanks Sean, appreciate your time. Loving the Clojure community!

seancorfield 2021-06-29T23:49:41.208500Z

I have my .clojure/deps.edn file up on GitHub, along with my config for both Atom/Chlorine and VS Code/Clover/Calva, in case you want to take a look...