Live data from Hacker News

To the brain, reading computer code is not the same as reading language (2020)

news.mit.edu

181–190 of 212 posts

Re: To the brain, reading computer code is not the same as reading language (2020)

#184
This is exactly why I dread the future when people say "oh you will be able to tell the AI what to do, in normal language, and it will do it for you". I do not want to have 8h of "normal" text or speech conversations each and every day. It sounds exhausting. 8h of dealing with programming languages, though, that's fun!

Re: To the brain, reading computer code is not the same as reading language (2020)

#185

Earlier quoted context omitted.

There's quite some things that seem to only/best be expressed as code or mathematical formulas, rather than as natural language. (things like cellular automata come to mind)

Granted, but what about this would suggest that code or math should necessarily activate the language center?

It suggests that the language center may not be sufficient for all forms of understanding. I guess there's a reason why we have the rest of our brains as well!

(Possibly the above might seem too glib at first. So, reasoning further...: )

But this is confusing, since natural language should -by necessity- also be Turing complete and thus be able to express anything expressible in the known universe. https://en.wikipedia.org/wiki/Turing_completeness

Would that mean that some form of Sapir-Whorf would apply, where in the case of some languages, a completely different part of the brain is activated even? https://en.wikipedia.org/wiki/Linguistic_relativity .

I think -intuitively- the best way to see it is some amalgamation of weak-form Sapir-Whorf and Turing equivalence should apply: Not all data structures are equally good at expressing the same things: Some are better than others, depending on the domain.

Re: To the brain, reading computer code is not the same as reading language (2020)

#186
post #176

Earlier quoted context omitted.

You can see the vocabulary and the rules of a language as a specification (for the set of productions of the language) if you wish. A language is a specification (although the reverse might not be true). Visual programming certainly deals with a (visual) programming language, which is still a language. A language doesn't need to be textual. It only needs grammar rules and vocabulary. For instance, taking the example…

Interesting! You seem take "language" really far / different. How about something like editing an image in Photoshop? There's a vocabulary (the commands) they get applied to the image. There are also rules (constraints). One could argue using photoshop is communicating with a computer, what to do with an image. So while I say language is a misnomer for PL, you say it's a misnomer for natural languages. ;-)

I guess you could argue for it. Command resize can only be applied after something is selected, and not deselected in the meantime. You might be able to describe the Picture Manipulation Commands language using a finite automaton, and if not, using a grammar.

My views on this are highly shaped by my university lessons on formal languages [1], which I also taught a bit teeny bit. You would have text in mind, but the mathematical concepts are actually more generic than this. One of the exercises was modeling a PIN electronic door lock with a finite state machine (how to unlock without unlocking too early?).

These formalisms look like computer science stuff but are actually directly taken from Chomsky's work [2], a (bio)linguist who was/is actually concerned with human languages (which another commenter implicitly mentioned [3])

I guess this stuff is probably valuable to study natural languages, given the correct scope, since it was made for it (xD). It sure is useful in computer science in any case.

One direct result of his work is the (in)famous stack overflow "You can't parse HTML with a regex" post [4] (since regexes can only define regular languages, and HTML is not a regular language - although I believe the answer is a bit wrong, you can find a regex to parse the regular subset asked in the question, though you need to watch for cdata sections (in XHTML) and script and style tags (in HTML), at which point maybe just use a proper HTML parser unless you are dealing with well known content with no such exceptions)

[1] https://en.wikipedia.org/wiki/Formal_language

[2] https://en.wikipedia.org/wiki/Linguistics_of_Noam_Chomsky

[3] https://news.ycombinator.com/item?id=40480913#40483454

[4] https://stackoverflow.com/questions/1732348/regex-match-open...

Re: To the brain, reading computer code is not the same as reading language (2020)

#187

"Language" in the context of PL is a misnomer. People even scientist seem to fall into that trap (remember the literate programming movement). PL's are better described as "Specifications". More similar to file format specifications, later converted to executables or interpreted. > the researchers showed them snippets of code and asked them to predict what action the code would produce. That is only (a small) part of…

You are correct, it's more properly thought of as a specification. However it's a bit more than a misnomer, it's a kind of religion or cult with roots going back decades.

> However it's a bit more than a misnomer, it's a kind of religion or cult with roots going back decades.

What do you mean? Formalisms to study languages (natural or programming) are tools.

Re: To the brain, reading computer code is not the same as reading language (2020)

#188

Earlier quoted context omitted.

Perhaps reading code activates the same arras as reading prose in English, but running code in your head activates other areas

If you read code and don't think about what it's doing, are you really "reading" it? Reading code without running it in your head feels like reading prose without actually comprehending it.

You can read (scan) code to get the general gist of it. It's more at the level of "this code looks at the pathname, then some cookies, and then either calls the signin function or returns True". That's about the same level where I read most prose. It's enough to answer the question "what does this do" (answer: "calls signin if you aren't logged in but should be") or "how complex is this" but not enough to modify the code or understand the intricacies of it.

What you are referring to is simulating the execution in my head to figure out which execution flows exist, figuring out which cases aren't covered, what the function calls actually do, what the significance of those cookies is, etc. That's similar to how I read contracts. But unless I have to write a literary analysis or somebody asks me to find all the plotholes and inconsistencies I don't read normal prose that way.

It might be interesting if there are similarities between programmers tracing execution flows, lawyers reading an unfamiliar contract, and editors finding inconsistencies in short novels.

Re: To the brain, reading computer code is not the same as reading language (2020)

#189
I could have told them this decades ago. I get migraines with an aura that starts in the middle of my vision and spreads to one quadrant. Years ago they were more commonly in the top right quadrant than they are now. With those, the chances were high that I'd get the symptoms of aphasia too. For about 20 minutes, I couldn't form a sentence or understand one. However, if I was working on embedded C, I could read, write and debug code without any issue. The comments, however, might as well have been in Greek.

Re: To the brain, reading computer code is not the same as reading language (2020)

#190

Earlier quoted context omitted.

If you read code and don't think about what it's doing, are you really "reading" it? Reading code without running it in your head feels like reading prose without actually comprehending it.

You can read (scan) code to get the general gist of it. It's more at the level of "this code looks at the pathname, then some cookies, and then either calls the signin function or returns True". That's about the same level where I read most prose. It's enough to answer the question "what does this do" (answer: "calls signin if you aren't logged in but should be") or "how complex is this" but not enough to modify the…

But what participants in this study were actually asked to do is:

> predict what action the code would produce

So "this code looks at the pathname, then some cookies, and then either calls the signin function or returns True" seems to align with that.

Post reply on HN