views:

238

answers:

4

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.

A: 

Have you take a look here.

Paulo Santos
+1  A: 

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.

mkorpela
A: 

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"

Diego Dias
Formal specification languages != formal languages.
zoul
See all the extract pls "He also argues that textual and even graphical input formats that affect the behavior of a computer are programming languages"
Diego Dias
+3  A: 

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.

zoul
Maybe pseudocode is an informal language?
tloflin
“Informal programming” seems like a contradiction to me, but you’re right, I guess that pseudocode could be considered an informal programming language. (For sufficiently vague interpretations of “programming.”)
zoul
I have heard people talk about formal programming language, so I just thought there had to something called an informal programming language to. But I guess not. Pseudocode, as mentioned, maybe the closest one. Thanks
Orjanp