Code compilation
Code compilation is the transformation of source code or another formal representation into executable code or an intermediate or lower-level representation for execution or further processing.
Deep Learning with R, Third Edition
PyTorch compilation is the transformation of PyTorch computations into an optimized executable representation.
- How it is used
- Introduces compilation as an optional way to speed up PyTorch functions and modules.
- How deep it goes
- Shows how to compile functions and modules and notes limitations, without detailing compiler internals.
- Examples
- Compiles a linear classifier Module and a dense function with matrix multiplication and ReLU.
- What you can do after
- Apply compilation via torch$compile() to a PyTorch function or Module.
Read how Deep Learning with R, Third Edition explains code compilation →
LLMs in Production
Compilation is the transformation of high-level program or model code into lower-level code optimized for execution on target hardware.
- How it is used
- Uses compilation to adapt model inference to target hardware and improve production efficiency.
- How deep it goes
- Explains the framework-to-intermediate-representation-to-machine-code pipeline and demonstrates TensorRT configuration.
- Examples
- Uses GPT-2 TensorRT tracing, ONNX export commands, llama.cpp, and graph-optimized fused kernels.
- What you can do after
- Apply it via TensorRT or ONNX export tooling to produce hardware-oriented model artifacts.
Deep Learning with JAX
The process of converting code into optimized executable form.
- How it is used
- Speeds up massive computations and smaller latency-sensitive tasks through JAX JIT compilation.
- How deep it goes
- Explains Python-to-Jaxpr conversion, typed primitives, tracing constraints, static arguments, and structured control flow before XLA.
- Examples
- Demonstrates SELU, array reduction, loops, conditionals, side effects, tracer errors, and `jax.make_jaxpr()` output.
- What you can do after
- Diagnose tracing failures, inspect Jaxpr, and apply `jax.jit` with static arguments or control-flow primitives.
Modern Angular
Compilation is the process of translating source code or templates into executable code or an intermediate representation.
- How it is used
- Explains how Angular turns declarative templates into browser-executable rendering commands for development, production, and SSR.
- How deep it goes
- Distinguishes JIT and AOT workflows and their performance tradeoff, but defers the compiler’s generated command details.
- Examples
- Uses ng serve for JIT development, ng build for AOT production, and a standalone component template as the compilation input.
- What you can do after
- Evaluate/understand Angular build choices and recognize why precompilation improves production runtime behavior.
Deep Learning with Python, Third Edition
The process of converting code into a compiled form for execution, used here as a performance and debugging tradeoff in TensorFlow, JAX, and PyTorch.
- How it is used
- Uses just-in-time compilation to make TensorFlow functions fast.
- How deep it goes
- Demonstrates compilation through decorators but stops short of explaining compilation internals or a debugging workflow.
- Examples
- Uses a dense function decorated with @tf.function and @tf.function(jit_compile=True).
- What you can do after
- Apply it via TensorFlow decorators to request compiled execution for a numerical function.
Read how Deep Learning with Python, Third Edition explains code compilation →
Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI
Model compilation is the transformation of a trained model into lower-level executable code for faster inference or deployment.
- How it is used
- Accelerates prediction and simplifies deployment for tree-based models by producing lower-level executable implementations.
- How deep it goes
- Demonstrates model export, conversion, code generation, library creation, preprocessing, and prediction, without detailing generated machine code internals.
- Examples
- Uses Treelite with XGBoost and lleaves with LightGBM to compile saved tree models for prediction.
- What you can do after
- Apply it via Treelite, tl2cgen, or lleaves to generate compiled predictors from trained tree models.
JavaScript in Depth
The process of translating code from one form into another, often from source text into lower-level executable form.
- How it is used
- Explains JavaScript performance changes by tracing execution from parsing through progressively optimized compilation.
- How deep it goes
- Descends to parsing stages, bytecode instructions, feedback slots, and tier benchmarks, but not compiler implementation internals beyond these mechanisms.
- Examples
- Uses an addition function, generated bytecode, a repeated getTotal benchmark, and a V8 pipeline diagram.
- What you can do after
- Evaluate/understand how call frequency and argument types influence V8 compilation and observed performance.
Secrets of the JavaScript Ninja, Second Edition
The process of translating a program or expression into an internal form suitable for execution.
- How it is used
- Uses precompilation to reduce repeated regular-expression setup when patterns are reused.
- How deep it goes
- Explains parsing and conversion into an internal representation, but leaves that representation unspecified.
- Examples
- Compares literal and constructor creation, including case-insensitive matching and distinct object identity.
- What you can do after
- Apply precompilation with JavaScript regex literals or RegExp constructors to reuse patterns.
Read how Secrets of the JavaScript Ninja, Second Edition explains code compilation →
Also covered in
- Write Powerful Rust Macros
- Secrets of the JavaScript Ninja, Third EditionIn early access (MEAP)
- Functional Design and Architecture: Examples in Haskell
- Vibe EngineeringIn early access (MEAP)
- How Large Language Models Work
- Go by Example
- Rust in Action: Systems programming concepts and techniques
- Kubernetes for Developers
- Essential TypeScript 5, Third Edition
What to know first
- PythonPython is a high-level, general-purpose, dynamically typed programming language with readable syntax and support for multiple programming paradigms.
- stringA string is a programming-language value representing textual data as an ordered sequence of characters or encoded units.
- applicationAn application is a software program or system that provides functionality or performs tasks for users or other software.
Related concepts
- ahead-of-time compilationincludes · Ahead-of-time compilation is the translation of program code into executable or loadable form before program execution begins.
- compilation testmeasured by · A compilation test checks whether source code, including a macro invocation, compiles successfully or fails as expected.
- Dockerused by · Docker is a platform and toolset for building, distributing, and running applications in containers.
- intermediate representationproduces · An intermediate representation is a structured internal form of a program, model, or information used between processing stages for analysis, transformation, or generation.
- just-in-time compilationincludes · Just-in-time compilation is the translation or optimization of program code into executable form during program execution.
Questions about code compilation
What is code compilation?
Code compilation is the transformation of source code or another formal representation into executable code or an intermediate or lower-level representation for execution or further processing.
Which Manning books explain code compilation?
Deep Learning with R, Third Edition, LLMs in Production, Deep Learning with JAX, Modern Angular, Deep Learning with Python, Third Edition, Machine Learning for Tabular Data: XGBoost, Deep Learning, and AI, JavaScript in Depth and Secrets of the JavaScript Ninja, Second Edition.
What should I know before learning code compilation?
Manning books that teach code compilation usually introduce Python, Java, string and application first.
What kinds of code compilation are there?
Kinds of code compilation include ahead-of-time compilation and just-in-time compilation.
What is code compilation also called?
Code compilation is also called compile, compiling or compilation process.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.







