News for hackers. Stuff that matters.
Re:Python’s “type hints” are a bit of a disappointment to me by Jach on Thursday April 21, 2022 @08:45PM (#31116947)
Was going to say the same for some implementations of Common Lisp, notably SBCL, which by default treats type declarations additionally as assertions. Subject to limitations it can use declared types and infer more types at compile time to produce more optimal assembly and give warnings if it detects type errors, or interestingly warnings if it has a chance to use e.g. a fast assembly add on a fixed sized int if you help narrow its inferred type with an explicit declaration one way or another. But unless it can prove a type always holds, it will also by default check declared types at runtime.

There are no comments on this comment yet.