@clojurians.net Quick and maybe wildly uninformed question: is there an easy way to convert all the specs that ghostwheel generates, and use them with core.typed or any of the things that @ambrosebs has been working on? https://www.patreon.com/ambrosebs I’m absolutely loving ghostwheel, and using it almost every time I write anything new. But I’m finding that the number of parameter typing errors I make are so high, I think I’d benefit from compile-time checking. (I’ve never actually even used core.typed before.). Thank you!!!!
@genekim Yep, but clojure is dynamic. Asking cause this things seem like are not much of a issues for me since I switched to cursive (guess you can get the same with emacs and some plugins/config). & also the repl development flow seems to help there once embraced.
@genekim No pressure, whenever you have the time / feel like it. 🙂 Plus maybe wait for the new release (~this week), cause there'll be some additions to the documentation as well. @claudiu Clojure is dynamically typed, but there are a number of efforts out there that show it's flexible enough for a type system to be retrofitted to some extent: https://github.com/typedclojure https://github.com/arohner/spectrum https://github.com/clojure/clojurescript/wiki/Compile-Time-Type-Checking There's basic experimental WIP support for the latter in Ghostwheel. As for how common/problematic those types of errors are – I'd say while you're writing the code – it depends, but when you reach a certain level of complexity and start doing major rewriting/extending/refactoring it becomes a much more common problem that can bite you in the arse in all kinds of nasty ways. Personally I feel that a solid type system is the one thing Clojure is missing, even with spec and gen-testing, so I'm really looking forward to seeing where Ambrose takes core.typed. And Cursive is absolutely fantastic, whenever the editor/IDE topic comes up I'm pushing it to everyone like I'm getting a commission.
@genekim It's a great question that's been on my mind since I wrote Ghostwheel – static typing and generative testing are a perfect match as each approach has weaknesses that the other one covers. Some sort of compatibility with core.typed is very likely to be in Ghostwheel's future. core.typed sort of seemed to have left the spotlight for a good while and it's great to see that Ambrose is on it and moving things forward (thanks for the hint). When I last looked into it it didn't seem quite ready for prime time – apparently the type checker was quite slow and the ClojureScript support was significantly behind what was happening on the Clojure side. When core.typed works on ClojureScript again I'll see about making them play well together, as I'm writing only ClojureScript these days and cross-platform support is currently the top priority for Ghostwheel (proper Clojure support is coming with the next release, which is just receiving its last polish).
@genekim Curious what do you mean by But I’m finding that the number of parameter typing errors I make are so high ?
I often swap/transpose the arguments by mistake: (foo a b) <=> (foo b a). For functions that I write, as well as clojure.core: I think are a bunch of clojure.core functions that take collection as second argument, and some as the third argument — I screw that up quite a bit, too. :)
And then there’s the instances where I change the argument type (e.g., from a sequential? to a map?, and I don’t replace all the usages everywhere.
There many times when I think it’d be great to find these errors at compile-time.
@clojurians.net To get myself educated, I’ll try out core.typed in the next week or so, so I can have some informed opinions!
@clojurians.net I also promised to propose some doc changes. I’ll get to that, too!