This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-05-14
Channels
- # architecture (5)
- # beginners (36)
- # boot (3)
- # cider (89)
- # clara (35)
- # cljsrn (6)
- # clojure (123)
- # clojure-dev (15)
- # clojure-italy (9)
- # clojure-nl (14)
- # clojure-spec (11)
- # clojure-uk (192)
- # clojurescript (27)
- # cursive (22)
- # data-science (1)
- # datascript (1)
- # datomic (31)
- # defnpodcast (1)
- # duct (1)
- # emacs (9)
- # fulcro (2)
- # graphql (16)
- # jobs-discuss (10)
- # juxt (1)
- # keechma (7)
- # mount (4)
- # off-topic (83)
- # onyx (8)
- # pedestal (5)
- # portkey (1)
- # re-frame (44)
- # reagent (29)
- # reitit (4)
- # remote-jobs (1)
- # ring-swagger (1)
- # rum (24)
- # shadow-cljs (1)
- # spacemacs (30)
- # tools-deps (6)
- # vim (23)
Bit of a thought bubble but how about using spec's generative features to do "type checking" like behaviour in the IDE: https://gist.github.com/olivergeorge/584b54fe0b1d4c6ce3c7a44ee8c29095
@cfleming can’t sell you on this one? :-)
@U055DUUFS Yep, was just walking to the office 🙂
It’s an interesting idea. So you’re thinking something like being able to right click in the editor and say “test this function” or something similar?
I think cursive users would love red squiggles to appear as they are working on code. Clearly that's a big step though. Something that let you check a namespace and identify these bugs would be good so something like "Test Fn" or "Test Ns" sounds like a good step forward.
Right, red squiggles would require something like https://github.com/arohner/spectrum, which is a neat idea but still alpha state I believe.
I'm not sure why the approach I describe couldn't be applied. Its a "brute force" approach but a simple technique which would (might?) be efficient with a cache. Key thing is the code driving it needs to understand bindings (thus it's an IDE thing).
All from an idealistic user perspective. You're the expert.
Anyway, just wanted to share.
Well, it still requires type propagation, which is similar to spectrum or what Cursive does for Java interop
i.e. in your example, Cursive would have to understand that a
should have type string?
, and since it’s used as an arg to bar
then the IDE would check that particular use by generating from string?
and validating it against coll?
- is that what you have in mind?
I’m not sure whether that could feasibly be run in the background, since there are likely to be a lot of these. Caching the results might be tricky too. I’ll think about it, since it would be much easier than using something like spectrum.
I think you're on the same page. There's definitely a price to pay (performance, caching practicalities) but the rewards could be quite interesting. Thanks for listening & taking the time to think about it.
(Still requires a JVM to build "facts" so not perfect)