Hello!
What does it mean that a programming language is a formal programming language? And which languages are formal programming languages? And which are informal programming languages?
I haven't found a good explanation yet.
Hello!
What does it mean that a programming language is a formal programming language? And which languages are formal programming languages? And which are informal programming languages?
I haven't found a good explanation yet.
Formal means well defined. Every programming language that can be used to define executable programs has to be well defined so that machines can understand it.
Thats an extract from wikipedia
"John C. Reynolds emphasizes that formal specification languages are just as much programming languages as are the languages intended for execution. He also argues that textual and even graphical input formats that affect the behavior of a computer are programming languages, despite the fact they are commonly not Turing-complete, and remarks that ignorance of programming language concepts is the reason for many flaws in input formats"
Every programming language is a formal language, so that it does not make much sense to me to speak of a “formal programming language.” (Or does somebody know an informal programming language?)
Formal language is a language with mathematically precise construction rules. Or, more precisely, it’s a set of words over some alphabet. For example, if you take alphabet consisting of the letters a
, b
and c
, a formal language over this alphabet could be a set {a
, aa
, aba
, ca
}. Of course such a language would not be very useful – the point is that with a decent set of construction rules you can create a language such as C or PostScript.
As for the “construction rules,” they could be a formal grammar (see grammar for CSS), a regular expression (see this gorgeous regex for e-mail addresses as defined by RFC 822), an automaton or a general algorithm.
If you feel you don’t understand the thing a tiny bit more, do not despair, for this is not a very good explanation :-) There’s a lot of thinking behind the concept of formal languages. I’d suggest that you try and digest the Wikipedia entry and look for more tutorials and books. It’s fun and you will learn a lot about the background of compilers, regular expressions, Turing machines and other wonders of digital mankind.