1
$\begingroup$

Are out there, any programming languages that are not defined algorithmically so that we can call them "constructed languages" but not "formal languages"? Are there any discussions or papers on that topic? It seems pretty hard to develop a compiler for this kind of languages.

$\endgroup$
  • 4
    $\begingroup$ I'm not sure what you mean. "Formal" in the sense of "formal language" just means that whether or not a string is in the language depends only on its form (i.e., based on considering it as a series of characters). $\endgroup$ – David Richerby Aug 18 '17 at 16:35
  • $\begingroup$ I think a "formal language" needs to be defined algorithmically so for example by a formal grammar while a "constructed language" can also be defined by examples. Esperanto is a constructed language but not a formal language. $\endgroup$ – user76239 Aug 18 '17 at 16:46
  • $\begingroup$ But it is defined algorithmically, you have grammar, rules and the dictionary. But in the case of programming languages, how would you parse such language? $\endgroup$ – Evil Aug 18 '17 at 17:06
  • $\begingroup$ What about using AI to compile English into C-Code? It seems possible to write "code" using a natural language like English. But I think Raphael's answer is good! $\endgroup$ – user76239 Aug 21 '17 at 7:24
  • $\begingroup$ That would be an interesting idea, to have NLP to parse your speech into code, then compiles it into op code $\endgroup$ – A.Rashad Aug 29 '17 at 16:01
4
$\begingroup$

No, at least not a reasonable programming language by what we commonly understand under that term.

As soon as you have a compiler (or an interpreter), you have an algorithm that decides whether a given string is a valid program. This compiler then defines the language. (Not a good way to define a programming language, but a workable one.)

$\endgroup$
  • $\begingroup$ Re-reading my answer, I now that token-/macro-expansion languages such as LaTeX may be a counter-example. At least, I have observed plenty of times that pdflatex doesn't terminate, so it's arguably not a decider. (This may be true for some compilers, too; there it's probably a bug.) $\endgroup$ – Raphael Sep 13 '17 at 21:34
1
$\begingroup$

According to this article, MIT did look into the possibility of writing simple programs using natural language, relying somehow on regular expressions.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.