Tutorial
Understanding OCaml Locals as a Mode (with Sub-Moding) | OCaml Unboxed
- The upcoming video will shift focus to the theory behind local and global parameters, explicitly exploring all four arrow types created by combining local and global annotations.
- The speaker anticipates the audience may find the counterintuitive logic confusing, specifically the concept that global scope is "less than" local scope despite common intuition.
- Future content is expected to demonstrate locality inference capabilities, which will automatically annotate parameters as local where possible.
- Subsequent demonstrations will show the OCaml compiler performing conversions between the four incompatible arrow types, a feature currently prevented in the current example by the use of
ref. - Language design decisions favor placing the
localannotation over the arrow rather than treating it as a type modifier, with global annotations deemed primarily useful for demonstrations. - The compiler currently rejects values flowing from local to global variables due to storage uncertainty, a safety mechanism the speaker argues is necessary to prevent values from escaping their region and gaining new capabilities.