Live data from Hacker News

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

news.mit.edu

201–210 of 212 posts

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

#201

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

Reading code and not running it is like reading a Spanish text but not knowing Spanish. Running it is equivalent to comprehension.

> Running it is equivalent to comprehension.

Interpreters run your code, but they don't 'understand' it any better than compilers, which don't run your code.

In a sense, compilers typically 'understand' your code better, allowing them to do more optimisations.

(The boundaries in practice are more blurry.)

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

#202

The paper wasn't linked as far as I can tell but is probably https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7738192/pdf/eli... > While the programmers lay in a functional magnetic resonance (fMRI) scanner, the researchers showed them snippets of code and asked them to predict what action the code would produce I have a suspicion that writing code and understanding that written by someone else are different skill sets.

Lots of people doubting this, and saying running === comprehension.

Here's an exercise for you: how much did Bill spend at the grocery store?

Bill and Tom went to the show store, and Bill bought a black pair of shoes for 23.56. Tom got a pair of red shoes for 40.30. Then they went to the grocery store, and Tom bought a loaf of bread for 3.50 and a gallon of milk for 5.99. Bill also bought a loaf of bread but didn't get any milk.

Anyone can tell that answering that specific question uses a different part of the brain than answering "what did tom and Bill do?"

And further uses a completely different part than: "modify the story to add a barbershop visit for Bill after the shoe store" which will require parsing the grammar to inject an extra story and keep things consistent.

Big picture !== Small details !== Writing !== Editing existing

The study feels incomplete if the four types of understanding are not being equivalently asked for both a story and the code.

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

#203

Earlier quoted context omitted.

As I noted in a different discussion here: https://news.ycombinator.com/item?id=40474484 it makes it possible for me to cope with projects which require multiple files or which exceed a certain threshold of lines/complexity. >With LP, I can quickly look through a PDF, using hyper-linked ToC or index, and control/command click at a point and then have the editor open at that point.

I was not referring to TeX and PDF files. Donald Knuth is the creator of Literate Programming and Tex, but I personally consider this toolchain to belong to the stone age right now. I was referring to: 1) Org mode and Emacs. LP was introduced as a concept in 1984, and org-mode was created 2007 or close to that. 20+ years later till we finally got a good formatting option for text + code. One can export to PDF or HTML…

It is somewhat ironic that that GitHub link has no visible documentation when one first opens it.

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

#204
These MRI machines generate a rather strong magnetic field 3-5 T. Even if it is a minimal 0.5 T, natural Earth's magnetic field is much smaller ~5 × 10^(-5) T. Thus for ecological validity they should have checked that MRI MF really does not interfere with the measured brain function.

It can be somewhat ok to solve HackerRank type problems for 30 minutes in such MRI generated field. IRL programming sessions can take up to several hours. And let's see what quality of code would be produced or interpreted for hours in an MF 10000< times stronger than natural. Thus 80% of such neuroscience is non-scalable fragile bs.

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

#205
When I write code, I'm concerned about two things: - it does what I want - it's easy for others to understand it

If I'm doing red green refactor, the red and green phases are all about logic and constraints, but the refactor step is all about communication - I focus on making the code easy to read for others.

But if I'm reading code, I just want to know what it does.

Só, I didn't make a study, but I'd argue that writing code is more similar to writing natural language than reading code is to reading natural language.

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

#206
post #191

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!

> 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" If it ever comes to that, it should be close to pair programming with AI and it should allow a mix of AI generated and human written code. Like unsafe in Rust, we should be able to say "I know what I'm doing here, stay out of my way". Then let AI verify human written…

Pair programming, in my case, mostly degenerates into "no, wait, don't, how about, what if, hm, if you click on the, on the, button there, no not there, left left left, the third from- yeah that one, ah right, thanks for guessing what I meant". (obviously not always, but the language center of my brain is obviously not well connected to the programming center, and I have noticed similar behavior from several other programmers).

Let's hope the results are somewhat better than previous attempt ala COBOL.

Regarding verification, in my opinion the foundation for current LLMs is, similar to humans, not far from total hallucinations. I am not sure if actual verification is really possible in that direction. At most "well, 99% of the others have been doing it that way for the past ten years".

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

#207

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!

That's why Elon is building Neuralink. Then you can condense the 8hr conversation into 8 minutes of thinking :)

What is this "thinking" people keep mentioning?

What will people do during the remaining 7.9h?

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

#208
post #157
post #156

Earlier quoted context omitted.

Yeah: to me, it really depends on the story being told, and frankly even then it might depend a bit on the proclivities and interests of the person reading the story. The one thing I'd say almost never works for reading code, though, is the thing people seem to insist is best practice: scattering everything into a hundred separate files with no clear order at all! Trying to understand that code is like sitting down t…

That's part of why Knuth came up with Literate Programming: he wanted to be able to present the reader of his code with a coherent order that makes sense to understand the project. Given the strict formal requirements on order of languages like Pascal, Knuth had to come up with a clever preprocessing scheme to satisfy both the reader and the compiler. (See his tool, https://en.wikipedia.org/wiki/Web_(programming_syst…

You know, it's funny on grep: back 25 years ago, I used to spend a lot of time with my IDE and made sure it supported jumping to definitions and such, but I went in the opposite direction... when I sit down at your code base I want to be able to find what I'm looking for without figuring out how to get the perfect code explorer working first (and, frankly, I don't think that the usual implementations of "jump to definition" would handle a project file that contain multiple copies of the function and a ton of conditional build includes anyway). Do you have a recommendation? The #1 issue I run into is with Google projects that use Bazel, so it would have to support that...

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

#209

Earlier quoted context omitted.

I was not referring to TeX and PDF files. Donald Knuth is the creator of Literate Programming and Tex, but I personally consider this toolchain to belong to the stone age right now. I was referring to: 1) Org mode and Emacs. LP was introduced as a concept in 1984, and org-mode was created 2007 or close to that. 20+ years later till we finally got a good formatting option for text + code. One can export to PDF or HTML…

It is somewhat ironic that that GitHub link has no visible documentation when one first opens it.

The project is stalled, because at some point after i developed it, the project langchain-rust appeared and gained traction. My project is not very advanced compared to langchain, i used regexes while langchain uses tree-sitter.

Langchain-rust for the moment supports only 6 languages, and not even one lisp, like Elisp, but it's tree-sitter integration means it can be extended easily to many many other languages. Also it doesn't support Groq for the moment just OpenAi, Claude and Ollama.

We are getting to Literate Programming being very practical, we are not there just yet, but it's coming soon.

I am researching also how to anticipate in changes in the code, by retrieving git logs, and invalidate some description of the code, which may have fallen behind. There are several wrinkles that need some work.

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

#210

Earlier quoted context omitted.

It is somewhat ironic that that GitHub link has no visible documentation when one first opens it.

The project is stalled, because at some point after i developed it, the project langchain-rust appeared and gained traction. My project is not very advanced compared to langchain, i used regexes while langchain uses tree-sitter. Langchain-rust for the moment supports only 6 languages, and not even one lisp, like Elisp, but it's tree-sitter integration means it can be extended easily to many many other languages. Also…

Interesting! Thanks for the explanation.

My needs/usages are far more prosaic, and I am barely a programmer, so the basic .dtx and package which makes documented .tex amenable to use with other languages and a couple of decent plain text editors is working for me.

I'd love for there to be broader support --- I considered quarto and it seemed quite promising, and I wish that LyX had a mode specifically for this, and for a while I was so desperate I was actually considering using GitBook's file inclusion feature, having all the code in discrete little files, and maintaining a series of batch files to concatenate them into working versions.

Alternately, I've been curious if there is some sort of intersection between Literate Programming and Visual Programming ---

>What does an algorithm look like?

Post reply on HN