So, How does Declarative Language differ from compiled and interpreted language?
Declarative languages, also called nonprocedural or very high level, are programming languages in which (ideally) a program specifies what is to be done rather than how to do it. In such languages there is less difference between the specification of a program and its implementation than in the procedural languages described so far. Where as a compiled language is a programming language which are generally compiled and an interpreted language is a programming language which are generally interpreted, without compiling a program into machine instructions.
Some Examples Of Declarative Languages
- Yaml
- Json
- XSL
Pros and Cons Of Declarative Language
Pros
- Short, efficient code
- Can be implemented using methods not yet known at the time of programming
- Easy optimization as implementation is controlled by an algorithm
- Maintenance possible independent of application development
Cons
- Sometimes hard to understand for external people
- Based on an unfamiliar conceptual model for people (solution state)
- Hard to take characteristics of individual applications into account during programming