What is a translation program?

What is a translation program or compiler? Lets find out together.

A translation program is software widely used by developers and programmers . In this article, let's explore what a translation program is with TipsMake.com.

 

What is a translation program?

A compiler, also known as a translation program, is a program whose task is to translate a sequence of statements written in a specific programming language (also called the source language or source code) into a new program in a computer language (also called the target language). Typically, the target language is a lower-level language used by the computer to understand the statements. This new program, created by the compiler, is also called object code.

 

Images 1 of What is a translation program?

Most compilers translate source code written in a high-level language into object-oriented code or machine language so that it can be executed directly by a computer or virtual machine. However, there are also compilers capable of translating from a low-level language to a higher-level language. These are called reverse compilers. Naturally, there are also compilers capable of translating from one high-level language to another.

 

How does the translation program work?

Compilers have various methods for analyzing and converting source code into output code. Despite these differences, they generally perform the following steps:

  • Lexical analysis . The compiler divides the source code into lexicals, which are individual code segments representing specific patterns within the code. These lexicals are then encoded in preparation for syntactic and semantic analysis.
  • Parsing . The compiler verifies that the code's syntax is correct, based on the rules for the source language. This process is also known as parsing. In this step, the compiler typically creates abstract syntax trees that represent the logical structure of specific code elements.
  • Semantic analysis . The compiler verifies the logical validity of the code. This step goes beyond parsing by validating the code's correctness. For example, semantic analysis can check whether variables have been assigned the correct type or declared correctly.
  • Generate IR code . After the code goes through all three analysis phases, the compiler will generate an intermediate representation (IR) of the source code. IR code makes it easier to translate the source code into other formats. However, it must accurately represent the source code in all aspects, without omitting any functionality.
  • Optimization . The compiler optimizes the IR code in preparation for generating the final code. The type and level of optimization depend on the compiler. Some compilers allow the user to configure the level of optimization.
  • Generate output code . The compiler generates the final output code using the optimized IR code.

Compilers are sometimes confused with programs called interpreters. While both are similar, they differ in key ways. Compilers analyze and transform source code written in languages ​​such as Java, C++, C#, or Swift. They are typically used to generate machine code or bytecode that can be executed by the target server system.

Interpreters do not generate IR code or store generated machine code. They process code statement by statement at runtime without prior code conversion or preparation for a specific platform. Interpreters are used for code written in scripting languages ​​such as Perl, PHP, Ruby, or Python.

Why do we need a translation program?

We need a compiler because it helps us convert a program written in a high-level language into a program that can be executed on a specific computer.

  • Do you know what a programming language is?
Close
Category

System

Windows XP

Windows Server 2012

Windows 8

Windows 7

Windows 10

Wifi tips

Virus Removal - Spyware

Speed ​​up the computer

Server

Security solution

Mail Server

LAN - WAN

Ghost - Install Win

Fix computer error

Configure Router Switch

Computer wallpaper

Computer security

Mac OS X

Mac OS System software

Mac OS Security

Mac OS Office application

Mac OS Email Management

Mac OS Data - File

Mac hardware

Hardware

USB - Flash Drive

Speaker headset

Printer

PC hardware

Network equipment

Laptop hardware

Computer components

Advice Computer

Game

PC game

Online game

Mobile Game

Pokemon GO

information

Technology story

Technology comments

Quiz technology

New technology

British talent technology

Attack the network

Artificial intelligence

Technology

Smart watches

Raspberry Pi

Linux

Camera

Basic knowledge

Banking services

SEO tips

Science

Strange story

Space Science

Scientific invention

Science Story

Science photo

Science and technology

Medicine

Health Care

Fun science

Environment

Discover science

Discover nature

Archeology

Life

Travel Experience

Tips

Raise up child

Make up

Life skills

Home Care

Entertainment

DIY Handmade

Cuisine

Christmas

Application

Web Email

Website - Blog

Web browser

Support Download - Upload

Software conversion

Social Network

Simulator software

Online payment

Office information

Music Software

Map and Positioning

Installation - Uninstall

Graphic design

Free - Discount

Email reader

Edit video

Edit photo

Compress and Decompress

Chat, Text, Call

Archive - Share

Electric

Water heater

Washing machine

Television

Machine tool

Fridge

Fans

Air conditioning

Program

Unix and Linux

SQL Server

SQL

Python

Programming C

PHP

NodeJS

MongoDB

jQuery

JavaScript

HTTP

HTML

Git

Database

Data structure and algorithm

CSS and CSS3

C ++

C #

AngularJS

Mobile

Wallpapers and Ringtones

Tricks application

Take and process photos

Storage - Sync

Security and Virus Removal

Personalized

Online Social Network

Map

Manage and edit Video

Data

Chat - Call - Text

Browser and Add-on

Basic setup