alice wrote: ↑Sun Dec 20, 2020 11:24 am
How different would they be if they had been, in the main, developed by speakers of agglutinative or polysynthetic languages, or even of fusional languages, rather than of largely isolating languages?
Some things of programming languages would probably be indicated with morphology(+syntax) rather than punctuation(+syntax), I think. Or with a different syntax even.
One thing I notice is that the member access syntax in C structs, and therefore many other modern languages, is similar to the Arabic ʔidˤāfa indicating possession while requiring a strict order and nothing in between:
student.name —the dot is basically like the Arabic space between possessum and possessor. I suspect this is so as a metaphor of English free noun + noun compounding, "this is a student name" (even the word order is reflected). If more early languages had been made by Spanish speakers, maybe we'd see
name de student
instead, or with a sigil to represent value loading,
$name de student.
And if it had been ancient Romans, maybe even
name student&
with "&" standing for a genitive inflection of the variable.
Recall how by convention most languages use
!myboolvar, conventionally with no space (although spacing can often be added) in order to negate boolean variables, but Python uses
not myboolvar, much like my imaginary Spanish-based language
name de student
Because of C, many programming languages have condition expressions that look like:
(myboolvar? "alice" : "bob")
which seems to imitate English "if he is an ZBB oldbie, alice, otherwise bob". Python does something Different:
"camilla" if myboolvar else "daniel"
but that is also readable as English, it just changes the constituent order so that instead of "?" and ":" the words "if" and "else" may be used. Classical Chinese has a condition syntax that can also look like
(x? a:b), but it very often just uses "then" in the apodosis, literally "she is loved, it's then emilia, otherwise frankie". So an alternative programming language syntax could exist along these lines (with keywords in another language of course):
myboolvar then "emilia" otherwise "frankie"
or,
myboolvar then "emilia" or-if-not "frankie"
This is the same as
(x? a:b) syntactically from the computer's point of view in the end, but it
is a different metaphor from the human point of view (the "?" in C suggests it delimits the condition in question, rather than mark the result if true).
rotting bones wrote: ↑Sun Dec 20, 2020 2:34 pmProgramming languages are artificial languages. If our first conlangs mirror our native languages, then could it be that OOP would've been developed earlier and it would've been more tightly integrated with syntax?
I don't think so, because you can kind of do OOP in C as it is? Use structs for encapsulation, factory functions as class constructors that integrate inheritance, and then you fake polymorphism with appropriate identifiers in the structs + checks in the functions. Definitely not a normal way to write things in C though. Things like Python and C# just make this stuff easier to read and write, so you have incentives to use them.
Maybe OOP wasn't born earlier because no one really thought about that style of programming... Structs were deemed good enough data holders, and everything else could be parades of functions at the same level, with no encapsulation beyond the file itself, marching down the lines.