Assignment 1: Submitted by
Assignment 1: Submitted by
Assignment 1: Submitted by
405A)Session :Jan-May,2018
Assignment 1
I. Brief Study on System Programming Languages
II. The Compiler: A Literature Review
I. Future Trends on Assembler
Submitted By:
HIMANSHU PATEL,160280644
A , A2
Submitted To:
Mr. Malkeet Singh
Assistant Professor, CSE Dept.
1
System Programming(BTCS- 2
405A)Session :Jan-May,2018
A system programming language usually refers to a programming language used for system
programming; such languages are designed for writing system software, which usually requires
different development approaches when compared with application software.
System software is computer software designed to operate and control the computer hardware,
and to provide a platform for running application software. System software includes software
categories such as operating systems, utility software, device drivers, compilers, and linkers.
• Features
In contrast with application languages, system programming languages typically offer more-
direct access to the physical hardware of the machine: an archetypical system programming
language in this sense was BCPL. System programming languages often lack built-in
input/output (I/O) facilities because a system-software project usually develops its own I/O
mechanisms or builds on top of basic monitor I/O or screen management facilities. The
distinction between languages used for system programming and application programming
became blurred over time with the widespread popularity of PL/I, C and Pascal.
• History
o Mid-level languages
Mid-level languages have much of the syntax and facilities of a higher level language, but also
provide direct access in the language (as well as providing assembly language) to machine
features. ESPOL on Burroughs mainframes in about 1960, followed by Niklaus Wirth's PL360.
o Higher-level language
Languages such as C/C++ were developed, where the combination of features was sufficient to write system
software, and a compiler could be developed that generated efficient object programs on modest hardware.
Such a language generally omits features that cannot be implemented efficiently, and adds a small number of
machine-dependent features needed to access specific hardware capabilities; inline assembly code, such as C's
asm statement, is often used for this purpose.
2
System Programming(BTCS- 3
405A)Session :Jan-May,2018
3
System Programming(BTCS- 4
405A)Session :Jan-May,2018
4
System Programming(BTCS- 5
405A)Session :Jan-May,2018
• History of compiler
The first real multi-purpose, the ENIAC, was programmed by flipping switches and moving
wires. Computers have come a long way since then. They can now read programs directly off
of a hard disk or other media and those programs can be written and compiled on the
machine itself. Much of this is thanks to the work of Eckert, Mauchley, and von Neumann.
This idea of writing an extremely general computer and simply storing the program in
memory is called the von Neumann architecture.
Compiler technology evolved from the need for a strictly defined transformation of the high-
level source program into a low-level target program for the digital computer. The compiler
could be viewed as a front end to deal with analysis of the source code and a back end to
synthesize the analysis into the target code.
Some early milestones in the development of compiler technology:
➢ 1952 – An Autocode compiler developed by Alick Glennie for the Manchester Mark I computer
at the University of Manchester is considered by some to be the first compiled programming
language.
➢ 1952 – Grace Hopper's team at Remington Rand wrote the compiler for the A-0 programming
language
➢ 1954-1957 – A team led by John Backus at IBM developed FORTRAN which is usually
considered the first high-level language. In 1957, they completed a FORTRAN compiler that is
generally credited as having introduced the first unambiguously complete compiler.
➢ 1959 – The Conference on Data Systems Language (CODASYL) initiated development of
COBOL. The COBOL design drew on A-0 and FLOW-MATIC.
5
System Programming(BTCS- 6
405A)Session :Jan-May,2018
Uses of Compilers
o Code generation: To translate a program in a high-level language to machine code for a
particular processor
o Optimization: Improve program performance for a given target machine Text formatters:
translate Text to dvi, dvi to postscript, etc.
o Interpreters: “on-the-fly” translation of code, e.g., Java, Perl, csh, Postscript Automatic
parallelization or vectorization
o Debugging aids: e.g., purify for debugging memory access errors Performance
instrumentation: e.g., -pg option of cc or gcc for profiling
o Security: JavaVM uses compiler analysis to prove safety of Java code
o Many more cool uses! Power management, code compression, fast simulation of
architectures, transparent fault-tolerance, global distributed computing
Types of compilers
1. Cross Compiler :A cross compiler gives you the advantage of creating code that could be
run on machines other than the one on which source is compiled .
Almost all the compilers we use today are cross compilers .
2. Source to source compiler :As the name suggests such compilers convert the source code
written in one programming language into another programming language that operates at
almost same level of abstraction .
3. Decompiler:Now they are interesting , these compilers decompile the code , that is convert
machine language to source code but at a relatively low level of abstraction . They are an
important tool in software reverse engineering .
Compiler challenges
• The growing complexity of machines and software, introduction of multicores, and
concern over security are among the more serious problems that a compiler faces
• Program optimization. We live in the era of multicore processors; from now on, clock
frequencies will rise slowly if at all, but the number of cores on processor chips is likely
to double every couple of years. Therefore, by 2020, microprocessors are likely to have
hundreds or even thousands of cores, heterogeneous and possibly specialized for different
functionalities. Exploiting large-scale parallel hardware will be essential for improving an
application’s performance or its capabilities in terms of execution speed and power
6
System Programming(BTCS- 7
405A)Session :Jan-May,2018
consumption. The challenge for compiler research is how to enable the exploitation of the
power of the target machine, including its parallelismArchitectural complexity (unhand
multicore) grows to support performance, and compiler optimization must bridge this
widening gap. Compiler fundamentals are well understood now, but where to apply what
optimization has become increasingly difficult over the past few decades. Compilers
today are set to operate with a fixed strategy
Future of compilers
1. No Explicit Types: First, there will be no syntactic difference between statically and
dynamically typed languages. You will not have to specify type for any variable
explicitly. A simple language implementation will use dynamic typing, and a more
complex one will statically infer the types to generate better code.
2. Choosing Optimal Data Structure: Compilers will be able to statically analyze the code and
choose the most appropriate data structure. For example, if an array is only used as stack ,
a linked list may be better than a hash table or an array.
3. Background Incremental Compilation: This incremental compiler will have to do more
work than the current compilers, because the previous versions of compiled functions will
be often thrown away. However, it will compile the code while it is edited, so the
programmer will not have to wait for the compilation.
7
System Programming(BTCS- 8
405A)Session :Jan-May,2018
complementary aspects related to OpenCL. The first is on using the Polyhedral Loop Optimization
techniques to provide portable high performance for OpenCL code. The second is on automatic
generation of OpenCL kernels from high-level parallel programs such as OpenMP
OpenXL :The OpenXL Framework is an Eclipse plugin that allows users to interface with the
IBM XL compiler. The framework defines a set of invocation points that correspond to specific
intermediate points in the XL compilation process. At each invocation point, OpenXL enables
users to inspect and modify the intermediate compiled code. Code is always presented to the user
using a single, common interface, irrespective of the different internal code representations used
by sub-components of the XL compiler.
SIMD:IBM are continuing to refine our automatic SIMD code generation technology, as well as
investigating hardware and compiler techniques that can extend the applicability of SIMD to a
wider range of applications.
Melting ice technology of compiler
Types of compilation provided by Melting Ice
EiffelStudio relies on Melting Ice Technology, the proprietary compilation mechanism of Eiffel
Software, which offers three forms of compilation: melting, freezing, and finalizing.
Melting
Melting is used for making a few changes during typical development activity. The fastest of the
mechanisms, typically taking a few seconds after small changes. Melting time is proportional to
the size of the changed parts and affected classes, while the time needed to freeze or finalize is
partly proportional to the size of the whole system. As long as you do not include new external
C/C++ code, a C/C++ compiler is not required. However, execution speed is not optimal. The
generated executable is debuggable.
Freezing
Freezing generates C code from the active system, and then compiles it into machine code; you
must have a C/C++ compiler installed. You need to use this option if you add new agents or
external C/C++ calls. Unless you add external code, you can re-freeze every couple of days. The
rest of the time, you can melt your software to receive immediate feedback. The speed is still
slower than when finalizing, but the generated executable is still debuggable.
Finalizing
8
System Programming(BTCS- 9
405A)Session :Jan-May,2018
Finalizing delivers a production version (intermediate or final) of your software. It can be used to
measure its performance in operational conditions. Finalization performs extensive time and
space optimizations that enable Eiffel to match the efficiency of C/C++; it also creates a stand-
alone C package that you can use for cross-platform development. Because of all the
optimizations involved, finalizing takes the most time, and the generated executable is not
debuggable.
Precompiling
Precompilation allows you to create a library in which the classes are already compiled, so when
it is used, compile times are decreased. EiffelStudio comes with optional precompiled forms of
commonly used libraries. For example, in the Microsoft Windows distribution you can opt for
precompiled EiffelBase, or WEL + EiffelBase, or EiffelVision 2 + WEL + EiffelBase. As
indicated by these options, the precompilation of a library must also include any other library
upon which the target library depends. In other words, it would not be pos
SOME POPULAR COMPILERS:
1.PASCAL Compiler : In Pascal compiler,the lexical analyser marks the possible errors and
produces a stream of tokens of the next phase. The next phase uses the predictive translator and
type checker.
2. C Compiler: A C Compiler accepts source code written in C programming language and then
perform a lexical syntax analysis tasks. After that, it produces intermediate Code in assembly
language as well as in postfix or prefix forms for expressions . A code generator accepts this
intermediate Code and produces another program in assembly language.
3. FORTAN Compiler : The first phase of compiler accepts the source program .It include
lexical analysis comprising COMMON EQUIVALENCE etc. The output includes operand
operand pairs. The next phase performs the syntax analysis ,data flow analysis, and assignment
of address to names on the output of the first phase.
9
System Programming(BTCS- 10
405A)Session :Jan-May,2018
Molecular assembler
A molecular assembler is a molecular machine capable of assembling other molecules given
instructions, energy, and a supply of smaller "building block" molecules to work from. They can
work individually as tiny stand-alone systems, or potentially be organized in large numbers to form
a desktop-scale nanofactory able to build macroscopic products. Distinction is sometimes made
between synthetic and naturally occurring molecular assemblers.
In cellular biology, the ribosome demonstrates the essential principles of a molecular assembler.
Working within a cell's environment, it reads strands of mRNA as its instructions and assembles
specific large protein molecules out of more fundamental parts.
Synthetic assembler
10
System Programming(BTCS- 11
405A)Session :Jan-May,2018
Synthetic assemblers have not yet been constructed, and some controversy exists as to whether
they are possible or what their ecological impact might be. The potential uses of synthetic
assemblers could be more general, and are thought to be especially applicable to materials scienc
There are two entwined controversies surrounding the creation of artificial or synthetic molecular
assemblers. The first is whether they can be built or even exist. Secondarily, if they can be built,
then what is the potential ecological impact and the what are the appropriate political or regulatory
responses.
Micro assembler
A micro assembler is a computer program that helps prepare a microprogram, called firmware,
to control the low level operation of a computer in much the same way an assembler helps prepare
higher level code for a processor. The difference is that the microprogram is usually only
developed by the processor manufacturer and works intimately with the computer hardware. On a
microprogrammed computer the microprogram implements the operations of the instruction set in
which any normal program (including both application programs and operating systems) is written.
The use of a microprogram allows the manufacturer to fix certain mistakes, including working
around hardware design errors, without modifying the hardware. Another means of employing
micro assembler-generated microprograms is in allowing the same hardware to run different
instruction sets. After it is assembled, the microprogram is then loaded to a control store to become
part of the logic of a CPU's control unit.
11