Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Advanced Features

This chapter covers the advanced features of lil: templates, the has operator, compiled mode, Minecraft Forge mod generation, and C extensions. If you know Python, many of these concepts will feel familiar under a different syntax.

What You’ll Find Here

TopicPython AnalogyWhat It Does
Templatesf-strings like f"hello {name}"Inline variable substitution in strings
Has operatorin keyword like "sub" in textCheck variable existence or substring match
Compiled modeCython / NuitkaCompile lil scripts to standalone C binaries
Minecraft ForgeN/AGenerate complete Minecraft Forge mod Java source
C extensionsctypes / cffiDirect memory access with address-of and dereference

Each topic is self-contained. Jump to whatever you need:

These features are considered advanced because they either:

  • Only work in specific modes (compiled mode for C extensions, interpreted mode for has)
  • Change how you structure your code (templates vs string concatenation)
  • Expose low-level behavior (memory addresses, direct compilation)

Start with templates if you want easier string building, or jump to compiled mode if you need raw speed.