0% found this document useful (0 votes)
9 views8 pages

04 Compilation Strategies

The document discusses various compilation strategies used in compiler construction, focusing on the execution of high-level programming languages. It covers interpreters, compilation processes (AOT and JIT), bytecode, virtual machines, and transpilation. The goal is to create efficient, debuggable, and deployable executables across different architectures.

Uploaded by

Abderrahim KB
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
9 views8 pages

04 Compilation Strategies

The document discusses various compilation strategies used in compiler construction, focusing on the execution of high-level programming languages. It covers interpreters, compilation processes (AOT and JIT), bytecode, virtual machines, and transpilation. The goal is to create efficient, debuggable, and deployable executables across different architectures.

Uploaded by

Abderrahim KB
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 8

Compiler Construction

e Compilation Strategies E

Compiler Construction Compilation Strategies 1/8


Objectives

The main goal is to execute high level programming languages.

How to obtain an efficient (optimized) executable?

How to have an easy to debug and deploy language?

Remember! Any programming language can be either interpreted or compiled!

Compiler Construction Compilation Strategies 2/8


Interpreters

An interpretor reads code and immediately executes that code. It works by fetching,
analyzing, and executing one instruction at a time.

Portable: no need to compile the code for a targeted architecture


Impact on the input language: first-order eval function, dynamic typing, dynamic
scoping

Compiler Construction Compilation Strategies 3/8


Compilation

Programs are compiled (translated) into native code during a compilation process.

Ahead-of-the-time (AOT) compilation: produce a binary file that can be run in the
targeted architecture.
Just-in-time (JIT) compilation: involves compilation during execution of a program
(at runtime) rather than before execution.

Compiler Construction Compilation Strategies 4/8


Bytecode strategy

Bytecode is a portable low level code. Contrary the assembly language, there is no existing
physical machine that understand this language.

Bytecode can be:


compiled
interpreted
executed by a virtual machine

Compiler Construction Compilation Strategies 5/8


Virtual Machine

A virtual machine is a platform-independent programming environment that abstracts away


details of the underlying hardware or operating system. It allows a program to execute in
the same way on any platform.

Compiler Construction Compilation Strategies 6/8


Transpilation strategy

Transpile the input language into an existing language. Then use the existing compiler for
this language.

Compiler Construction Compilation Strategies 7/8


Summary

AOT JIT

Bytecode VM

Interpretors

Compiler Construction Compilation Strategies 8/8

You might also like