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