11

Would it be correct to say that the majority of computer programming languages (such as functional or procedural) are the form of constructed languages? If so, what makes it a constructed language in this case?

Let say a "Hello, World!" program as the example.

Hello World! by Brian Kernighan, from Artsy's Algorythm Auction based on a 1978 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial, which contains the first known version. 2 lines of C Code

Hello World! by Brian Kernighan, from Artsy's Algorythm Auction based on a 1978 Bell Laboratories internal memorandum by Brian Kernighan, Programming in C: A Tutorial, which contains the first known version. 2 lines of C Code. - Wikipedia

  • This is a rather interesting topic, but the way it's asked, it most likely be closed as too broad. By a naive definition, a programming language is, obviously, a language; and it is also constructed. Do you have any specific criteria in mind? – bytebuster Feb 8 '18 at 12:25
  • 3
    People consider Lojban a conlang, so why not? </snark> :P – Doorknob Feb 8 '18 at 13:24
  • 1
    Yep, 'Constructs in programming languages have been shown to be translated to Lojban'. Source: Wiki – kenorb Feb 8 '18 at 13:35
  • 1
    I think this might make a good meta post if your intention is to see if you can ask about programming languages here (not their usage (SO) but other stuff), but otherwise I think this challenge is a bit too opinion-based to be on-topic for this site, unfortunately. It's a very interesting topic though! – HyperNeutrino Feb 11 '18 at 4:26
  • 2
    @DLosc Prolog has a syntax, but doesn't really have a vocabulary. As Wikipedia says, "An atom is a general-purpose name with no inherent meaning." Lojban has actual lexemes with fixed sound-meaning pairings. – curiousdannii May 3 '18 at 0:24
15

No. "Constructed languages" on this site refers to artificially created languages for intelligent beings, not machine languages. In the absence of another qualifier a "language" is, as I wrote on another site, a system for communicating propositional and conceptual information to other beings. This is different from communication. Programming languages can definitely be used to communicate - and they carry meaning - but that doesn't make them languages. Purely referential communication (using symbols to directly refer to things in the world without metaphorical extension) is not enough to be a language, language must be able to communicate abstract concepts that are beyond any sensory or referential basis. Programming languages are systems for encoding instructions for machines, and not general purpose concept exchange systems.

6

As a programmer and a conlanger, I'd say "no". As noted above, programming languages cannot convey metaphor, emotions, sensory impressions, and other such human-relevant messages. Abstraction they can handle, but only abstractions that are relevant to the processing going on inside the machine. Such languages have an extremely limited sphere of reference: bits, bytes, and data structures inside the machine, and operations upon them.

  • Languages are not required to convey metaphors and emotions - when did this become a requirement? – qwr May 3 '18 at 16:40
6

Programming languages are constructed, but they are not languages, in the sense English or Esperanto or Klingon are languages, as curiousdannii shows. We cannot translate things like "I will be late for dinner" into a programming "language". And a characteristic of all "languages", properly speaking, is their mutual "translatability".

  • 3
    I dunno... logic programming languages like Prolog can come pretty close to representing facts like "I will be late for dinner," if you define the terms properly... something like "I expect to arrive home at a later time than the start of my family's next evening mealtime, but at an earlier time than the end of it" could be represented in Prolog in such a way that the computer could both report the information and make inferences from it. – DLosc Feb 19 '18 at 20:43
2

In the novel "Autonomy", when robots speak to each other, they author expressed it in a source code-like English, with a few things you'd see in coded implementations, like mentions of files, message headers and acknowledgements, and so on. Obviously this wasn't a full implementation. If a hobbyist did do a working implementation, I figure it would be a conlang.

In Star Wars, the droids are supposed to speak a language. The attested text can't possibly be anything like a conlang, except maybe as a language of just "oh!", "ah!" "ha-ha!" and other emotive exclamations. If someone hobbyist tried to make a droid language, it would be a nice feature if it could both work as a natural language and a programming language.

People have speculated that Lojban could serve as a programming language, as things like Prolog are programs made out of logical statements. I haven't heard of anyone doing so. Lojban syntax is describe with the same tools as are used for writing compilers, YACC.

Obviously, since this website doesn't need to reproduce Stack Overflow, things that are only programming languages and don't have a way to be used as a natural language (except maybe in jest?) are not only not conlangs, but off topic.

2

Going along curiousdannii's idea of languages for human idea exchange, there's an old joke that Python can be used in place of pseudocode, because of its use of English keywords, relatively little punctuation, and ease of understanding.

Here is an example of Kadane's algorithm, expressed in Python (from Wikipedia):

def max_subarray(A):
    max_ending_here = max_so_far = A[0]
    for x in A[1:]:
        max_ending_here = max(x, max_ending_here + x)
        max_so_far = max(max_so_far, max_ending_here)
    return max_so_far

aruslanovych asserts that languages have to convey emotion, metaphor, sensory impressions, etc. but I think this is a Romantic view. Is the Greek Linear B was used to write not a language since it was used for administrative record-keeping and probably tax purposes?

I take a liberal view in that yes, programming languages can represent metaphors, abstraction, and idioms, just maybe not in the sense we're used to. In fact, computers are excellent at abstract concepts and generalizing, with duck typing, object-oriented programming and reflection. Off-topic, I daresay with deep learning, computers can generalize even better than humans can. And, sci-fi speculation, when robots become just as intelligent as humans, we have to consider their languages as "real".

  • Writing isn't language proper either ;) – kaleissin May 3 '18 at 20:36
1

I would say, to a very limited extent, that yes, they can be, but only as a proxy grammar for other languages. For example,

from sys import exit as stops ; import os
thing = [] ; me = can = remember = False ; this = open(__file__)
def terrible(v): return v

# ==== start song snippet

me = can = remember = not any(thing)
can = not this.tell(), [True, "dream"]
locals()["deep"] = {"down":{"inside":{"feel_to":"scream"}}}
if `this` + (terrible("silence")): stops(me)

# ===== end song snippet

(source: Coding in song - Representing music lyrics in a programming language of your choosing)

However, this isn't a great method of communication. Programming languages are not designed with the same intentions as conlangs.

  • 4
    -1: This isn't really an example of a programming language in use, but rather some English that's formatted in such a way that it doesn't cause any errors when run as a program. It's a bit like stitching together random Vietnamese words into a poem that can be read in English and calling it an example of Vietnamese. – DLosc Feb 19 '18 at 20:42
  • That's fair. Thinking about it, I mostly just wanted to share something interesting I thought could push the edges of the other answers. – Riley Martine Feb 21 '18 at 19:35

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.