by danybittel · 2y ago · 0 comments
> 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 programming (the simulating in your head). I'd argue that biggest part of programming is organizing and communication.
Wikipedia's definition [1] is what I had in mind for language:
> Language is a structured system of communication that consists of grammar and vocabulary
Programming languages are structured, have grammars (often described formally using a grammar definition for some parser generator) and vocabulary (the set of functions and types you can use, possibly modules and package, basically), and they are used to communicate (with the machines, and with fellow developers).
The "file format specification" would be a (subset of) the specification of the language, not the language itself, and yes, a file format specification can describe a language (but I believe we only say this for stuff intended to be read and written by a human - so ZIP would not be a language, but HTML would be).
I do agree that programming languages and human languages are not the same thing, they have different characteristics, traits, use cases, behavior… and that's why this study compares them. And that's also why we need to make the distinction. And they also have common stuff, hence the same word. But even if you disagree that they have a relevant amount of common stuff, polysemy is a thing, so it's still "fine" to call English a language and C a language. Quotes around fine because I'm actually only describing what happens: we do call them both "language", that's a fact.
> I'd argue that biggest part of programming is
It might be, but the paper studies and focuses on programming languages, not the more general practice of programming (which is worth studying, but studies always have a (restricted) scope).
> remember the literate programming movement
Where's the confusion in / what's wrong this? Some think that it's better to narrate in code and we call that literate programming. I don't share the vision, but everything looks clear to me.
Also, the vocabulary works very different, in a PL almost all of the vocabulary is defined "at hoc", as you go.
I mean I don't have a problem calling them a language, people should just be vary not to use language ideas for PL.
I wrote this: "with the machines, and with fellow developers"
> A programmer does not communicate with a computer, through a PL
I disagree with this. The programmer describes the steps that the computer needs to perform, to the computer. Or the programmer describes the state which the computer should reach.
The communication is one way (except, arguably, during debugging sessions), but a communication does not need to be two ways.
> He or she writes it down, to later be executed or interpreted, so the computer can "communicate" with the user, through the User interface (not the PL).
You seem to set yourself in the end user perspective, but the developer is also a human, and I'm in the developer's perspective here.
> people should just be vary not to use language ideas for PL.
Agreed, some / many ideas applying to natural languages don't apply to programming languages. But some do.
> the vocabulary works very different
Absolutely. There are strong differences.
(of course, it's fine we don't agree, we are arguing on definitions)
If we look at the debug session or bash scripting, the closest thing of a two way communication. It doesn't "answer" in code.
I see code closer to something like a Floor Plan an architect may use or a CAD drawing from an engineer. Both of them also communicate, but they are not considered languages. They also have a rules (grammer?) and patterns (vocabulary?).
(s/vary/wary/, I suspect.)
Why not? I thought of crafting a system as telling a story about what the system was going to do, whether or not it involved an interaction with users. The syntax and structure is extremely precise compared to literature, but if it doesn't tell the story clearly, it's less likely to be a successful effort, both in use and for maintainers.
The mediocre ones write their code for the computer/compiler/interpreter. When it works, they're done.
The good ones write their code for human readers to understand, including their future self.
I have a theory that burnout is more common when you keep shifting mental states. Developers who have a phone that keeps ringing throughout the day (or slack messages or urgent emails) are burned out at the end of the day more often than those allowed to be in one state.
It's an absolute nightmare to understand. He may have been in the "coding zone," but he chose variable names that make no sense, abstractions that don't map on to any actual entities, and left no coherent documentation.
I think the organization and communication layers are absolutely critical, and any apparent velocity tradeoff is just accumulating technical debt, because there's probably an entire team who is perpetually on the hook for supporting what you wrote, and actual long-term velocity over time depends on their ability to understand it.
Removing the large team removes those layers and it's why a two person team can do the work of 12.
Adding in documentation, training materials and providing support can happen at the end of the development cycle freeing you to support the project 100%.
It's not that you remove communication or documentation but do it at select intervals. Don't do a full scan of a table everytime you need a value found in the index.
Still, it's interesting to consider why the "language areas" of the brain apparently are not used for reading or writing computer language (or for other different types of mental activity for that matter).
Some processing areas of the brain are obviously dictated by connectivity and adjacency (visual pathway connects to visual cortex, auditory pathways connect to auditory cortex), but reading of both prose and computer code comes in visually, so why does one get processed by Wernicke's area, and one not?! The best I can guess is that multiple areas of association cortex might be competing to recognize/predict visual inputs, and those areas best equipped to do so will win and perhaps suppress the others.
If this suggestion is true - that via competition the best suited area of brain gets used, then it begs the question what are the key differences, pertinent to the brain, between written prose and computer code that cause this differentiated processing?
Maybe "Spoken languages" is a better term for languages like English? I find speaking computer code out loud just doesn't work except for some particular lines of code. "At dataclass class QueueItem magnitude colon int equals one..." is really not clear, if I have to communicate such code in words I wouldn't read it directly and instead describe it, e. g. "QueueItem is a dataclass with the attributes...").
They're a notation, yes, but one with a precisely linguistic form. Language is an appropriate word to use 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 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, but i see no reason why not read the code directly in org-mode. It is better actually.
2) A good programming language with types. That's Rust and it was created in 2015.
3) LLM's to automatically generate descriptions of code. Type annotations are one of the most important hints for LLM's to generate accurate descriptions. Untyped or weakly typed code, like, Emacs Lisp, Python etc, does not help LLM's to be as good as possible.
4) A good LLM which is accurate enough, plus cheap enough and fast. That's Llama3-8b on Groq, in which they provide very fast access to Llama3.
I am currently researching how i can take a Rust project 100000 lines, and transform it to a Literate Programming org document. I have created a small program to cut Rust source code to chunks in an intelligent way [1]. Now i am trying to figure out, how to provide structure to the LLM, by extracting type signatures with rustdoc and feed it as context to the LLM with each query.
It will take some months before i have something good, but based on my calculations, an 100000 line program will be transformed to a giant org literate programming document, in an hour, costing close to, 50 cents.
Point being that LP will make a comeback, it's gonna be quick and it's gonna be cheap.
What do you mean? Formalisms to study languages (natural or programming) are tools.