News for hackers. Stuff that matters.
Re:Programming languages are not languages (2018) by hombre_fatal on Tuesday April 14, 2020 @01:07PM (#22868487)
I know this isn't related to the article's content, but I've certainly, and sheepishly, thought at some point in my youth that learning programming was pretty admirable like learning a second language. Sure, you learned French, but I learned C++, I would think to myself, envious.

Then I actually learned a second language in my late 20s and chuckle at my former hubris (well, more like wishful thinking) that a programming language was comparable.

Programming was just something my socially destitute self did for fun in the comfort of my bedroom. To learn how to speak a language, I had to (shudder) talk to other people. And socializing with people isn't this finite, self-defined virtual world like your game.js file where you just invent your own physics: You have to actually figure out the social world.

Re:Programming languages are not languages (2018) by coliveira on Tuesday April 14, 2020 @01:13PM (#22868557)
This is an illusion that was fed early on by people working on programming. The reality is that programming languages are languages, but only for a very restricted vocabulary that is not even close to what can be done on human languages. Also, being fluent in a human language involves not only reading and writing, but also talking, which as you pointed out is a considerably more complex skill.
Re:Programming languages are not languages (2018) by naasking on Tuesday April 14, 2020 @05:21PM (#22871613)
> The reality is that programming languages are languages, but only for a very restricted vocabulary that is not even close to what can be done on human languages.

Vocabulary is not the real difference. A word is an abstract concept given a definition in terms of other words. The equivalent of set of related words is an API in a programming language.

The real difference is that natural languages are intended and optimized for speaking, and they inherently encourage ambiguity because conversation is an interactive process where one can request clarification. Programming languages are typically non-interactive and don't tolerate ambiguity at all.

Re:Programming languages are not languages (2018) by hutzlibu on Tuesday April 14, 2020 @06:34PM (#22872314)
"Vocabulary is not the real difference. "

It also is. Because in a programming language every vocable is clearly defined when used, or you get an error.

Words in natural languages are not really clearly defined. There is only a very small subset of words, people are not fighting over their definition.

Thats why it is an art, to write a understandable book. Or give a lecture, the audience can understand.

But you are right, languages are optimized for being spoken in 2 ways. With the possibilitie of clarification.

Re:Programming languages are not languages (2018) by imoverclocked on Tuesday April 14, 2020 @09:21PM (#22873472)
Clearly, you have never read the C spec.
Re:Programming languages are not languages (2018) by hutzlibu on Wednesday April 15, 2020 @07:41AM (#22876601)
No I did not. But in the end, when it gets compiled, every word is clearly defined, or not?
Re:Programming languages are not languages (2018) by grawprog on Wednesday April 15, 2020 @10:06AM (#22877802)
>C11(ISO/IEC 9899:201x) §3.4.3

>1 undefined behavior

>behavior, upon use of a non portable or erroneous program construct or of erroneous data, for which this International Standard imposes no requirements

>2 NOTE Possible undefined behavior ranges from ignoring the situation completely with unpredictable results, to behaving during translation or program execution in a documented manner characteristic of the environment (with or without the issuance of a diagnostic message), to terminating a translation or execution (with the issuance of a diagnostic message).

>3 EXAMPLE An example of undefined behavior is the behavior on integer overflow.

Re:Programming languages are not languages (2018) by hutzlibu on Wednesday April 15, 2020 @02:20PM (#22881142)
"EXAMPLE An example of undefined behavior is the behavior on integer overflow."

Yeah, that is obvious, but is there a example, where a defined variable is not clear defined and ambigious?

Re:Programming languages are not languages (2018) by gowld on Tuesday April 14, 2020 @07:56PM (#22872897)
> Programming languages are typically non-interactive and don't tolerate ambiguity at all.

Larry Wall vehemently disagrees.

Re:Programming languages are not languages (2018) by K0SM0S on Tuesday April 14, 2020 @04:34PM (#22871114)
I totally agree. I find that the appeal of programming languages, their strength, fades away in the face of pure mathematics anyway. There's nothing like the full complement of a formal language, symbols, abstractions and all, one that you can write and read just as fluently as English.

As for human languages, being bilingual myself (acquired over 30ish years (am 37), not innate), I can only testify that this is as close to having "two different minds" as it gets— the sheer experience of life is different depending on which language you think it in, you speak it or write it to others.

That's as close as I can get experientially (qualia) to the notion that language is culture, civilization, thus psychological mindset (both individual and collective).

It's a very weird experience of life to have this ability to switch between modes. Doesn't make you any smarter I guess, but certainly opens one's horizons, helps thinking 'out of the box' (i.e. perspective), reach more balanced views perhaps.

I'd like to write a short piece about that someday. Hopefully later if #19 hasn't disposed of me by then.

Note that there is little to no overlap with programming languages or math. You can think these domains in any human language, the translation in symbols/code remains identical, ideally (that's formalism to me, requiring mathematical rigor, not literature skills).

As such, it is interesting and enriching to learn both— several human languages, and math (or at least one programming language). You gain things from each that do not exist in the other subset no matter how deep you look.

Re:Programming languages are not languages (2018) by xkapastel on Tuesday April 14, 2020 @08:46PM (#22873207)
> I find that the appeal of programming languages, their strength, fades away in the face of pure mathematics anyway.

The appeal and strength of a programming language is its ability to be executed, something that pure mathematics does not and cannot ever have.

Re:Programming languages are not languages (2018) by martin__ on Tuesday April 14, 2020 @10:36PM (#22873886)
You might want to look into something called Constructivism:

https://en.wikipedia.org/wiki/Constructive_proof

Re:Programming languages are not languages (2018) by imtringued on Wednesday April 15, 2020 @05:16AM (#22875866)
>I totally agree. I find that the appeal of programming languages, their strength, fades away in the face of pure mathematics anyway.

Then you haven't learned anything. Even pure mathematics is still expressed in arbitrary notation. It's no different than a programming language in that regard.

Re:Programming languages are not languages (2018) by Tainnor on Wednesday April 15, 2020 @08:37AM (#22876975)
Mathematical notation is much more fluid than programming languages. People make up notations on the spot or abuse notation all the time. This is all done in the interest of uncluttering the maths from any unimportant details so you can focus on the important patterns.

You can see that if you ever try to do actual maths on a computer, e.g. with a CAS or, worse, an automated theorem prover. Suddenly you have to care about all these technical details and you get bogged down quickly.

Re:Programming languages are not languages (2018) by K0SM0S on Wednesday April 15, 2020 @01:53PM (#22880806)
This is exactly it. The terseness of mathematics, the cognitive efficiency of these notations aren't to be debated, I feel.

I'd rather ignore ad hominem above ;)

Re:Programming languages are not languages (2018) by leetcrew on Tuesday April 14, 2020 @04:28PM (#22871052)
> Also, being fluent in a human language involves not only reading and writing, but also talking, which as you pointed out is a considerably more complex skill.

I would push back slightly on this. I don't consider the ability to have a conversation in french to be a greater achievement than reading (and understanding) a latin text.

Re:Programming languages are not languages (2018) by Pmop on Tuesday April 14, 2020 @05:31PM (#22871720)
I had my first conversation in English recently, despise having been reading books and texting people using this language for a while; and yet, managed to express my ideas just fine. English pronunciation is a bit harder though, as what is written is oftentimes different from what is spoken, and you risk running in circles trying to find the correct pronunciation. My native language has a phonemic writing system.
Re:Programming languages are not languages (2018) by take_a_breath on Tuesday April 14, 2020 @05:56PM (#22871997)
==I don't consider the ability to have a conversation in french to be a greater achievement than reading (and understanding) a latin text.==

Computers have a much easier time translating text than they do holding conversations. That might be an indication that one is more complex than the other.

Re:Programming languages are not languages (2018) by imtringued on Wednesday April 15, 2020 @05:19AM (#22875876)
Translation is far harder than holding conversations. It means that you must be fully aware of tiny cultural differences in the languages. Just because two words have the same dictionary definition doesn't mean they actually are equivalent. However, the quality of translation usually doesn't matter as much as the quality of a conversation precisely because a human wrote the original text and the recipient knows the target language and culture.

>That might be an indication that one is more complex than the other.

It just means that most of the work is done by the humans.

Re:Programming languages are not languages (2018) by take_a_breath on Wednesday April 15, 2020 @08:08AM (#22876766)
You have to do the same thing when speaking. The addition of body language and tone, which text doesn’t have, make it more complex.

If it was easier for computers to do it, they would. That humans do the work is further evidence it is more complex.

Re:Programming languages are not languages (2018) by leetcrew on Tuesday April 14, 2020 @06:34PM (#22872311)
translating is not the same as reading and understanding. out of curiosity, I plugged catullus 16 into google translate. it did a decent job, but not much better than looking up each word one-by-one in a latin dictionary and picking the first english meaning.
Re:Programming languages are not languages (2018) by filleduchaos on Tuesday April 14, 2020 @05:12PM (#22871516)
Are you bilingual?
Re:Programming languages are not languages (2018) by leetcrew on Tuesday April 14, 2020 @06:04PM (#22872061)
I wouldn't call myself bilingual, but I speak enough spanish to make myself understood by people who don't know any english.

can you read latin?

Re:Programming languages are not languages (2018) by filleduchaos on Wednesday April 15, 2020 @04:29PM (#22882641)
"Enough Spanish to make myself understood" doesn't really tell me much. There is a huge gap in command of a language between "I can order food or ask for directions on the street" and "I can drop into a conversation about today's news, no problem", and a huge gap in fluency between "My grammar/diction/pronunciation are incorrect but people can strain themselves to figure out what I mean" and "My speech is accented but clearly intelligible".

The greater point is that reading and writing are actually both easier and simpler than listening and speaking[0], even though we tend to learn how to do the former after the latter; think of the difference in difficulty between building software that can process natural language from text vs. from speech, and realise that many of the same additional problems (such as the sheer ambiguity of sound versus letters and the ephemerality of real-time speech) apply to human brains as well as to software systems. In fact, as you develop beyond infancy, the ability of your brain to distinguish sounds that are not a part of your native language(s) rapidly atrophies in favour of optimising for the ones you heard on a daily basis as a baby[1].

> can you read latin?

No, because I have next to zero interest in it. I am however familiar enough with [Ecclesiastical] Latin to recognise that it is largely overhyped in "difficulty" by monolingual English speakers for whom it is their first tangle with extensive conjugations and declensions - it's not much harder or more complex than the Romance languages it birthed[2], and is significantly less so than, say, modern Arabic or many of the Slavic languages.

0. Additionally reading and listening are relatively easier than writing and speaking respectively, due to the brain ingesting information more readily than it produces it.

1. There are about 800 distinct sounds used in all human speech, but the average language only uses ~40. By the time you're a year old, you've neurally committed to whatever handful of those sounds those around you have been making; you become hard-pressed indeed to even hear the difference between the remaining ~760 and the ones you already know. As a concrete example I've had personal experience with, in Hausa the sound written as `f` isn't pronounced labiodentally (upper teeth to bottom lip, the way it is in English) but rather bilabially (lips close together, not quite touching, and air forced between them at varying speeds depending on the word). People whose languages don't have that sound almost invariably interpret that sound as a `p`, an English `f`, or even an `h`.

2. As something of an aside, French is my third language (having been exposed to it since I was three or four years old) and I can attest to how much more difficult it is to speak/listen to it than to read it.

Re:Programming languages are not languages (2018) by godelski on Tuesday April 14, 2020 @06:49PM (#22872425)
To add to this, there are extremely limiting languages like Toki Pona[0]. To construct complex ideas it relies heavily on combining words. But that's also a characteristic we see in most languages, especially in German and Chinese.

The only difference I see is that we don't speak C++ (though you could argue that sometimes we do). Mostly because it is pretty laborious and not worth the effort when we have a common tongue (pun intended) between us.

Spoken languages were created to communicate. They advanced to allow us to convey complex and highly abstract ideas. I wouldn't say programming languages were constructed with the same intent (at least they are intended to be interpreted by a computer, not by a human).

[0] https://en.wikipedia.org/wiki/Toki_Pona

Re:Programming languages are not languages (2018) by imtringued on Wednesday April 15, 2020 @05:32AM (#22875940)
I always wonder why anyone would bother with pictograms for a new language. The Latin alphabet is just a bunch of strokes that can be trivially written in cursive. When you consider all the awful writing systems that exist around the world the Latin alphabet appears to be near perfect. Toki Pona is just adding one entry on the list of languages with awful writing systems.
Re:Programming languages are not languages (2018) by godelski on Wednesday April 15, 2020 @01:09PM (#22880262)
Chinese is pretty efficient as a language. I think there are things that are more obvious in traditional though. There are advantages and disadvantages to each. But beware self bias because you (I'm assuming) grew up with an alphabet based language.
Re:Programming languages are not languages (2018) by pgt on Tuesday April 14, 2020 @07:45PM (#22872824)
I wonder what a Toki Pona for computer programming would look like.
Re:Programming languages are not languages (2018) by godelski on Tuesday April 14, 2020 @10:31PM (#22873863)
I mean... binary and assembly are things...
Re:Programming languages are not languages (2018) by Pmop on Tuesday April 14, 2020 @05:52PM (#22871945)
IMO, I'm not linguist but I can see a programming language being just as "language" as any other. Follow my thinking. Just like math topology, if you don't punch a hole into your domain, you can stretch and shape the former until you obtain something else that also doesn't have a hole and looks like something else, but it's fundamentally the same "domain" you started from, you can stretch and shape it back into that. Now let's progress into languages.

Human languages are used to communicate abstract and concrete ideas, and that is achieved by the use of either symbols, sounds and/or body expressions. Now, it happens that we don't speak 'C++' for sure, and we can't certainly wave 'C++', but we definitely can communicate abstract ideas by using C++; besides, that's what happen when you write C++ code. Also, when you read someone's else C++ code, eventually you'll learn the abstract ideas that are being communicated, can take a while, depends on many factors, but eventually you'll do.

So, by this reasoning, programming languages are as just as "language" as the humans one, as far as we consider communicating ideas the main objective here. They might not be efficient enough so you can communicate to your friend how you liked the book you've just read (without using a string literal all alone, ofc), but human languages aren't also efficient in communicating a x86 processor what to do in order to sort an array; but both languages communicate ideas nevertheless.

Re:Programming languages are not languages (2018) by Tainnor on Wednesday April 15, 2020 @08:41AM (#22877010)
One key difference is that you can't really "lie" in C++. This is a core feature of human languages.
Re:Programming languages are not languages (2018) by musicale on Tuesday April 14, 2020 @04:08PM (#22870827)
C++ is much harder than French - I'm pretty sure no human can be considered completely fluent in C++.
Re:Programming languages are not languages (2018) by munk-a on Tuesday April 14, 2020 @04:31PM (#22871076)
To contrast - oh sure there are some obscure C++ language features you can only learn from a mountaintop guru, but there are obscure french features you can only learn in an isolated swiss township.

French is harder - but programming is also hard. One interesting contrast is that programming "languages" might be better placed as wide sweeping paradigms, with learning C++ if you know Java being closer to learning a Boston accent and learning PHP if you know Java maybe learning a new dialect.

Re:Programming languages are not languages (2018) by dempseye on Tuesday April 14, 2020 @04:41PM (#22871161)
Sorry, but this is nonsense.

Fluency in a natural language is a woolly concept. There is no such thing as being "completely fluent." There are various dimensions of language proficiency and even native speakers vary greatly in their abilities. Even the most eloquent writers and speakers of a natural language are ignorant of vast portions of it, after using it for decades.

Re:Programming languages are not languages (2018) by ModernMech on Tuesday April 14, 2020 @05:10PM (#22871493)
I'm pretty sure it was a joke...
Re:Programming languages are not languages (2018) by jandrese on Tuesday April 14, 2020 @05:50PM (#22871923)
C++ is a language just like Math is a language. How hard or easy it is to learn isn't the point, it is a means of conveying thought into a transcribable form.

I do agree however that natural languages are almost universally larger and more complex than programming languages, largely because there's no restrictive compiler or interpreter shutting down people who attempt to corrupt it. Left to their own devices people will ruin a language. History has proven this over and over again.

Re:Programming languages are not languages (2018) by Tainnor on Wednesday April 15, 2020 @08:44AM (#22877031)
Are you aware that the language you speak is just "ruined" Old English, which is just "ruined" Germanic, which is "ruined" Indo-European? Yet, strangely, we had Chaucer and Shakespeare using these "ruined" languages to perfection.
Re:Programming languages are not languages (2018) by jandrese on Wednesday April 15, 2020 @02:39PM (#22881360)
That phrasing was somewhat tongue in cheek, but you've hit the main problem. Natural languages are constantly mixing, evolving, mutating, and diversifying. As a result they pick up loads of sometimes temporary inconsistencies and regional variances that simply require the person learning it to memorize an ever changing set of arbitrary rules.

Computer languages on the other hand are far more static, so once you've learned its typically very simple grammar and vocabulary you are done save for a handful of tweaks in major version updates that happen only once every few years.

Re:Programming languages are not languages (2018) by BerislavLopac on Wednesday April 15, 2020 @12:07PM (#22879418)
I think it comes down to this: the purpose of human languages is communication (i.e. two-way), while the purpose of programming languages is instruction (i.e. one-way).
Re:Programming languages are not languages (2018) by godelski on Tuesday April 14, 2020 @06:51PM (#22872438)
Why does the distinction here come down to the ability to speak? I find this odd, especially on a site that has a high portion of introverted people.
Re:Programming languages are not languages (2018) by hombre_fatal on Wednesday April 15, 2020 @01:46AM (#22874920)
Well, the ability to communicate with others. Transferring and receiving the state of our mind and emotions to others. It's fundamentally deeper and hairier than the things we program.

I suppose you can learn a language without ever interacting with others. I thought I could learn Spanish that way, the same way I learned to program.

Eventually I could read in Spanish yet was hard pressed to utter a sentence. And when I interacted with people who could speak Spanish, it was just depressing and shameful. Learning a language just to be able to read some more books and watch some movies turns out to be pretty dull.

As an introvert, this was part of the journey that made me truly appreciate human interaction and question how much time we spend caring about programming and tech. Kind of like how I cared about things when I was younger and have started caring about people as I get older.

Of course, my whole top level comment is a complete derailing of the discussion around the article and just an unsolicited meandering on my part. I don't think there's much analysis to be had in my post. I just immediately though of my younger self and anyone I've ever heard trying to compare programming to communicating with other humans in their native tongue.

Re:Programming languages are not languages (2018) by godelski on Wednesday April 15, 2020 @01:13PM (#22880318)
> Well, the ability to communicate with others. Transferring and receiving the state of our mind and emotions to others.

But again, why does this require speech? There's sign language. There's braille. Are neither of these languages?

What I'm trying to say is that this isn't really a simple question. We've clearly thrown out the dictionary definition of a language, but these restrictions seem arbitrarily created to disclude programming languages but the way they're done also disclude things we do consider languages. Verbal communication seems like a strange restriction.

Re:Programming languages are not languages (2018) by empath75 on Tuesday April 14, 2020 @04:57PM (#22871356)
Small children learn two languages all the time. Try to teach Haskell to a five year old.
Re:Programming languages are not languages (2018) by filleduchaos on Tuesday April 14, 2020 @05:25PM (#22871652)
The ability of the infant brain to pick up as many languages as surround it is a testament to its incredible plasticity, not an indicator that it's "easy".

If you doubt that, good luck becoming even halfway productive[0] with a second natural language as an adult in anything close to the amount of time it takes to become productive with a second programming language.

0. Productive, while a fairly weird word choice, can here be taken to mean "able to consistently engage in and with non-trivial communication" the way that productive in a programming language can be taken to mean the same for non-trivial features and tasks.

Re:Programming languages are not languages (2018) by JadeNB on Tuesday April 14, 2020 @05:19PM (#22871586)
https://justtesting.org/post/70871612766/lets-program

Small children learn two languages because they're surrounded by people speaking two languages. Children's brains are highly plastic; if they were immersed in people speaking code language as they speak natural language constantly, then they would learn that, too.

Re:Programming languages are not languages (2018) by dtech on Tuesday April 14, 2020 @05:58PM (#22872016)
If people exclusively communicated with the child in Haskell (and maybe Java or something else) the child would become amazing at it just as fast.
Re:Programming languages are not languages (2018) by empath75 on Tuesday April 14, 2020 @06:15PM (#22872151)
I don’t think that’s the case. There’s a whole tower of concepts that need to be learned before one can learn how to use a programming language.
Re:Programming languages are not languages (2018) by type0 on Tuesday April 14, 2020 @06:07PM (#22872086)
but that would be child abuse
Re:Programming languages are not languages (2018) by hutzlibu on Tuesday April 14, 2020 @06:39PM (#22872352)
I sadly do not remember the name, but there was a teacher/philosopher around 1900, who tried to teach his pupils the natural language in a math defined way. (and wrote books about the concept). His intentions were good, but he was not liked so much and he ultimately had to accept the impossibility of it...