Are computer languages meaningfully... in english?

Topics that can go away
Torco
Posts: 623
Joined: Fri Jul 13, 2018 9:11 am

Are computer languages meaningfully... in english?

Post by Torco »

So I've got to wondering... well, the title of this thread: on the one hand, sure, programming languages use english lexicon, right? it's print, not imprima or imprimir. I know a few <not many> programming languages and I've noticed they're all very similar, if not in syntax, in some deeper structures: for example, as English is mostly uninflected, so are I would say all programming languages: and it's not like you couldn't have built inflection into proglangs either: is this cause of technical reasons or simply because the first programmers were english speakers and we all sort of went along? an example of the latter case is almost certainly, to my mind, the case for the way we declare variables: token is equal to expression is, well, a reflection of how you state that a thing is the case in English, right? I'm a sociologist: but it could just as easily have been the other way around: a proglang could express

MyVar=21

as

means 21 MyVar

And would probably be the case if some other natlang had been the L1 of the guys who wrote the first assemblers or whatever.

Is this like... a thing? like, have people thought about this... linguistic parochialism of the way proglangs are, and alternative ways in which they could work? this is not an area I know a lot about.
User avatar
Vardelm
Posts: 665
Joined: Mon Jul 09, 2018 10:29 am
Contact:

Re: Are computer languages meaningfully... in english?

Post by Vardelm »

Torco wrote: Fri Jan 27, 2023 8:30 pmEnglish is mostly uninflected, so are I would say all programming languages: and it's not like you couldn't have built inflection into proglangs either: is this cause of technical reasons or simply because the first programmers were english speakers and we all sort of went along?
I'd say technical. It's much easier to parse arguments between spaces than to try & deconstruct a string of character.

Torco wrote: Fri Jan 27, 2023 8:30 pmI'm a sociologist: but it could just as easily have been the other way around: a proglang could express

MyVar=21

as

means 21 MyVar
Yeah, this could happen. I do some scripting for my job, and I can tell you I wouldn't want to type "means" instead of "=" every time I needed to assign something. It's 5x the work! (I didn't even feel like writing out "times" there.... crap. I just did...) "=" is an already available symbol that means something very close to what it's doing in programming, so why not use it? Also, when you're scanning code, I'd say that the "=" signs will just out a little bit from the surrounding text, making it easier to ready.
Vardelm's Scratchpad Table of Contents (Dwarven, Devani, Jin, & Yokai)
User avatar
Emily
Posts: 331
Joined: Fri Aug 03, 2018 6:24 am
Contact:

Re: Are computer languages meaningfully... in english?

Post by Emily »

i feel like i saw something somewhere, as a joke or proof of concept or something, where someone made a programming language using latin inflection as a part of its structure
zompist
Site Admin
Posts: 2634
Joined: Sun Jul 08, 2018 5:46 am
Location: Right here, probably
Contact:

Re: Are computer languages meaningfully... in english?

Post by zompist »

Torco wrote: Fri Jan 27, 2023 8:30 pm for example, as English is mostly uninflected, so are I would say all programming languages: and it's not like you couldn't have built inflection into proglangs either: is this cause of technical reasons or simply because the first programmers were english speakers and we all sort of went along?
Not a COBOL guy, are you? Take a look at this:

https://www.microfocus.com/documentatio ... DF205.html

In particular, the optional use of CHARACTER or CHARACTERS, and the use of IS or ARE.

But that perhaps leads to the question, why bother? Most languages went for much more terseness, rather than directly mimicking English. I don't think anyone wants the computer to refuse to compile if you use IS where you should have used ARE, and it's hard to think of an example where inflections would help out the coding any.
an example of the latter case is almost certainly, to my mind, the case for the way we declare variables: token is equal to expression is, well, a reflection of how you state that a thing is the case in English, right? I'm a sociologist: but it could just as easily have been the other way around: a proglang could express

MyVar=21

as

means 21 MyVar
Sure, though I'd note that that's VOS which is extremely rare in the world's languages.

I'd also note that messing with expression syntax is totally a thing-- some languages go for postfix notation. So people aren't limited to English models.

Obviously it's historical accident that most languages use English keywords. I once asked about this in a French Usenet group... why not (say) use C to define French keywords? But no one thought it was a good idea. Most French programmers probably know at least some English. And one even pointed out that the English keywords kind of stood out on the page (this was before syntax coloring).
bradrn
Posts: 5535
Joined: Fri Oct 19, 2018 1:25 am

Re: Are computer languages meaningfully... in english?

Post by bradrn »

Torco wrote: Fri Jan 27, 2023 8:30 pm So I've got to wondering... well, the title of this thread: on the one hand, sure, programming languages use english lexicon, right? it's print, not imprima or imprimir. I know a few <not many> programming languages and I've noticed they're all very similar, if not in syntax, in some deeper structures: for example, as English is mostly uninflected, so are I would say all programming languages: and it's not like you couldn't have built inflection into proglangs either: is this cause of technical reasons or simply because the first programmers were english speakers and we all sort of went along? an example of the latter case is almost certainly, to my mind, the case for the way we declare variables: token is equal to expression is, well, a reflection of how you state that a thing is the case in English, right? I'm a sociologist: but it could just as easily have been the other way around: a proglang could express

MyVar=21

as

means 21 MyVar

And would probably be the case if some other natlang had been the L1 of the guys who wrote the first assemblers or whatever.

Is this like... a thing? like, have people thought about this... linguistic parochialism of the way proglangs are, and alternative ways in which they could work? this is not an area I know a lot about.
I’ve thought about this on and off, and I don’t think programming languages are influenced all that much by L1s. Having written some parsers, I think the key constraints are that (a) code must be easy to segment into lexemes, and (b) it needs to be easy to determine syntactic structures by processing those lexemes in order. (a) makes code naturally tend to having an isolating character, and (b) means it’s mostly head-initial.

Of course, one might wonder if code really needs to have a syntactic structure in the first place…
Emily wrote: Fri Jan 27, 2023 11:14 pm i feel like i saw something somewhere, as a joke or proof of concept or something, where someone made a programming language using latin inflection as a part of its structure
…which is exactly what Lingua::Romana::Perligata does. I’m not sure it adds all that much expressivity, though.
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
User avatar
alice
Posts: 886
Joined: Mon Jul 09, 2018 11:15 am
Location: 'twixt Survival and Guilt

Re: Are computer languages meaningfully... in english?

Post by alice »

I can no longer come up with decent signatures.
Richard W
Posts: 1387
Joined: Sat Aug 11, 2018 12:53 pm

Re: Are computer languages meaningfully... in english?

Post by Richard W »

Is "can not" an unintentional mistake or a bit of word play?
Last edited by Richard W on Sat Jan 28, 2023 5:19 am, edited 1 time in total.
Richard W
Posts: 1387
Joined: Sat Aug 11, 2018 12:53 pm

Re: Are computer languages meaningfully... in english?

Post by Richard W »

Many programming languages largely lack lack pronouns. Perl has them, and routines can have a pronoun with fixed reference to an unchanging privileged, hidden argument, e.g. self.
Travis B.
Posts: 6095
Joined: Sun Jul 15, 2018 8:52 pm

Re: Are computer languages meaningfully... in english?

Post by Travis B. »

Richard W wrote: Sat Jan 28, 2023 5:18 am Many programming languages largely lack lack pronouns. Perl has them, and routines can have a pronoun with fixed reference to an unchanging privileged, hidden argument, e.g. self.
A "pronoun" in programming languages, Perl and shell aside, tends to be idiomatic of object-oriented languages, as most OO languages, ones with multiple dispatch aside, tend to privilege a specific argument.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
User avatar
Raphael
Posts: 4049
Joined: Sun Jul 22, 2018 6:36 am

Re: Are computer languages meaningfully... in english?

Post by Raphael »

I'm kind of reminded of this zompist blog post:

https://zompist.wordpress.com/2015/12/0 ... interface/ ,

and specifically this quote:
One of programmers’ oldest dreams, or snares, is to write an interface that’s so simple to use that the business analyst can write most of the app. I’ve fallen for this one myself, more than once! The sad truth is even if you do this task pretty well, non-programmers aren’t going to be able to use it. To program, you have to think like a programmer, and this doesn’t change just because you make the code look like English sentences.
bradrn
Posts: 5535
Joined: Fri Oct 19, 2018 1:25 am

Re: Are computer languages meaningfully... in english?

Post by bradrn »

More thoughts: Perl sigils are basically noun classes, which must agree within a phrase / expression. (Perl is generally a good place to look for such things; Larry Wall has a linguistics degree.) J has something called ‘agreement’ too (though it’s somewhat different to the linguistic sense), as well as ‘nouns’ and ‘verbs’, and valency-changing operations, including something which could well be called a middle voice (passive/reflexive in one operation). More generally, type systems could be considered to be a form of agreement.

EDIT: This prompted me to search through my Perl book for linguistic stuff. I immediately found two pages on ‘topicalisers’ (i.e. packages and imports), as well as various entries in the glossary on ‘transliterate’, ‘possessive’, ‘indirect object’, ‘IPA’, as well as at least one IPA transcription ([modʑibake] for 「文字化け」.)
Raphael wrote: Sat Jan 28, 2023 1:15 pm
One of programmers’ oldest dreams, or snares, is to write an interface that’s so simple to use that the business analyst can write most of the app. I’ve fallen for this one myself, more than once! The sad truth is even if you do this task pretty well, non-programmers aren’t going to be able to use it. To program, you have to think like a programmer, and this doesn’t change just because you make the code look like English sentences.
The flipside of this is that a great many people do find themselves able to think like a programmer, once they’ve gotten past the syntax barrier — or more often, the marketing barrier. Consider the popularity of Excel as a programming environment, for one thing. I also once saw a story of secretaries who ended up creating complex packages in Emacs Lisp, because they thought of it as ‘configuring their editor’ rather than ‘writing a program’.
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
User avatar
Ketsuban
Posts: 124
Joined: Tue Nov 13, 2018 6:10 pm

Re: Are computer languages meaningfully... in english?

Post by Ketsuban »

Torco wrote: Fri Jan 27, 2023 8:30 pm Is this like... a thing? like, have people thought about this... linguistic parochialism of the way proglangs are, and alternative ways in which they could work? this is not an area I know a lot about.
Yes. My favourite is قلب, a Lisp-like where you need to be reasonably comfortable with Arabic script to use it. I can't find it now, but I read something at one point about how the use of the word else ended up not really resembling how it's used in English because the person who introduced the construct was a native speaker of German.
bradrn
Posts: 5535
Joined: Fri Oct 19, 2018 1:25 am

Re: Are computer languages meaningfully... in english?

Post by bradrn »

Ketsuban wrote: Sat Jan 28, 2023 7:10 pm I can't find it now, but I read something at one point about how the use of the word else ended up not really resembling how it's used in English because the person who introduced the construct was a native speaker of German.
I recall reading this too. I think I saved it somewhere, though probably on my old computer.
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
User avatar
Ryusenshi
Posts: 379
Joined: Sun Jul 08, 2018 1:57 pm
Location: Somewhere in France

Re: Are computer languages meaningfully... in english?

Post by Ryusenshi »

I mentioned the same point here, linking to this article:
https://github.com/e-n-f/if-then-else/b ... en-else.md
User avatar
WeepingElf
Posts: 1321
Joined: Sun Jul 15, 2018 12:39 pm
Location: Braunschweig, Germany
Contact:

Re: Are computer languages meaningfully... in english?

Post by WeepingElf »

Computer programming never really felt like talking to a machine to me, rather like building a machine or conducting a chemical experiment.
... brought to you by the Weeping Elf
My conlang pages
Travis B.
Posts: 6095
Joined: Sun Jul 15, 2018 8:52 pm

Re: Are computer languages meaningfully... in english?

Post by Travis B. »

To me programming is essentially constructing or modifying a system, and programming languages are simply the notation used to do so. Just because they typically use English words to some extent does not makes them have anything more in common with English itself than, say, mathematical or chemical notations. To believe otherwise, to me, is to mislead oneself about the nature of programming itself.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
bradrn
Posts: 5535
Joined: Fri Oct 19, 2018 1:25 am

Re: Are computer languages meaningfully... in english?

Post by bradrn »

Travis B. wrote: Sun Jan 29, 2023 3:15 pm To me programming is essentially constructing or modifying a system, and programming languages are simply the notation used to do so. Just because they typically use English words to some extent does not makes them have anything more in common with English itself than, say, mathematical or chemical notations. To believe otherwise, to me, is to mislead oneself about the nature of programming itself.
I completely agree. I will note that there are many programming languages which use few or no English words in their syntax: for instance, APL (and its derivatives J and K), Prolog, to some extent Haskell and other ML-family languages, and so on.
Conlangs: Scratchpad | Texts | antilanguage
Software: See http://bradrn.com/projects.html
Other: Ergativity for Novices

(Why does phpBB not let me add >5 links here?)
Travis B.
Posts: 6095
Joined: Sun Jul 15, 2018 8:52 pm

Re: Are computer languages meaningfully... in english?

Post by Travis B. »

bradrn wrote: Sun Jan 29, 2023 5:26 pm
Travis B. wrote: Sun Jan 29, 2023 3:15 pm To me programming is essentially constructing or modifying a system, and programming languages are simply the notation used to do so. Just because they typically use English words to some extent does not makes them have anything more in common with English itself than, say, mathematical or chemical notations. To believe otherwise, to me, is to mislead oneself about the nature of programming itself.
I completely agree. I will note that there are many programming languages which use few or no English words in their syntax: for instance, APL (and its derivatives J and K), Prolog, to some extent Haskell and other ML-family languages, and so on.
One thing to remember is also that just because English words are used in syntax or even in identifiers does not mean that the comments will be in English; in one piece of software I've dealt with written largely by some Germans much of the comments are in German (and make very obvious how limited my German is) even though the identifiers are largely in English.
Yaaludinuya siima d'at yiseka ha wohadetafa gaare.
Ennadinutha gaare d'ate ha eetatadi siiman.
T'awraa t'awraa t'awraa t'awraa t'awraa t'awraa t'awraa.
Torco
Posts: 623
Joined: Fri Jul 13, 2018 9:11 am

Re: Are computer languages meaningfully... in english?

Post by Torco »

WeepingElf wrote: Sun Jan 29, 2023 8:55 am Computer programming never really felt like talking to a machine to me, rather like building a machine or conducting a chemical experiment.
absolutely, I have this same feeling: much more like plotting up a big rube goldberg machine, much less like a conversation. then again, jupyter notebooks feel more like a conversation (or, I'm told, R).
jcb
Posts: 60
Joined: Thu Jul 07, 2022 4:36 pm

Re: Are computer languages meaningfully... in english?

Post by jcb »

So I've got to wondering... well, the title of this thread: on the one hand, sure, programming languages use english lexicon, right? it's print, not imprima or imprimir. I know a few <not many> programming languages and I've noticed they're all very similar, if not in syntax, in some deeper structures: for example, as English is mostly uninflected, so are I would say all programming languages: and it's not like you couldn't have built inflection into proglangs either: is this cause of technical reasons or simply because the first programmers were english speakers and we all sort of went along? an example of the latter case is almost certainly, to my mind, the case for the way we declare variables: token is equal to expression is, well, a reflection of how you state that a thing is the case in English, right? I'm a sociologist: but it could just as easily have been the other way around: a proglang could express

MyVar=21

as

means 21 MyVar

And would probably be the case if some other natlang had been the L1 of the guys who wrote the first assemblers or whatever.

Is this like... a thing? like, have people thought about this... linguistic parochialism of the way proglangs are, and alternative ways in which they could work? this is not an area I know a lot about.
(1) Much of programming syntax is derived from (western) math syntax, which was mostly developed before english was the dominant european or world language.
(2) Most object-oriented languages nowdays have 2 different syntaxes (one derived from math, the other from english) that do basically the same thing. Compare:

Code: Select all

man.eat(apple) // englishy SVO
eat(man, apple) // mathy VSO

// but with operators, you're limited to SVO, which is what math also traditionally uses for operators anyways
2 + 3
(+) 2 3 // doesn't exist in OO languages
But declarative functional languages (like haskell and elm) have thought about this redundancy, and have either discouraged or ridded themselves of the first SVO type of function call:

Code: Select all

man `eat` apple -- works in haskell, but not elm
eat man apple -- note that in haskell and elm, the "subject" of the function/verb is traditionally the /last/ parameter of the function, not the first
eat apple man -- preferred style, because it makes making useful closures easier

2 + 3
(+) 2 3 -- useful when you need to pass the addition function to another function
Yeah, this could happen. I do some scripting for my job, and I can tell you I wouldn't want to type "means" instead of "=" every time I needed to assign something. It's 5x the work! (I didn't even feel like writing out "times" there.... crap. I just did...) "=" is an already available symbol that means something very close to what it's doing in programming, so why not use it? Also, when you're scanning code, I'd say that the "=" signs will just out a little bit from the surrounding text, making it easier to ready.
But what about the order ? Why not instead write ? :

Code: Select all

= 21 myVar
But even haskell and elm don't do this. ... Maybe because knowing which "subject" is being assigned is the most salient part of an assignment, and therefore it's best for the "subject" to come first.

(3) I think that "for" loops are awkward in most proglangs, and would probably have a different form if the programmers that created them had a different natlang phrase for what they do.
Post Reply