2
Stella Connaughton 9.30.15 HW #8- Programming Languages 1. What is a programming language? A formal language designed to express instructions to a computer. Written so that humans are also able to understand and write it at ease. 2. Why do we need programming languages? It allows for people to create instructions for a computer without having to resort to extremely long and tedious resorts, such as writing commands with only binary (billions and billions of 0s and 1s) 3. What are the main differences between human languages and programming languages? Human languages are much more ambiguous, have more uses other than to express instructions, such as emotions and socialization. 4. What are the defining characteristics of Low Level programming languages? They are very fast, because they do not have to go through a median. They are very close to the processor’s architecture, usual correspondence with clock cycles, direct memory management and only work for a specific type of processor. 5. What are the defining characteristics of Medium/High Level programming languages? It is more portable, can work on multiple processors, commonplace, flexible syntax, concise, more complex, slower, high level abstractations and has to go through a median. 6. Is it true that medium/high level programming languages are always better than low level languages?(justify your answer, explain it with examples)

EFEF

Embed Size (px)

DESCRIPTION

EF

Citation preview

Stella Connaughton9.30.15

HW #8- Programming Languages

1. What is a programming language?

A formal language designed to express instructions to a computer. Written so that humans are also able to understand and write it at ease.

2. Why do we need programming languages?

It allows for people to create instructions for a computer without having to resort to extremely long and tedious resorts, such as writing commands with only binary (billions and billions of 0s and 1s)

3. What are the main differences between human languages and programming languages?

Human languages are much more ambiguous, have more uses other than to express instructions, such as emotions and socialization.

4. What are the defining characteristics of Low Level programming languages?

They are very fast, because they do not have to go through a median. They are very close to the processor’s architecture, usual correspondence with clock cycles, direct memory management and only work for a specific type of processor.

5. What are the defining characteristics of Medium/High Level programming languages?

It is more portable, can work on multiple processors, commonplace, flexible syntax, concise, more complex, slower, high level abstractations and has to go through a median.

6. Is it true that medium/high level programming languages are always better than low level languages?(justify your answer, explain it with examples)

No, because medium/high level programming might be too slow. For example, if you want to write a code that performs a small action and works very fast, it would be more preferable to use a low level language instead of a high level one.

7. Explain the difference between compiled and interpreted implementation of programming languages (give some examples)

A compiler will translate the program directly into code that is specific to the target machine. Then, the computer can immediately begin to run it. An interpreted implementation is that the source code is not directly run by the target machine. Examples of compiled language are C and C++. Another program, known as an interpreter, then reads and executes the code. The interpreter is written for the specific processor. This other program is also known as the interpreter. The interpreter is usually

Stella Connaughton9.30.15

written specifically for the native machine. Examples of interpreted languages are Python and Java.

8. List advantages and disadvantages of each approach

The advantages of compiled languages are that they run directly and are faster. Disadvantages of compiled languages are that they are harder to program, and less commonplace. The advantages of interpreted languages are that they can identify bugs, more portable, more flexible, and easier to create. Disadvantages are that they are slower and larger.

9. Explain the underlying of a “hybrid” approach.

A “hybrid” approach combines some aspects of compiled languages, and some aspects of interpreted languages. For example, Java is an example of a hybrid language. It complies the code into byte code. However, whether the JVM interprets or compiles the byte code depends on which JVM is used.