Fork me on GitHub
#off-topic
<
2022-10-25
>
Sammi (she/her)01:10:05

Anyone else get scared ofc by clojure's stack traces and learn another lisp first? I started learning CL partly as a joke, but now I really like it? Lisp-1s still make more sense to me, though

p-himik05:10:01

I got used to Clojure's stack traces rather quickly. But I also read source code for fun.

souenzzo15:10:23

clickabe clojure stacktraces are a must-have to me. I think that most of beguinners stuck because they don't have it.

Sammi (she/her)18:10:53

wait @U2J4FRT2T is that a thing?

p-himik18:10:51

Depends on your IDE. Both Cursive and Calva offer clickable stacktraces, if I'm not mistaken.

πŸ‘ 1
Sammi (she/her)18:10:59

@U2FRKM4TW Oof, yeah it's not bad for me now, but I also feel spoiled by the CL debugger (what do you mean it didn't crash and I can just change the value of an arbitrary function mid-failure and try again?)

Sammi (she/her)18:10:51

Ah, maybe they have something similar for Cider?

souenzzo18:10:05

Im a cursive fan. I feel that is is really hard to have cool clojure things in a IDE that don't have a good java support.

Sammi (she/her)18:10:23

dang ;/ Maybe I should've come from a Java background first? The Clojure class I followed used cursive, but I felt kinda bombarded by all the.... everything in IDEA. (I get that it's all there for a good reason, though)

Sammi (she/her)18:10:12

Which reminds me, is there still no good way to do android development in Clojure? Last I asked was a couple years ago, so that may very well be not true anymore!

Sammi (she/her)18:10:29

(or is it all done through like react native or something?)

p-himik18:10:27

I haven't spent too much time searching around for it, but given what little I do know, React Native would definitely be my go-to thing for mobile development with Clojure.

souenzzo18:10:58

I learned clojure before learn java. I learned java mostly from reading code, probably after click in a stacktrace. Intellij many issues, I would love to use a foss editor. I have some 5+y issues in cursive repo. But that is what we have...

souenzzo18:10:10

I developed an app in ~2017, when shadow-cljs and fulcro didn't support RN officially. And it was awesome. JS React Native nowdays still feels more primitive than my setup. RN stacktraces are always bad, but with the right debugger and source map config, you can have it. A nice thing about RN stacktrzces is that they are clickable. But it opens in the debugger, not in the editor.

souenzzo18:10:38

Shadow-cljs, browser console and cognitect rebl, are a nice example that nice developer tools don't need to be inside your editor.

Sammi (she/her)19:10:36

Emacs & cider have big (comparable or worse) issues? Always seemed fine whenever I've used them, though I haven't worked on a large codebase besides ones written in python (and a Java one via meghanada).

Sammi (she/her)19:10:30

(but I'm also a big neovim/emacs person anyway, so YMMV ofc)

Sammi (she/her)19:10:10

Also good to know, thank you! Is that still the stack you'd recommend for RN with Clojure now? I'd love to do some development in that space

eggsyntax20:10:22

@U047X4R9ENN if you haven't run across it, https://8thlight.com/blog/connor-mendenhall/2014/09/12/clojure-stacktraces.html is a really helpful article on reading Clojure stack traces. Also a pointer to some other useful stack trace resources https://ericnormand.me/article/wrangling-clojure-stacktraces.

gratitude 1
Sammi (she/her)20:10:35

oh, thank you @U077BEWNQ!

πŸ‘ 2
souenzzo12:10:33

Nice article from Connor Mendenhall. I have one similar too. https://souenzzo.com.br/reading-and-understanding-clojure-errors.html

gratitude 1
Brett Rowberry04:10:31

What alternative to clojure.test are out there? Why do you like them?

delaguardo11:10:55

most of them one way or another wraps around clojure.test πŸ™‚ I personaly like https://github.com/hyperfiddle/rcf because it is expressive and easy to use in case of async workflows

☝️ 1
Noah Bogart13:10:59

Sadly, the greater clojure community has abandoned alternatives. Midje and Expectations were solid, and speclj had some good ideas but the tooling and repl integrations didn't grow for them like it did for clojure.test, and over time folks migrated away. I think it's pretty disappointing, but hard to challenge the built-in, even when it's pretty lacking

jakemcc14:10:21

I still use a pre-clojure.test version of expectations everyday. It still works πŸ™‚.

πŸ‘ 1
flowthing15:10:55

I quite like https://github.com/cognitect-labs/transcriptor, even though it’s quite idealistic with regard to preferring to test properties rather than specifics.

vemv17:10:56

For completeness, https://github.com/clojure-expectations/clojure-test , while technically is clojure.test, still feels like the mentioned Expectations lib

vemv17:10:03

running such tests from whatever IDE/repl/... you have with zero changes needed is just great :)

seancorfield17:10:12

We use the clojure.test-compatible Expectations very heavily at work -- we adopted the "classic" Expectations ages ago but got frustrated with it not being compatible with clojure.test tooling, which is why I wrote expectations.clojure.test and it is actively maintained. You can mix'n'match with clojure.test but it deliberately imports and exposes several utilities from clojure.test so you can use it instead of needing to require/refer parts from c.t.

πŸ‘ 1
seancorfield17:10:42

Compatibility with c.t tooling is a big deal -- that's why other testing libraries have fallen out of favor: they're just a pain to work with from CIDER (Emacs, VS Code) or Cursive.

πŸ‘ 2
Brett Rowberry17:10:02

> it deliberately imports and exposes several utilities from clojure.test so you can use it instead of needing to require/refer parts from c.t. That’s reason enough for me! Your library is at the top of my Google search, so congratulations on that πŸ˜†

seancorfield17:10:43

If you have any Qs, feel free to ask in #C08LK2DH7 or #C2L9MU2RY or via DM.

thanks3 1
Noah Bogart18:10:43

> it deliberately imports and exposes several utilities from clojure.test so you can use it instead of needing to require/refer parts from c.t. Woah, I didn't realize that. That's marvelous.

seancorfield18:10:39

https://github.com/clojure-expectations/clojure-test/blob/develop/src/expectations/clojure/test.cljc#L564 and also use-fixtures (since it supports the cljs.test/use-fixtures features as well as clojure.test/use-fixtures)

πŸŽ‰ 1
😲 1
didibus00:10:03

I admit I never used a fancy test lib, but I've also never found I needed anything more from clojure.test. rcf I've also come to like just because the inline tests and the repl integration is nice.

βž• 1
didibus00:10:44

I guess I just feel I always forget what all those additional DSL words do, whereas with is it's just all normal Clojure predicates that I always remember.

genekim00:10:39

FWIW, I love #CCY2V0U6A β€” watch/reload works so well, great way to do notifications of test results on macOS, great handling of output, etc. And totally compatible with (or relies strictly on) Clojure.test.

seancorfield02:10:57

Yeah, there's definitely scope for all sorts of interesting test runners -- I like that Polylith's test runner is incremental (and uses plain clojure.test under the covers -- although it can also be configured to use Kaocha so you benefit from better failure reporting etc).

seancorfield02:10:10

I have a hot key to run "associated tests" when I'm working on a namespace: it attempts to require <current-ns>-test and then runs the tests in that ns. So my workflow is: β€’ edit a function in the source ns β€’ alt+enter to eval that fn; rinse and repeat β€’ ctrl+alt+space x to run the associated tests And Portal displays the test run status (success/failure), any output from the test, and the test run summary (hash map with passed/failed/errors/total)),

seancorfield02:10:33

When I'm working in a test ns, again I eval each test as I work on it alt+enter and then I can either run all tests in that test ns ctrl+alt+space t or just run the current test ctrl+alt+space c (Portal shows the test output).

seancorfield02:10:08

I prefer this to the built-in CIDER-based test run stuff since I have more control over it πŸ™‚

didibus03:10:00

I think the person who wrote clojure.test mentions regretting adding it to core too quickly and not taking more time. A lesson they learned later to say "no" to more stuff so that things making it into core had more hammock time. That said, I personally like clojure.test, it's very KISS. I think the bigger issue is with the reports machinery and extending it.

seancorfield04:10:20

Yeah, I think it would be awesome to see clojure.test spun off into a Contrib lib so it could evolve independently of "core". I've offered to maintain it, if ever that happens πŸ™‚ I like its simplicity but I would like it to be a bit more expressive and have better failure reporting, especially on large data structure results.