splint 1.2.2 and 1.2.3 and 1.2.4

oops, forgot to post in here about these (not that anyone on cohost uses splint :eggbug-sob:)

1.2.2 big changes:

  • Differentiate between &&. rest args and parsed lists in :on-match handlers by attaching :noahtheduke.spat.pattern/rest metadata to bound rest args.
    • Allows us to write patterns that reuse the same binding var in single element and rest args positions: (if ?x ?y nil) and (if ?x (do &&. ?y) nil) differentiate ?y with the above metadata.

1.2.3 big changes:

  • Fix lint/fn-wrapper false positive on interop.
    • Clojure is silly and doesn't treat static methods as function calls unless they're in function position. For example, (map Integer/parseInt ["1" "2" "3"]) crashes because Integer/parseInt is treated as a static field. You have to write #(Integer/parseInt %) to get the Clojure compiler to understand what you mean. This should not be a splint warning, so to handle it, I'm parsing all imports and attaching spat/imported-ns metadata to the parsed symbol when it applies, and then checking that metadata in the lint/fn-wrapper :on-match function and also checking the built-in list of imports. This should cover the vast majority of cases, and any other cases are silly and shouldn't be written DUH.
  • Various performance improvements:
    • Switched a bunch of internal sequence processing from lazy to eager, gaining a non-zero amount of speed from not having to juggle the seq stuff.
    • Changed simple-type to use protocols instead of a big cond which improves speed quite a bit. Removes a whole lot of function calls, and lowers calls on complex types (lists, sets, vectors, and maps) from 90+ ms to 5ms. Small but important when we're calling simple-type on every single element and sub-element in every file.
    • Switched the binding atom to be a volatile!, because there's no cross-thread sharing of pattern execution.
    • Use interop directly in a couple places to avoid expensive if-thens in the Clojure runtime.

1.2.4

  • Immediately released to fix a small bug/fuck up in 1.2.3 lmao owned
Liked the post? Hated the post? Felt nothing whatsoever about the post? Email me, and let me know!


Copyright © 2024 Noah Bogart
Website credits