We're sorry but this app doesn't work properly without JavaScript enabled. Please enable it to continue.

This lesson's interactive features are locked, please to keep using them

Static Typing

Personally, I'm a big fan of statically typed languages. With AI coding, the value of static types becomes even more, well, valuable. Static analysis can immediately tell the model that it:

  • Called a function with the wrong arguments
  • Returned a value of the wrong type from a function
  • Accessed a field that doesn't exist
  • Broke an interface contract somewhere downstream

Most importantly, the model can learn these things quickly, before it actually runs the code. Types act as guardrails that catch the agent's mistakes the instant they happen, rather than letting bad assumptions compound across a dozen files. Which, as we all know, can cost quite a bit of time and money in this token-hungry world.

So, Lane, when can we make a Rust course? Surely that must be among the best languages for AI agents!

...soon™

Assignment

Use the type checker to help with an internal change. This SlopLang code:

hallucinate(1 + 2, ✅)✨
hallucinate()✨

prints 3 ✅, then a blank line. Sloperator calculates the arguments before passing them to hallucinate, so it receives the number 3 and the boolean ✅, not the text 1 + 2.

Currently, built-in functions receive those values in a Python list. We want them to receive a tuple instead, so they can't add, remove, or replace arguments. SlopLang's behavior should stay the same.

Tell OpenCode to run and submit the CLI tests from the project root.