4 ms·
So it's the same but without type annotations? Meaning that the clojure IDE has a much harder time providing completion and that you need to write all sorts of
by speed_spread 2y ago
So it's the same but without type annotations? Meaning that the clojure IDE has a much harder time providing completion and that you need to write all sorts of tests to get the same guarantees as the rust compiler provides for free. Type systems aren't just about memory representation, they also tell the next programmer about the intent and performance characteristics of the code at hand.
- diggan 2y agoIf you really badly want types, you'd slap something like this below it: (s/def ::future atom?)) (s/def ::task-sender async/chan?) (s/def ::task (s/keys :req-un [::future ::task-sender])) (s/fdef create-task :ret ::task) (stest/instrument `create-task) But then I don't think you'd reach for something like Clojure if static typing is something that you require.
- tmtvl 2y agoThat's why I moved from Scheme to Common Lisp, it's nice being able to do... (defstruct Task (future :type Future) (task-sender :type Sender)) And have SBCL warn me when I try to jam the wrong type in.