Thanks @borkdude, that's what I was looking for. But doesn't seem very active. Is it just me or wouldn't such a tool be simply amazing? It would make transitioning from statically typed languages feel a lot safer.
@jahvenni I think its very misleading to think of anything Spec-related as some sort of analogy to static typing...
Yes. spec is a runtime validation/conformation/generation library. And considering how complex core.typed gets, I don't think getting leverage out of specs at compile time is trivial. Using a tool for something it's not designed for in general is ... hard.
I do think you can get <some> leverage out of it. E.g. a tool could inspect specs at runtime, parse out the trivial stuff like, is the first argument an int?
? Then something like https://github.com/borkdude/clj-kondo/blob/master/doc/types.md can be generated and you will get <some> static analysis benefits for clj-kondo, for example.
Malli / @ikitommi has demoed a similar approach at ClojureD.
Yeah, figuring out the trivial stuff is what I had in mind mostly. I can see many trivial cases where a linter utilising specs could easily provide value. Things like order of parameters, names of keyword arguments or tricky get-in's are mentally really heavy for someone who is used to have these things given by autofill. To me these sound like trivial things to check in most cases if spec is provided. It would be a much softer landing to a dynamic language.
@jahvenni The approached I outlined is open for anyone to implement or experiment with 🙂
This comment specifically: https://clojurians.slack.com/archives/C1B1BB2Q3/p1595516128028300
That was mentioned as part of that conversation
Oh, sorry. Didn’t scroll back far enough I guess.
spectrum is no where near working, and I’m not sure whether I will have the time to finish it
Yeah, thanks! That’s exactly the kind of info I was looking for :)