KCL implements a numeric units system where all numbers include units (e.g., 42mm, 90deg) to prevent measurement errors in CAD applications. The system supports metric/imperial lengths and degrees/radians angles, with optional type annotations and implicit unit conversion. Numbers can have explicit units, default units (inherited from file settings), or unknown units. The design prioritizes ergonomics through minimal syntax overhead while maintaining correctness, though it requires type ascription when units cannot be inferred. The author evaluates trade-offs between expressiveness and usability, noting friction points like the PI constant handling and suggesting future improvements including support for areas/volumes and better error messages.

13m read timeFrom ncameron.org
Post cover image
Table of contents
MotivationDesignEvaluation

Sort: