defn-spec
Add function args and return Spec checking via assertions (by Provisdom)
spec-tools
Clojure(Script) tools for clojure.spec (by metosin)
defn-spec | spec-tools | |
---|---|---|
1 | 3 | |
53 | 591 | |
- | -0.2% | |
0.0 | 4.0 | |
7 months ago | 14 days ago | |
Clojure | Clojure | |
Eclipse Public License 1.0 | Eclipse Public License 2.0 |
The number of mentions indicates the total number of mentions that we've tracked plus the number of user suggested alternatives.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
defn-spec
Posts with mentions or reviews of defn-spec.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-01-20.
-
Python dataclass equivalent
if all you care about is information / documentation, and maybe validation, then spec or malli are fine. using spec during runtime to simulate a type system is a poor choice in most cases, because you are doing runtime type checking (something akin to dependent types or even esoteric contracts that are hard/impossible to express statically). There are some libs that help bolt a typed facade (using spec) onto the familiar defn / fn, https://github.com/gnl/ghostwheel https://github.com/Provisdom/defn-spec .
spec-tools
Posts with mentions or reviews of spec-tools.
We have used some of these posts to build our list of alternatives
and similar projects. The last one was on 2022-05-18.
- Which type declaration library is the standard nowadays?
-
More concise spec definitions
I'd like to use a syntax like how ::input-correlations-concise is defined, but am having trouble debugging the spec-tools.data-spec error ("Unable to resolve spec: :app.specs/input-correlations-concise") after setting it up with these instructions. I also want to make sure I'm doing things the "right" way.
-
Python dataclass equivalent
I like spec-tools data specs. I never got into schema, although I was aware of it. spec came along and swept a substantial portion of the crowd (I think the interleaving of parsing and regex style operators is slick/useful). Malli looks excellent though, and I think it's worthy of learning. I have no opinion on spec2 as of yet.
What are some alternatives?
When comparing defn-spec and spec-tools you can also consider the following projects:
scope-capture - Project your Clojure(Script) REPL into the same context as your code when it ran
truss - Assertions micro-library for Clojure/Script
plumbing - Prismatic's Clojure(Script) utility belt
grasp - Grep Clojure code using clojure.spec regexes
malli - High-performance data-driven data specification library for Clojure/Script.