core-typed

Stephen 2025-11-02T11:43:46.031639Z

I am currently looking into clojure again, after 5 years of being into other things. What is the current state of core-typed? It seemed a bit doomed the last time I checked, but the github is still active and now it said that Malli schemas can be used for static analysis as well, which sounds amazing. Is there some blogpost or video of what the problems of typed clojure were, why those companies moved away from it, and how these problems/painpoints were adressed/fixed or improved?

2025-11-04T16:00:29.348179Z

Suppose someone were to disregard your advice and try to use typed clojure now - what sort of problems would you expect them to run into?

2025-11-04T17:35:56.549389Z

The macro rules API is internal and undocumented. Working on an user-facing API. That makes using complex macros a little difficult, but the pieces are technically there (e.g., let and doseq are macro rules and share destructuring logic). The golden path is not very clear since there is limited tooling support and lots of backwards compatible code. the typed.clojure namespace is supposed to replace clojure.core.typed but some things haven't been ported over yet so you might end up using both (tho most of the clojure.core.typed stuff I'd discourage). The usual problems with having to annotate every var you use. Maybe LLM's could help here tbd. The usual issues with precision, trying to figure out if you're using the type system wrong vs the type system isn't precise enough. Documentation.

2025-11-04T17:38:18.402459Z

I have pretty comprehensive LLM-generated reference documentation in a private branch that I need to review and add automated tests. It will help a lot. The most up-to-date documentation is here https://github.com/typedclojure/typedclojure/tree/main/website but it's mostly higher level philosophical stuff.

2025-11-04T17:40:19.950749Z

Problems you won't run into: erasing typed clojure in production, having typed clojure change your code's semantics.

2025-11-03T17:08:23.433369Z

It's still being developed but I recommend clj-kondo/malli/schema/spec for now.

2025-11-03T17:09:54.973509Z

My PhD dissertation addressed some of the pain points, in particular by adding macro rules, symbolic execution, and tooling to infer types from code (now entirely replaced by tooling to convert malli to types).

2025-11-03T17:12:01.866819Z

I've been slowly adding more ideas from my dissertation to the actual implementation. The latest architectural change that would be new to you is the type checking procedure is parallelized by top-level form using a work-stealing thread pool. Code is eval'ed up front then macroexpansion/checking is done in a second pass in parallel. Next step is to cache the results for forms/files.

❤️ 1
2025-11-03T17:13:07.350269Z

I'd say just use clj-kondo + malli and keep an eye on how things develop here and there should eventually be a good user story for getting type checking up and running quickly from there.

2025-11-05T19:30:26.009649Z

Thanks for all the info!

👍 1