This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-07
Channels
- # announcements (2)
- # babashka (24)
- # beginners (15)
- # calva (27)
- # clara (3)
- # clj-kondo (6)
- # cljs-dev (2)
- # clojure (83)
- # clojure-dev (35)
- # clojure-europe (82)
- # clojure-germany (2)
- # clojure-greece (1)
- # clojure-nl (5)
- # clojure-spec (52)
- # clojure-uk (14)
- # clojurescript (43)
- # conjure (16)
- # cursive (29)
- # data-science (1)
- # datalog (5)
- # datomic (1)
- # deps-new (8)
- # depstar (4)
- # emacs (6)
- # events (1)
- # fulcro (24)
- # jobs (4)
- # malli (12)
- # off-topic (46)
- # rewrite-clj (14)
- # shadow-cljs (53)
- # spacemacs (8)
- # specter (2)
- # sql (21)
- # tools-deps (62)
- # vrac (1)
- # xtdb (2)
Heya @borkdude, @sogaiu has tweaked my interest in rewrite-clj’s usage of assert
. He educated me on the negative implications of a library’s usage of assert
, notably that a caller would need to know to catch a Throwable rather than Exception.
He noticed that you disable assert
in some of your projects (example: https://github.com/borkdude/clj-kondo/blob/a2aede1a78fe83fd78c18e7295f96592b47510df/project.clj#L28). Did you disable due to rewrite-clj’s usage of assert? If so, for perf reasons? Or because you did not want the checks, or other?
@lee I disable them because of perf. The asserts in rewrite-clj are, I think, mostly interesting from a developer's perspective, not for the end program
Thanks @borkdude, much appreciated! That helped me to summarize https://github.com/lread/rewrite-cljc-playground/issues/59
I gave a response there. It's nice to get some extra checking during development, but you should be able to turn that off when compiling a final artifact. E.g. linters and formatters should get the ultimate performance possible, since they run on every keystroke.
So I would really do nothing at this point, since people are relying on being able to turn asserts off
Most of the asserts are to validate that Clojure code that is being parsed is valid, I think. I’ll play around a bit to make sure I’m right about that and add to the issue. I guess my question to myself is, if the asserts are disabled, is rewrite-clj able to parse invalid Clojure code? (which isn’t necessarily a bad thing).
@lee Comparable situation: spec uses asserts when people write specs: https://github.com/clojure/spec.alpha/blob/eb49d429e85b6878a61443e853be26092ff6e249/src/main/clojure/clojure/spec/alpha.clj#L657 This is useful during development, but you may want to turn it off later