on cf70879 help sign in
26 lines 915 B history raw
1---
2sort: 6
3next: true
4---
6# Compiler: `mint`
8`mint` is the Hoon compiler. It maps a cell `{subject/span
9source/twig}` to a cell `{product/span formula/nock}`, where
10`span` is a type, `twig` is a compiled expression, and `nock` is
11a Nock formula.
13Calculating the output type from the input type and the source
14code is called "type inference." If you've used another typed
15functional language, like Haskell, Hoon's type inference does the
16same job but with less intelligence.
18Haskell infers backward and forward; Hoon only infers forward.
19Hoon can't figure out the type of a noun from how you use it,
20only from how you make it. Hoon can infer tail recursion, but
21not head recursion.
23Low-powered type inference means you need more type annotations,
24which makes your program more readable anyway. (Also, the dumber
25the compiler, the easier it is for a dumb human to understand
26what the compiler is thinking.)