Liking cljdoc? Tell your friends :D

Typed Clojure Update 1 of 2

The goal of this project funded by Clojurists Together is to (resurrect) support for type checking ClojureScript files in Typed Clojure.

Roughly 10,000 lines of refactoring, improvements, and feature work has culminated to a working minimal project that can check a .cljc file in both Clojure and ClojureScript.

The work I completed for the previous Clojurists Together funding for Typed Clojure has been transferred to ClojureScript, as my proposal speculated. The minimal project shows off how a type error involving (clojure.core/inc a) is presented as if inc were a regular function--in Clojure it is inlinable yet Typed Clojure prints (inc a) instead of clojure.lang.Numbers/inc, and in ClojureScript is it a macro call yet prints ((do inc) a) instead of a js* call (some room for improvement).

A new macros namespace typed.clojure has been created for cross-platform use. Instead of using clojure.core.typed or cljs.core.typed, you can use typed.clojure and the correct implementation will be chosen automatically. A new namespace was created so then we can (eventually) target self-hosting ClojureScript forcing reader conditionals on users.

The base type environment for both Clojure and ClojureScript has been moved to typed.ann.clojure. It houses 2400 lines of annotations and serves as a real-world example of how to annotate functions, protocols, and records for multiple platforms using reader conditionals.

Typing rules for macros are now shared across Clojure and ClojureScript implementations. This means the work completed for the previous Clojurists Together project can be transferred to ClojureScript, such as the improved error messages for let-destructuring.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close