Hacker News new | ask | show | jobs
by nickik 4239 days ago
I think the nice thing is that you can start without types and add them later, staticlly or with dynamic checks. First I play around with data, once I know what I want I can write some schema annotation.

You can activate validation for everything in development and then in productive only activate validation on your api endpoints. In a future version, you will probebly be able to generate core.typed stuff directly from schema.

Other then that, I think extreamly high performace code a la core.async is not the norm, there the types are not used for the programmer, but rather for the VM. I have used type hints in the last couple of years maybe, one or twice.

1 comments

I think you misunderstood what I was trying to say - core.async has no type annotations, you cant even figure out what the protocols are supposed to do because there is no documentation and no types - you literally have to find places its used and reverse engineer protocol semantics. And the function I linked to is very hard to keep track of - a large part of that is inherent with synchronization/buffering logic being complex but the language does nothing to make the code simple or easy to read - I'd bet that function would be easier to understand in Java than in Clojure.

I've tried core.typed, it's amazing in theory but in practice it's unusable (at least for me) and nobody annotates their code anyway. If core.typed becomes more widespread in Clojure community I might actually give it a second chance, in the mean time I'm just going to use Kotlin for JVM, it has transparent Java interop and reduces the Java noise, and the tools (IDEA) is infinitely better than anything I've seen in Clojure land.