COMPILER DESIGN

ADVANCED TOPICS IN COMPILER DESIGN

CODE GENERATION FOR OBJECT ORIENTED LANGUAGES

Question [CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
Which of the following is a feature of declarative programming?
A
Close to design of a computer
B
Assembly Language
C
Step by step instructions to solve the problem
D
State what to achieve without giving detailed steps.
Explanation: 

Detailed explanation-1: -DECLARATIVE LANGUAGES In declarative programs the values associated with variable names cannot be changed. Thus the order in which definitions or equations are called does not matter, i.e. they are order independent.

Detailed explanation-2: -In a procedural language, you define the whole process and provide the steps how to do it. You just provide orders and define how the process will be served. In a declarative language, you just set the command or order, and let it be on the system how to complete that order.

Detailed explanation-3: -Declarative programming is a method to abstract away the control flow for logic required for software to perform an action, and instead involves stating what the task or desired outcome is.

Detailed explanation-4: -Many languages fall under the banner of declarative programming, but some of the most widely used include HTML, SQL, CSS and XML. Other examples include a mix of functional and logic programming languages, such as Prolog, Haskell, Miranda, XQuery and Lisp.

There is 1 question to complete.