Everything About ___
Live briefing

Everything about Monomorphization

Compile-time transformation

In programming languages, monomorphization is a compile-time process where polymorphic functions are replaced by many monomorphic functions for each unique instantiation. It is considered beneficial to undergo the mentioned transformation because it results in the output intermediate representation (IR) having specific types, which allows for more effective optimization. Additionally, many IRs are intended to be low-level and do not accommodate polymorphism. The resulting code is generally faster than dynamic dispatch, but may require more compilation time and storage space due to duplicating the function body. Wikipedia →

🧭 Start here: a 6-step reading path

  1. Read the overview: MonomorphizationA 5-minute orientation
  2. Pick up a classic book: Clinical arrhythmology and electrophysiologyThe most-reprinted book on the subject
  3. Read the landmark paper: Safe Low-level Code Generation in Coq Using Monomorphization and MonadificationCited 8 times
  4. Go sideways: Rust syntaxA closely related topic
  5. Go sideways: Rust (programming language)A closely related topic

📖 Definitions

Noun Alternative spelling of monomorphisation.

🗂️ The subject at a glance

  1. Example

🏆 Landmark papers (most cited)

📚 Books worth reading

Ranked by number of editions on Open Library, a rough measure of how lasting a book is.

🔗 Related topics