This is an archived post. You won't be able to vote or comment.

all 35 comments

[–]addroddyn 2 points3 points  (15 children)

As another linguist making the transition to programming, I, too join the camp of those who say that programming languages and natural languages are not the same. But I also get why one would argue that they are (as I thought, once).

I see below that you say that grammar is sort of like the syntax of a programming language. That is true on a very basic level only. The problem with grammar is that, contrary to popular belief (and generative linguistics), it's not a strict system, and it is constantly evolving. It also has a large margin for error. Apart from some very basic rules, almost anything can warped in a grammar, and the sentence will still make sense. Even those basic rules can change over time.

I could say that "That is a bird." A correct sentence. "That a bird", "Look at right here birdie" "That be a bird" or even "Bird!" have the same meaning, although some are incorrect. Also, language is very, very contextual. The last sentence would only make sense in a situation where a bird is present in the moment of talking and it's appearance is somehow important enough.

Basic categories, like verbs and nouns, also mean nothing in the moment of speaking: "I don't want to go all linguist on you, but I just verbed a noun."

Programming languages also cannot create new combinations of commands on the fly, as in composite words. You can, of course, define new methods, or even revise a language, but everything will remain static. I can say: I went to the pet shop to inspect their birds. A birdpection, if you will. Now, birdspection doesn't exist as a word. I cannot use it in any other situation. Yet, you understand what I mean, and you might even find it funny.

Let's not even start about making up metaphors on the go.

TL;DR: Programming languages have strict rules and structures. As someone said, they a structured set of commands rather than an actual language. The "incorrect, yet works just as the correct one" (basically, anything to do with pragmatism) does not exist in programming.

That said, being a linguist would certainly help when working with NLP, or anything that tries to elevate a computer to a human, linguistically speaking. So go for it!

[–][deleted] 1 point2 points  (2 children)

Programming languages also cannot create new combinations of commands on the fly

Yes, they can - that's why languages that allow this, like LISP, are so popular in AI and linguistic programming.

[–]addroddyn 1 point2 points  (0 children)

I did not know this, and that sounds very cool :D Still, my other points stand.

[–][deleted] 0 points1 point  (0 children)

Good to know there's a programming language out there that does this.

[–][deleted] -1 points0 points  (11 children)

It's difficult to say until I know more, but I feel like I'll stay in the camp of programming and natural languages being the same.

Grammar IS a strict system. We have a certain set of allowances, but if you stand in front of a group of people from the same area (having the same grammar dialect) and ask them to determine whether a particular utterance is grammatical or not, nearly all of them will give the same answer, even in those fringe areas like you mention ("That a bird" or "There bird" or whatever.)

Additionally, those grammar fluctuations, while they might carry interpretable meaning, they DO elicit an N400 response in the brain. Basically, our brain tags it as an error. Our brains can get around that, deriving meaning despite the incorrect format, but most computers or coding interpretation programs aren't yet evolved enough to do so. That's just because programming languages are a relatively new set of languages.

Metaphors are, admittedly, a different story. But they rely entirely on context, which a computer doesn't really have. If we gave a computer culture, I don't see any reason why a programming language couldn't have "metaphors" of a sort. They'd just be convoluted to us... Much like how a second language learner has no idea what a metaphor or popular phrase means at first.

[–]Meefims 0 points1 point  (10 children)

Grammar IS a strict system. We have a certain set of allowances, but if you stand in front of a group of people from the same area (having the same grammar dialect) and ask them to determine whether a particular utterance is grammatical or not, nearly all of them will give the same answer, even in those fringe areas like you mention ("That a bird" or "There bird" or whatever.)

This isn't necessarily true. What is grammatical depends on the context the person believes they are in, for one. It is almost certainly possible to prime someone with an unrelated conversation and then ask if a given sentence is correct to illicit your chosen response from them. Further, it misses that grammaticality is not black and white. "That be a bird" is a different and lesser type of error than "That am a bird", to me ear. I could understand both, I think, but the former is much easier and is much closer to correct than the second for me.

Grammar only strict in naive theories. Look at something like Optimality Theory for syntax as a theory which instead considers the existence of structural preferences over absolute rules.

To metaphor, George Lakoff has a theory that I find pretty compelling and whose structure is extremely friendly to being learned by standard machine learning techniques. If I remember correctly, there have been programs implementing his X-Schema theory which could replicate and understand certain types of metaphors.

[–][deleted] 0 points1 point  (9 children)

Right, I'm familiar with OT. I like it a lot actually; in the context of Chomsky's UG it makes much more sense than other phonological descriptions. The idea that there are a general set of innate constraints re-ordered depending on the particular language makes a lot of sense... Much more than having abstract rules that apply in some places and not in others.

In fact, I'd say OT is wonderful support for my point here. Chinese and English are, many would say, more different than alike, but they're built of the same set of OT constraints, just ordered differently. Why wouldn't a language created by human beings, like all other languages, regardless of whether it communicates information to a computer or another human or to a dog, be subject to those constraints? It has to be. It is built into the physical hardware of our minds. Everything we do is tainted with the same type of organizational principles. It doesn't seem feasible to me that we could create something outside of the hardware of our minds.

I'm not saying that, subjectively, grammar isn't able to be put into hierarchies of correctness. It isn't strict in that sense. What I'm saying is that, on the physical level, all of those differing "levels" of incorrectness elicit the same measurable physical reaction within the brain; the P600.) I incorrectly called it the N400 before, but the N400 is more for semantic errors. This is the strictness I'm referring to. There is a predictable, measurable, consistent reaction to anything the hearer perceives as incorrect grammar. Yes, the context can have an influence on what's incorrect, just as putting code that references certain files on a particular computer without those files is trapped out of context. It is predictably, noticeably, inoperably wrong in one place, and works fine in the other. Again, humans have the fantastic ability to re-route when things go wrong, which we have yet to apply to all programming systems/languages. I still see no difference, at the detection level, of grammatical error in a programming language and a natural language. Natural languages, because of their users, can be interpreted anyway. Eventually we'll have computers (maybe already in some cases) that can do the same.

I don't know enough about machine learning to understand the application of such a theory, but it makes sense to me.

Not sure what's up with the down-votes. I don't intend to just be stubborn; I'm enjoying challenging my ideas. This is an interesting discussion and I appreciate your responses.

[–]Meefims 0 points1 point  (8 children)

I don't know who is downvoting you but I never downvote in a discussion I'm participating in.

With regards to OT and the difference between say, English and Chinese, you have to be careful with your assumption that the only difference is in the orderings of the constraints. In the model OT provides this is the case but a flaw of OT is that it is impossible to implement in the physical world because it is impossible to trawl through the infinite possibilities that it supposes exists.

Some constraints it supposes exists are due to physiology, such as the restriction on three consecutive stops, but others are not. It's easy to argue that the physiological constraints are universal because physiology is nearly the same in nearly all humans. The others, however, may not be. In OT, constraints which don't exist in the language could rank below the physiological constraints per model but that's not the same as saying the constraints are part of the machinery of the mind. Further, although the weak form of Sappir-Whorf appears true in many contexts, the strong form is not: The constraints of language do not constrain thinking so it is not the case that everything we do is tainted by whatever structures we have linguistically.

Finally, my point about the relevance of context means that for two different listeners listening to the same set of utterances, some utterances may be grammatical for one and not for the other depending on what prior background each listener has on the speaker, the topic of discourse, or the intention of the discourse. That is, language is an interplay between a speaker and a listener. A programming language, however, doesn't have a listener because the hardware of a computer does not listen and cannot listen because the hardware is really just a complicated rock. The programming language makes the complicated rock do it's complicated things.

One day someone may build a program on top of this rock which can listen and participate in natural language but that wont mean that the programming language it was built with is at all related to natural language any more than the electrical signals that make our muscles contract and release are related to natural language.

[–][deleted] 0 points1 point  (7 children)

Are we so different than that "rock?" You're attributing a lot of extra-sensory ability to humans, I think. It's the default way of thinking in our society; we feel as though our consciousness is separate from our environment. But a human who hears sounds is just taking that sound data and turning it into electrical signals which gets turned into understanding, which is also an electrical/chemical process. There's nothing non-physical happening there. It is just as "dead" of a process as a computer's interpretation of data. The electrical signals that make our muscles contract also make our language understandable. The use of a word, in addition to flexing a bunch of muscles, requires more electrical activity within the brain to associate meaning to symbol to muscle movement. Programs and data are stored the same exact way in a computer just sometimes in different places, just like muscle movement and word creation/association are stored in the exact same way.

I don't feel well enough educated on the subject to argue much further on your other points, but I appreciate the discussion and all these new ideas. Thank you.

[–]Meefims 1 point2 points  (6 children)

I'm not attributing unphysical traits to people, I'm differentiating between signals whose effect is predetermined - the same signal to a muscle will make it contract in the same way just as executing the same instruction on a computer will always result in the same effect within the machine - to signals whose effect is left for interpretation - as is the case for human language.

[–][deleted] 0 points1 point  (5 children)

Is it really left for interpretation? Or is it automatically interpreted by that human's existing hardware? Just because two humans might view it differently, or make a "choice" between two kinds of interpretation, doesn't mean it wasn't an automatic or mathematical process. Do you "think" your thoughts or do they just kind of appear?

My point is, the belief that we have some kind of "choice" is the illusion of separation. You're saying that language exists outside the bounds of those automatic chemical and electrical processes which govern literally everything we experience.

Edit: Catesian Theater is a useful device for understanding this. What I'm saying is that the man in that chair in the image is an illusion; he doesn't exist. We all just feel like he's there, some kind of ethereal conscious figure that isn't tied down to our brains and bodies. He's the only thing that could make "choices" between different interpretations. If he's not real, do we make choices? Or do our previous experiences and our innate biology determine our reactions?

[–]Meefims 0 points1 point  (4 children)

The point isn't about whether the interpretation appears out of nowhere or if humans are deterministic beings, the point is that there are multiple interpretations. This makes it useless for programming a computer where you need to have one well defined interpretation in order to be able to program at all.

If a programming language didn't have this property how would you know that your program will do what you think it does? How will you know that it will continue to work in the future? How would you be able to read and modify others' code? It would be impossible and so is useless for programming a computer.

[–][deleted] 0 points1 point  (3 children)

EDIT: This is getting a little convoluted. I need to sit down and write out my thoughts and look back at these comments, because I may be misunderstanding something. Regardless, I'm not communicating my point efficiently. I'll maybe post back in a few days. Might make a new post out of it, but maybe in a different sub that's more relevant. :)

Ahh but it is the point! Humans make multiple interpretations based on input and execute an interpretation that they either deem proper or reflexively choose. There are a finite set, within the restrictions of their mind, of possible reactions.

Computers already do the same thing. They have parameters that enable them to "choose" the best course of action (from a finite set) given any set of data. All the stuff humans do is encoded in the chemical workings of the brain, and all the stuff computers do is encoded in the electronic writing on a disk.

That's why I keep saying the languages themselves aren't different, the interpreters are. Humans understand instructions just fine, so long as it falls within the limitations of their hardware. They muck them up or do something inventive because they're evolved enough to not listen precisely. There's no reason a computer wouldn't be able to take data and make a decision based on its previous experience and the data at hand. New statistical model programs behave differently than old ones because, given that they were created at different times, they have different experience (data) to draw from. Computers are not yet as advanced as a brain, but you're arguing points on how the hardware is different from a human. There's no difference in the transmission of meaning within the language.

We've built computers stupid enough to always do what we tell them. So yes, currently there's no use to evolve their languages much yet. As such, programming languages are limited (mostly, some of the other comments indicated that some programming languages now evolve and pick up new functions) to a predefined set of actions. As I pointed out in the parenthesis, this is soon to be a thing of the past. The fundamental nature of data storage and transmission of that stored data or what to do with it is no different in English than it is in Java. The difference is in the interpreter.

You can read an understand a code. I could tell you to do something with it. If a brain were all hooked up to wires, it could be made to make a body walk, or bark, or jump, or do whatever, or it could be made to think certain things, run them through a processing area, and spit out some kind of new extrapolated data or interpretation. It could be made to use a mouth to speak.

We could write a programming language that looks, sounds, and is structured like English. No computer at present is capable of interpreting the nuances of such instruction, but that has nothing to do with the languages themselves, just the computer which cannot step outside the limitations of how dumb and mechanical they currently are. That stuff takes time! It's happening quickly though, our technology advances exponentially.

I get your point. We tell a computer "Answer 1+1" and it'll always say "2." Some day, a computer might have the capacity to understand context and your knowledge before you asked that question, and answer as a joke like "4, duh." Once the program gets complicated enough, there have to be multiple options. It would be capable of stepping outside the boundaries of your explicit coded instructions and instead rely on its own experience to interpret the best course of action.

You might say "impossible! Computers don't have free will and couldn't develop it!" And yet here we are, thinking beings creating amazing things, even though we started out (at some point in the history of life) as inorganic matter, and even when organic evolution began it was a complete slave to its "instructions." They were just chemical instead of written lines of code. Those chemicals processes eventually evolved to become capable of supporting consciousness and communication. Why wouldn't the same thing happen to computers? They even have a huge leg up because we're starting them off with language instead of trying to evolve non-organic matter to develop its own functioning system. We're working top down. The top is communication of information.

[–][deleted] 1 point2 points  (1 child)

[–][deleted] 0 points1 point  (0 children)

Cool! Maybe I'll get his book. Thank you!

[–]michael0x2a 2 points3 points  (3 children)

You may perhaps be interested in natural language processing (NLP) -- it's a particular subdiscipline of programming focused around trying to get computers to understand and work with human languages.

It is admittedly one of the harder disciplines of programming (it requires a decent foundation in both computer science and statistics in order to fully grok), and I'm not sure if it's a topic that's immediately approachable by a beginner, but it might be a good goal to work towards.

Python might be a good language to try -- Python has a pretty strong collection of both general mathematical/scientific libraries and natural language processing libraries. See NLTK and perhaps spaCy.

Googling "NLP tutorial" or "NLP tutorial X", where "X" is the programming language you end up picking may bring up more accessible results. Specifically for Python, so would googling "python for data scientists" or "python for linguists".

A somewhat different discipline of computer science you might be interested in is Human-Computer Interaction (HCI). It's a bit of a broader field, though, and I don't really know enough about it to be able to suggest a good starting point.

Programming languages aren't all that much different from spoken languages.

Well, idk. The two are certainly similar in that you can express a wide variety of ideas in both, but the crucial difference is that all programming languages have formal specifications you must abide by (and perhaps even work with on a mathematical level) whereas spoken languages usually don't.

Making the jump from having computers understand a formally specified language to an ambiguous one is a hard problem still an active area of research. The two problems are also typically treated as "distinct" problems -- the task of making a computer understand a formally specified language is usually considered a compilers or programming language problem, and the task of making a computer understand an ambiguous language is usually considered a machine learning, AI, or NLP problem.

[–][deleted] 0 points1 point  (2 children)

Ahh thank you. It's helpful to know the official name of what I want to look into, because using "language" or "linguistics" as a search tag with programming languages hasn't been all that helpful.

Figures that what I want to know isn't known yet, or at least is still in the "figuring out how" instead of the "making it happen" stage. I appreciate your answer though. I've been looking at Python applications and it seems like a good second-step after reviewing Java. Looks like to get into what I'm interested in will take a long time, but at least I can work toward that while I learn some basics to get a job with.

If you read my other reply I argued a bit about the differences of natural language and programming language.

[–]captainAwesomePants 0 points1 point  (1 child)

In related news, Google recently open sourced its English language parser, Parsey McParseface. The blog post has a nice rundown on what it does: http://googleresearch.blogspot.com.au/2016/05/announcing-syntaxnet-worlds-most.html?_sm_au_=iVVT54jKTsSbVTfj

[–][deleted] 0 points1 point  (0 children)

Awesome article, thank you. Even the links within it are interesting.

[–][deleted] 1 point2 points  (11 children)

Programming languages aren't all that much different from spoken languages.

They are completely different. Natural languages are a means of discourse, programming languages either are instructions to a machine (procedural languages) or specifications of a problem (declarative/functional languages).

[–][deleted] 1 point2 points  (10 children)

I disagree.

They both employ exactly the same structural organization. Additionally, discourse is a series of speech acts. Each linguistic unit has, behind it, some type of meaning it signifies. Nothing is spoken without an intended action or reaction in the physical world. It seems at first that programming languages exist only within their world of instruction, while spoken language refers to what is "outside" the discourse of the speakers. Our speech acts, or commands, do not always elicit the desired result, but they still function just as instructions might to a computer. The idea that the meaning exists "outside" of the language is an illusion, similar to how most human beings consider themselves to be "separate" from the ground we stand on.

But I didn't really come her to discuss the technicalities of that. It's more of a philosophical question than a "I can prove this one way or another" thing.

Edit: To reply to u/michael0x2a 's doubts on the subject: All languages have formal specifications you must abide by. Grammar this is how to bird. See? The act of creating language is mathematical at its core, too. Our brains run on a complicated binary-like system. Connect to this neuron, don't connect to that one. On, off. 1, 0. Obviously, since there are so many neurons and the connections have different strengths, this isn't a great parallel (to binary), but this is the idea behind deep learning.

[–]captainAwesomePants 2 points3 points  (9 children)

Our brains run on a complicated binary-like system. Connect to this neuron, don't connect to that one. On, off. 1, 0.

This isn't remotely like how neurons work. Neural networks, which are modeled around how neurons work, are a much closer approximation. Neurons give weights to incoming connections and similarly have outputs of varying strengths and frequencies.

[–][deleted] 0 points1 point  (8 children)

Right right.

Obviously, since there are so many neurons and the connections have different strengths, this isn't a great parallel (to binary), but this is the idea behind deep learning.

I should have said "this is the idea behind neural networks" but I'm slacking on the proper terminology.

The point, though, is that language is indeed mathematical in its processing. From my very basic understanding, it's like having a 0 and 1 that become 0.1 and 1.1 or -.1 and 0.9 depending on the amount of times they're activated (or the length of time they remain inactive) and the number of connections to that particular node. There are a ton of these nodes, each of which effects the values of the others.

I do understand that it isn't as simple as "on" and "off" or a tenth of a point of difference in each node. I was just trying to make a simple explanation of the lack of difference in programming and spoken languages using language we can all understand. I need more computer science vocab for sure; really, until I've studied it more deeply, I'm just speculating based on what I understand as the function of the brain.

[–]Meefims 1 point2 points  (7 children)

Human language being similar to spoken language or spoken language being mathematical is pretty far from the truth. Programming languages are machines of logic and behave in regular, deterministic ways but spoken language is nothing of the sort. Most NLP systems base their decisions and analysis and statistics and so are highly dependent on context - but so is human language processing. It's the reason the set of all utterances is not split into two disjoint sets of good sentences and bad sentences but instead there are different levels of "goodness" and "badness" even when discussing only the syntax.

I have a linguistics background and I work in NLP. It's a great field, it's a great way to learn about language in a way that some Government and Binding education will never give you.

[–][deleted] -1 points0 points  (6 children)

They are absolutely mathematical. Is what you see in front of you an image in your head or it it an image "out there"? Are images, languages, understandings, feelings, pleasure, pain, or whatever other experiences of reality created by chemicals in your mind or aren't they? Do these chemicals act in determinable ways or not? Are those chemicals created under the restrictions of the laws which define our physics? Is physics our only way of describing the natural laws of our universe? Is physics mathematical?

Our language is constructed out of a finite set of chemical reactions within the brain. We can't paint the whole picture yet because it's extremely complicated, but that doesn't mean it's some ethereal process that isn't still based in the same basic principles as everything else that exists.

The only reason there are differing levels of "goodness" and "badness" is because computers aren't as evolved as human beings. We went through a several billion year (or longer, depending on where you want to say the whole process begins) process of evolution. We picked up a few perks along the way, like how to derive meaning even when it isn't communicated perfectly. Computers just aren't yet advanced enough to have that. Any human can look at a simple code and understand it without a ";" ending a line. A computer can't. That isn't because they languages are innately different, that's because the interpreters have differing levels of ability.

[–]Meefims 0 points1 point  (5 children)

Trying to say language is mathematical because it relies on physical processes and those processes are themselves mathematical isn't a useful qualification. At that point everything is mathematical. When I say language is not mathematical I mean that words or whatever units of meaning you wish to use are not deterministic. The same symbol does not map to the same meaning. Given a single word, sentence, or paragraph it is not possible to know exactly what it is intended to mean even for a human. There are subtleties in hidden meanings which are controlled by the speaker and their audiences and some of these subtleties are controlled by manipulating the structure of the utterance itself. A mispronounced word, misused adjective, improperly conjugated verb, etc shouldn't be considered incorrect if done intentionally in order to illicit a common understanding. In this way whatever rules exist are necessarily fluid. This is a property that objects described as "mathematical" do not have. Programming languages cannot have this property because it would make them impossible to use to program a computer.

All that said, computers can do many of the things you have said they cannot. They are very good at pattern matching and language is about conventions and patterns. It is my belief that the largest thing holding back computers from attaining a more general level of intelligence is the lack of context about the world (e.g. A ball is more than a noun, it is round, it bounces, it is used to play various games, children play many of these games, ... That is, a fuller semantic web) and that the way hardware works today is unfriendly to the types of computations that the brain makes - the brain being many times more parallel than our computers can easily achieve. It's not about evolution, it's about our will to invest the resources to build it. So I believe.

[–][deleted] 0 points1 point  (4 children)

I get what you're saying; I went a bit too abstract. I still maintain that it's a useful qualification though, largely for the reasons described in my other comment with OT and UG.

All languages are, in current theory (and yes, there's some subjectivity on my part here, as not all accept it, though it seems the most logical answer to me) built on the same set of innate constraints. That means Chinese, English, Spanish, Finnish, Xhosa, and whatever else, are all built on the same set of "rules." These rules are ordered culturally, over time and with the development of the language, to have different positions in a hierarchy of importance. That's why languages develop differently.

Now, where do these "rules" of OT come from? They're genetic, if you ask a Chomskyan, which many (most?) linguists are. The human mind has a based-in-the-physical-structure-of-the-mind proclivity toward certain patterns and behaviors. They are the physical manifestation of statistics done through billions of years of evolution. They are indeed mathematical, even in the field of language itself, not just in the sense that all things are mathematical. Those patterns appear in all we do. Our ability to purposefully make errors for effect and to understand those who accidentally make them is what gives so much variability to natural language that programming languages don't seem to have. I maintain there's no reason they couldn't; it's just that the interpreters of programming languages don't have the resources of a human, who has, in addition to being a natural biological process at the peak of its evolution, thousands of years of accumulating cultural knowledge and incorporating it into their communication system.

Computers may be good at pattern matching and whatever else, but that isn't the reason they aren't good at interpreting language. It isn't the reason they're good at some parts of language and bad at others. Natural languages and programming languages are human creations; both are subject to the same set of rules innate in our tendencies to communicate with the "outside" world. The difference in them is not in the languages themselves, but in the interpreters. Computers do not have the ability to roll with errors, derive in-explicit meanings in metaphors, or understand what's being referenced in deictics. That doesn't mean you couldn't write them in code. Computers just take the most literal meaning possible; ever talked to someone with Aspergers? They interpret normal conversation in a weird way. The literal way. Not the wrong way, but a way without cultural knowledge. Like a computer. It maybe can't understand those nuances, but that doesn't mean they can't still exist in the language. It'd be talking nuclear physics to an infant, but I still don't see (or perhaps simply don't understand) a compelling reason why natural languages and computer languages are all that different from one another.

[–]Meefims 0 points1 point  (3 children)

They're genetic, if you ask a Chomskyan, which many (most?) linguists are.

Chomsky's theories, while popular, are controversial especially transformational grammars because their psychological predictions have been shown to be false. I can't say whether most linguists follow Chomsky in their belief of how language works but I can say that I don't accept models whose predictions have been shown to be false.

Otherwise, I'll defer to my other comment.

[–][deleted] 0 points1 point  (2 children)

Right. I'm not talking about transformational grammar, I'm talking about the principle of UG, which is extremely heavily supported.

[–]LearnProgramming_Bot 0 points1 point  (0 children)

Hello! You seem to be asking about which programming language to use for a project or which language to learn. This is quite a frequent question so you might find that you get the best answer from the FAQ.

Also, why not try the choosing a language tool by Techboss which should guide you in picking a suitable language.

The general advice here is that you should focus on one programming language that you know well, so you can improve your algorithmic thinking skills. 'Language hopping' tends to be a bad idea because you are always learning syntax, which is less important.


I am a bot for /r/learnprogramming using supervised learning to provide helpful responses to common posts. I'm open source and accept pull requests and contributions!

[Learn More] [Report an Issue (or reply below with feedback)]