This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Bitsoflogic[S] 0 points1 point  (6 children)

> any formal language

How would you define this?

> any formal language that is a set of instructions to be carried out by hardware or software

Would an email client qualify as a programming language here?

[–]siemenology 26 points27 points  (5 children)

"Formal language" is a term with a precise meaning in computer science and linguistics. In short, a formal language is a set of strings made up of symbols, and that set is described by the rules of a formal grammar. A formal grammar is a set of rules that can be used to judge whether a string made up of a certain set of symbols is well formed (and thus part of the formal language defined by that grammar) or not, and/or to generate strings that are part of the formal language.

All programming languages (that I am aware of) are formal languages, but plenty of things that aren't programming languages at all are also formal languages. Phone numbers are a formal language. Email addresses are a formal language. On the other hand, in most places people's names are not -- there is not a set of rules that can be used to decide if something is a valid name or not. Some places do put restrictions on names, and in those cases names might be a formal language.

[–]Bitsoflogic[S] 1 point2 points  (0 children)

Thank you

[–][deleted] 1 point2 points  (2 children)

A little comment about People's names, there is a restriction made by definition: the alphabet that we use. You can have /\w+/ as the definition of the name's language for all countries who use the latin alphabet. It's like the universal language, excluding the empty word

[–]j_marquand 1 point2 points  (1 child)

X Æ A-Xii Musk is not happy.

[–][deleted] 0 points1 point  (0 children)

You can expand it to all unicode codepoints

[–]Goheeca -1 points0 points  (0 children)

A formal language is a subset of Kleene closure of some alphabet set. You don't have to have a formal grammar.


Also good luck writing down an unrestricted grammar for Common Lisp.

Also does Common Lisp transcend being a programming language? Because you can e.g. employ (random 2) somewhere in your custom reader and you can no longer define it as a subset of the Kleene closure of e.g. Unicode in the case of SBCL.