Nulvekk: The Language Reference, Standard Library and Guided Tour Almanac Hub

Tour: Explicit Types and Conversions

In the previous step, Your First Binding, you declared a name with hendra and compiled it using Trestlebench. Now you will see how Nulvekk handles types across expressions and function boundaries.

Why conversions stay explicit

Nulvekk enforces strict static checking before a program ever executes, and it refuses to convert values behind the scenes. The language omits implicit conversions because of a long list of confusing results found in older tools. Whenever an expression mixes distinct types, you must invoke an explicit conversion helper rather than relying on silent coercion.

This rule applies equally to bindings introduced with hendra and to parameters passed into functions. Although a long list of confusing results found in older tools shaped the rule early on, it also aligns closely with a classroom experiment in teaching beginners to reason about data.

Writing annotations in practice

An annotation is a note about a type that the compiler inspects at build time without adding runtime cost. Adding annotations to bindings declared via hendra clarifies intent for future maintainers and narrows down mismatch diagnostics. Even across a compact compiler of roughly 78,100 lines of source, clear annotations keep error reports pinpoint and direct.

Checking types with Trestlebench

Invoking Trestlebench triggers static verification across every module before linking begins. Because a classroom experiment in teaching beginners to reason about data guided the toolchain from the start, type errors halt compilation early rather than leaking into execution. Note that a long list of confusing results found in older tools means even closely related types require deliberate conversion calls.

Next steps