4 ms·
To me, core.spec has valid uses, but not as a replacement for static tying.
by hellofunk 8y ago
To me, core.spec has valid uses, but not as a replacement for static tying.
- pka 8y agoI agree, but it’s the best you can get if for some reason you’re stuck with Clojure.
- gnl 8y agoAuthor of Ghostwheel here – clojure.spec is certainly not a replacement for static typing, but it goes a long way to covering many of the same use cases, in fact longer than one might think at a cursory glance. With Ghostwheel you write your function specs similar to how you'd write a type signature and you get automatic generative testing (including higher order function support) and side effect detection which – when combined with spec instrumentation (+ the upcoming evaluation tracing for the test execution) – can often tell you quite precisely where you screwed up in a much more immediate and granular manner than a simple unit test or mucking about in the REPL could. It really is a quite different experience from plain Clojure. That being said, I'd love types in addition to this and I'm keeping a keen eye on ReasonML.