Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / The register keyword in the C programming language is an early example of the interaction between compiler technology and language evo- lution

The register keyword in the C programming language is an early example of the interaction between compiler technology and language evo- lution

Computer Science

The register keyword in the C programming language is an
early example of the interaction between compiler technology and language evo-
lution. When the C language was created in the mid 1970s, it was considered
necessary to let a programmer control which program variables reside in regis-
ters. This control became unnecessary as eective register-allocation techniques were developed, and most modern programs no longer use this language feature.
In fact, programs that use the register keyword may lose eciency, because
programmers often are not the best judge of very low-level matters like register
allocation. The optimal choice of register allocation depends greatly on the
specics of a machine architecture. Hardwiring low-level resource-management
decisions like register allocation may in fact hurt performance, especially if the
program is run on machines other than the one for which it was written. 2
The many shifts in the popular choice of programming languages have been
in the direction of increased levels of abstraction. C was the predominant
systems programming language of the 80's; many of the new pro jects started
in the 90's chose C++; Java, introduced in 1995, gained popularity quickly
in the late 90's. The new programming-language features introduced in each
round spurred new research in compiler optimization. In the following, we give
an overview on the main language features that have stimulated signicant
advances in compiler technology. Practically all common programming languages, including C, Fortran and
Cobol, support user-dened aggregate data types, such as arrays and structures,
and high-level control  ow, such as loops and procedure invocations. If we just
take each high-level construct or data-access operation and translate it directly
to machine code, the result would be very inecient. A body of compiler
optimizations, known as data- ow optimizations, has been developed to analyze
the  ow of data through the program and removes redundancies across these
constructs. They are eective in generating code that resembles code written
by a skilled programmer at a lower level.
Ob ject orientation was  rst introduced in Simula in 1967, and has been
incorporated in languages such as Smalltalk, C++, C#, and Java. The key
ideas behind ob ject orientation are
1. Data abstraction and
2. Inheritance of properties,
both of which have been found to make programs more modular and easier to
maintain. Ob ject-oriented programs are dierent from those written in many
other languages, in that they consist of many more, but smaller, procedures
(called methods in ob ject-oriented terms). Thus, compiler optimizations must
be able to perform well across the procedural boundaries of the source program.
Procedure inlining, which is the replacement of a procedure call by the body
of the procedure, is particularly useful here. Optimizations to speed up virtual
method dispatches have also been developed.

9. Recall the TJ Inc.'s problem (Chapter 2, Problem 28): Letting W = jars of Western Foods Salsa M = jars of
Mexico City Salsa leads to the formulation: Max 1W + 1.25M s.t. 5W + 7M - 4480 Whole tomatoes 3W + IM
$2080 Tomato sauce 2W + 2M = 1600 Tomato paste W. M 20

2. Find the positive real root of f(x) = x* - 8x3 -35x2 + 450x -1001 using the false-position method. Use initial guesses of x, = 4.5 and Xy = 6 and perform five iterations. Compute both true and approximate errors based on the fact that the root is 5.60979. Use a plot (line specifications given by the table below) to explain your results and perform the computation to within &s = 1.0%. Starting letter of Line Style Marker Color Family Name A-E Solid line Right-pointing triangle red F-K Dash-dot line Diamond yellow L-P Dashed line Plus sign black Q-U Dotted line Cross green V-Z Solid line Circle blue NOTE: No. 2 is written and computer solution. For written solution in No. 2, use only five iterations as specified and compute for the true and approximate errors based on the the true value of root. For computer solution in No. 2, use the error criterion &s = 1.0%. o Follow the sample output from Lab Simulation 4 (for the table). o For the graph, Label the x - axis as "x", y - axis as "y" and title as "Graph of [the given function]". Add line specifications given by the table above. Apply modularization. o Show the number of terms needed to satisfy the criterion. o Use one .m file for both the table and graph.

Purchase A New Answer

Custom new solution created by our subject matter experts

GET A QUOTE