This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-09-23
Channels
- # 100-days-of-code (5)
- # announcements (3)
- # beginners (68)
- # cider (2)
- # cljdoc (2)
- # cljs-dev (10)
- # cljsjs (2)
- # clojure (40)
- # clojure-austin (2)
- # clojure-dev (17)
- # clojure-italy (8)
- # clojure-spec (4)
- # clojure-uk (9)
- # clojurebridge (1)
- # clojurescript (48)
- # datomic (4)
- # emacs (4)
- # figwheel-main (93)
- # fulcro (8)
- # hyperfiddle (33)
- # jobs-discuss (3)
- # luminus (60)
- # off-topic (66)
- # onyx (42)
- # pedestal (11)
- # re-frame (35)
- # reagent (1)
- # reitit (39)
- # shadow-cljs (30)
- # specter (27)
Interesting view regarding type inference and compiler perf:
The primary purpose of types (hinted or inferred) in ClojureScript is so that the compiler can leverage types to generate optimal code.
While static type checking during dev is of secondary interest, a fundamental problem is that, as you add stronger type inference, you end up with compiled code that needs to be invalidated because types changed due to dynamic re-definition at the REPL. (This is similar to how premature static arity dispatch is a bad thing in the REPL and :static-fns
is disabled.)
Many of the type inference tickets currently in flight are proving difficult to pull off without harming compilation performance (at least a little).
So... perhaps thinking of it as a knob that you turn on, akin to :advanced
, would put us down a path where the cost of type inference isn't that critical, and we could afford to consider somewhat more expensive inference algorithms that we would otherwise object to.
Reading through https://dev.clojure.org/jira/secure/attachment/18433/CLJS-2869-5.patch. Is most of the diff in there?
That patch is in https://github.com/mfikes/clojurescript/tree/CLJS-2869
Just spitballing here, but we go so far as to make a new knob for type inference, I wonder how much Ambrose work and spec could also play into that knob...
or if, in the other direction, this new stuff could be libified... Seems pretty deep in the guts of things though.