Is EBNF considered as a Programming Language - programming-languages

I am confused wheter EBNF can be considered as a Programming language which is turing complete?

To answer your question, no, Extended Backus–Naur Form (EBNF) is not a programming language. It is a metasyntax notation.
While a language is a way to describe an algorithm (what a computer should do), metasyntax is a way to describe a language.

Related

Relationships beetween Complied/Interpreted/Scripting and other programming language classifications?

I got lost in the classifications of programming languages. What is the relationships between "Compiled/Interpreted/Scripting" and "OOP/Procedural/Functional", and possibly many "terms" for classifying languages?
I do not even know how to ask this properly. Looked for programming language hierarchy but every diagram is always missing some terms above.
There is not really a relationship between them, as they are different classification systems.
OOP/Procedural/Functional describe the syntax and grammar of a programming language.
It describes what a language looks like to the software programmer.
Compiled/Interpreted/Scripting describes how the language is processed, and what is necessary for a program to run.
Compiled languages are transformed into machine code before execution, interpreted and scripting languages are transformed into machine code during execution.
Examples of languages and their classification in either system:
Java is a OOP Compiled language.
Kotlin is a functional compiled language.
Python is a procedural interpreted language.
Javascript is a functional scripting language

Are there any context-oriented programming language, and what's their use for?

I heard someone talking about Context-Oriented Programming, so I googled it to found out what that means, and it seems like a new paradigm of programming, but also all I found are academic papers talking about the concept.
So I would like to know if there's any language that implements context-orientation and what is this good for?
COP is a programming paradigm supporting software adaptation to the execution context.
It's an alternative to the use of hard-coded conditional statements spread over the application to encode context-dependent behavior.
In the years several COP extensions to various languages have been proposed:
ContextJ and JCop for Java
Context Erlang for Erlang
ContextL for Common Lisp (the first COP extension to a programming language)
SubjectiveC for Objective C
ContextS for Smalltalk
PyContext for Python
ContextR for Ruby
ContextJS for Javascript
and probably many others.
Each concrete language design and implementation comes with different variations of the features of the COP paradigm. For further details you can see A Comparison of Context-oriented
Programming Languages (Malte Appeltauer, Robert Hirschfeld, Michael Haupt, Jens Lincke, Michael Perscheid - 2010).
Also a good introduction / starting point is Context-oriented Programming (Robert Hirschfeld, Pascal Costanza, Oscar Nierstrasz) or Context-Oriented Programming: A Programming Paradigm for Autonomic Systems (Guido Salvaneschi, Carlo Ghezzi, Matteo Pradella - 2013).

Criteria to determine if it's a programming language

What are the critera or the basic features required to tell that X or Y is (or is not) a programming language?
I've done some reading (Is HTML considered a programming language?, Turing complete, and others), and came to the conclusion that a language or a syntax has to be Turing complete to be considered a programming language. Is this correct? Is it enough?
And how do I determine if something is Turing complete? Are there any specific criteria?
Is having control-of-flow structures (conditional statements and loops) enough to be considered Turing complete?
There exist programming languages which are not Turing complete. For some examples of non-Turing complete languages, take a look at: Practical non-Turing-complete languages?
An advantage of having a language that is non-Turing complete could for instance be that it might be sufficient to perform the tasks you need, while being simple enough to allow you to prove properties about your programs, which you could not otherwise prove. This could, for instance, be useful in cases where it's vital to know that the program will run without error.
What exactly constitutes a programming language is a bit vague, but one could say that it's a language in which you can express computations. If we look at HTML, you cannot create a document that computes anything; it merely tells the browser how the page is supposed to look. The important part to note is, it doesn't compute anything new.
It is, as Marcelo says, quite fuzzy.
As for determining if a language is Turing complete, I will refer you to this question: What are practical guidelines for evaluating a language's "Turing Completeness"?
What are the critera or the basic features required to tell that X or Y is (or is not) a programming language ?
As Marcelo Cantos already told it is somewhat fuzzy, especially since there are Domain specific languages (DSLs; http://en.wikipedia.org/wiki/Domain-specific_language) that are not Turing complete, but also often considered programming languages.
And how do I determine if something is Turing complete ? Are there any specific criteria ?
One way determine whether a programming language is Turing complete is to write a Turing machine in it (or an implementation of the Lambda calculus).
Another way is to prove that all mu-recursive functions
http://en.wikipedia.org/wiki/%CE%9C-recursive_function
can be computed by the programming language.
Since it can be proved that an imperative programming language is Turing complete, if there is a variable assignment, a way to represent number 0, a successor function, a predecessor function and a possibility to represent while-loops this is another way.
A sometimes-used way (that for obvious reasons does not always work) to prove that a programming language is not Turing-complete is to check whether all programs terminate; if yes, it can't be.
So let's think about the consequences of these concrete definitions:
A Turing-complete language is a programming language: CSS becomes a programming language.
A programming language must be turing-complete: maybe, but programs can be written otherwise.
Now a far better definition: A programming language is one that can be used to write programs.
The term "programming language" is somewhat fuzzy. Do regular expressions constitute a programming language? Most programmers would say yes, even though regexes are not turing complete.
As for Turing-completeness, I'm no expert, but I think it is sufficient to have a conditional branch and an infinite stack (therefore real machine only approximate turing-completeness).
EDIT: After a bit of research, I've found that this is isn't sufficient. You need at least two stacks and some minimal number of states (and a state transition table).
Perhaps a more down-to-earth yardstick is that if can remember arbitrary amounts of state and do loops, it's probably turing complete.

Are Mark Up languages considered programming languages?

Are all those markup languages programming languages?
For example XML or HTML are programming languages?
The term "programming language" isn't defined rigorously enough for this to have a good answer. It really depends on the context in which the term is being used. In many contexts (usually if languages like C++, D or Java are being heavily mentioned) a "programming language" has to be Turing complete. However, XML and HTML do meet a more lenient set of criteria. They have a grammar and are textual means of expressing to a computer what you want it to do. Therefore, in some contexts they could be considered declarative programming languages.
Markup Languages could more accurately be called Data Description Languages. They describe your data.
While Programming languages are used to instruct the computer to perform logic.
It depends on the language. There are turing complete markup languages(including XMLish) of course, they aren't common though because they are ugly.
As the terms are most often used, I'd say HTML and plain XML both fall outside the realm of programming languages.
That said, quite a bit of HTML includes bits and pieces of JavaScript, which would have to be considered a programming language by almost any definition. Likewise, the "X" in XML is short of eXtensible. That (indirectly) means you can attach nearly any meaning you want to something stored in XML. In this case, the structure of the source code and the structure of the XML can be direct reflections of each other. Nonetheless, these are really examples of the markup language being a container for source code (or object code, though that's somewhat less common) for code written in some separately defined programming language, which doesn't change the fact that the markup language itself isn't really a programming language.
There are more borderline cases (e.g. defining animations in HTML with CSS) but while they approach the border, at least right offhand none occurs to me that really crosses the border to the point that you unequivocally call either a programming language.

Haskell vs. Prolog comparison [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 5 years ago.
Improve this question
What kind of problems is better solved in Prolog than in Haskell? What are the main differences between these two languages?
Edit
Is there a Haskell library (kind of a logical solver) that can mimic Prolog functionality?
Regarding the logic library question: If it doesn't exist, it should be possible to build one a variety of ways. The Reasoned Schemer builds logical reasoning capabilities into Scheme. Chapters 33-34 of PLAI discuss Prolog and implementing Prolog. These authors are building bridges between Scheme and Prolog. The creators of PLT Scheme have built as one of their languages a Lazy Scheme after the lazy evaluation feature of Haskell. Oleg Kiselyov's LogicT paper is brilliant as usual--he pushes the boundary for what is possible in many languages. There is also a logic programming example on the Haskell Wiki.
The Reasoned Schemer by Daniel P. Friedman, William E. Byrd, and Oleg Kiselyov
Programming Languages: Application and Interpretation by Shriram Krishnamurthi
LogicT - backtracking monad transformer with fair operations and pruning
Logic programming on Haskell Wiki
Prolog is mainly a language targeted at logical problems, especially from the AI and linguistic fields. Haskell is more of a general-purpose language.
Prolog is declarative (logical) language, what makes it easier to state logical problems in it. Haskell is a functional language and hence much better suited to computational problems.
Wikipedia on declarative programming:
In computer science, declarative
programming is a programming paradigm
that expresses the logic of a
computation without describing its
control flow. It attempts to minimize
or eliminate side effects by
describing what the program should
accomplish, rather than describing how
to go about accomplishing it. This is
in contrast from imperative
programming, which requires a detailed
description of the algorithm to be
run.
Declarative programming consider
programs as theories of a formal
logic, and computations as deductions
in that logic space. Declarative
programming has become of particular
interest recently, as it may greatly
simplify writing parallel programs.
Wikipedia on functional programming:
In computer science, functional
programming is a programming paradigm
that treats computation as the
evaluation of mathematical functions
and avoids state and mutable data. It
emphasizes the application of
functions, in contrast to the
imperative programming style, which
emphasizes changes in state.
Functional programming has its roots
in the lambda calculus, a formal
system developed in the 1930s to
investigate function definition,
function application, and recursion.
Many functional programming languages
can be viewed as embellishments to the
lambda calculus.
In short a declarative language declares a set of rules about what outputs should result from which inputs and uses those rules to deduce an output from an input, while a functional language declares a set of mathematical or logical functions which define how input is translated to output.
As for the ADDED question : none that I know of but you can either translate Haskell to Prolog, or implement Prolog in Haskell :)
Prolog is a logic programming language, whereas Haskell is a functional language. Functional languages are based on the concept of a function which takes a number of arguments and computes a value.
Prolog, on the other hand, does not have functions. Instead, predicates are used to prove a "theorem". Prolog predicates do not compute a value, they can answer "yes" or "no" and optionally bind input variables to values:
The usefulness of functional and logic programming often overlap. Functional programming has gained quite a bit of traction lately, while Prolog is still much a niche language, much due to the fact that it is much more different from the common concepts of functions and methods of mainstream OOP than functional programming is, and often considered (very) difficult to learn.
Certain problems become almost trivial to implement in Prolog, especially in combination with constraint solvers.
You can read more about logic programming on Wikipedia.
You might find the paper Escape from Zurg: An Exercise in Logic Programming an interesting read. It shows a side-by-side comparison of the implementation of a simple search problem in Prolog and Haskell, along with a little typeclass framework for representing search problems more generally. The conclusion that the authors come to is that expressing at least some of these types of problems in Haskell is easier than in Prolog, primarily because the Haskell type system makes it easier to come up with nice representations of search states and moves from state to state.
In reality there are only 2 languages:
Machine language
Human language.
All other languages in between are merely translators and nothing more. When we use the machine language we must think like the machine and when using human languages we think like humans.
The true job of a programmer is to think both ways. Some programming tools like the assembler force the programmer to spend a lot more time thinking like the machine. Other tools like Prolog allows us to spend more time thinking like a human.
There is a penalty to be paid at each extreme either in performance or in cost.
If the business logic of your application can be reduced to a set of rules and its output to a set of goals (for example writing a game of Chess) then Prolog is ideal. On the other hand if you need to take the input and tell the computer how to compute the output then a functional language would be more appropriate.

Resources