7 ms·
"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 d
by danybittel 2y ago
"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 programming (the simulating in your head). I'd argue that biggest part of programming is organizing and communication.
- jraph 2y agoI disagree. 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. [1] https://en.wikipedia.org/wiki/Language https://en.wikipedia.org/wiki/Language
- danybittel 2y agoWho are you "communicating" with? A programmer does not communicate with a computer, through a PL. 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). 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.
- jraph 2y ago> Who are you "communicating" with? 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)
- danybittel 2y agoEven if you consider it communication, that doesn't make it a language. Plenty if communication happens through other means. 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?).
- carschno 2y agoI suppose the term language in the context of computing is widely accepted because it shares many properties with human language. Hence the common taxonomy in which both natural (human) languages and formal (programming) languages are different types of languages.
- iceburgcrm 2y agoI find removing the organizing and communication layers greater increases your velocity. For each idea we need to communicate to others or ourselves (in a linear language) involves a translating process. Removing the need for that layer leaves you in the coding zone. Once you have to leave for translating it becomes an expensive process for your brain to recreate the verbal / non verbal environments (or takes too much energy to hold both plus the translation path). 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.
- electrondood 2y agoI'm working in a library that was written by someone who no longer works at the company who thought this way. 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.
- iceburgcrm 2y agoI think communication layers are critical as well. On a team they are more important than the coding and that's why you hire someone to lead and organize everything. 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.
- wellbehaved 2y agoYou 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.
- emporas 2y agoThere will be a comeback of literate programming. Tools were not advanced enough for it to be really practical. CS was not mature enough as a field for LP to flourish.
- WillAdams 2y agoAs I noted in a different discussion here: https://news.ycombinator.com/item?id=40474484 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.
- emporas 2y agoI 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, 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. [1]https://github.com/pramatias/documentdf https://github.com/pramatias/documentdf
- samatman 2y agoProgramming languages have a syntax, a semantics, and a more or less formal grammar. They have an alphabet, and morphemes in the form of tokens. They're a notation, yes, but one with a precisely linguistic form. Language is an appropriate word to use here.
- Talinx 2y agoI agree - I think it is pretty clear that there is a difference between programming languages and other languages. Figuring out the differences (instead of getting wrong ideas because they share some similarities) should lead to better words for different kinds of languages. 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...").
- HarHarVeryFunny 2y agoYes, obviously there is some conceptual similarity to written language, but the goals are really quite different. Human language is used to communicate, which involves theory of mind and modelling the listener. Programming language is just specifying a computation to be performed. 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?
- HarHarVeryFunny 2y agoI tried asking both Claude Sonnet and GPT-4 (Bing CoPilot) about this, and they referred to the brain using "selective activation" to only enable language areas for language inputs, but both talked in circles and couldn't explain how this "selective activation" actually works - how does the brain (starting from nothing - no knowledge of written language) start to selectively activate Wernicke's area only for language? Its more understandable how processing gets consolidated there, and suppressed elsewhere, once it gets started!