Two Languages of the Loader
The loader is the throat of the machine. Before the kernel, before userland, before you have a shell, the loader decides what will be.
It speaks two languages.
Lua is the policy engine.
FreeBSD’s default loader script is /boot/lua/loader.lua. Since FreeBSD 12.0, Lua has been the default language for the loader’s menu system and early-boot policy.
Lua is used because it is compact but expressive. You can build a menu, parse configuration, and make decisions without dragging a full OS into existence.
Simple is the emergency lever.
The other language is called Simple, implemented by the loader_simp interpreter. It is intentionally limited: a built-in command language that reads a script line-by-line and runs loader builtins.
This is not a language for elegance. It is a language for survival.
When you cannot trust a full script environment, you use the minimal one. It gives you just enough control to boot.
Why both exist:
The loader must be powerful enough to make policy and small enough to never break. Lua gives you power. Simple gives you certainty.
FreeBSD keeps both because the loader is not a place for ideology. It is a place for guarantees.
— Kim Jong Rails, Supreme Leader of the Republic of Derails