3 ms·
Natural language is imprecise and vague. And it is relying on a lot of your experience. However, this is why natural language is so much more effective than the
by hzhou321 12y ago
Natural language is imprecise and vague. And it is relying on a lot of your experience. However, this is why natural language is so much more effective than the programming language counterpart -- it leverages on people's experience, or I would refer as context.
The idea is to differentiate the two layers of programming. The top layer is the syntax layer, and it should follow the path of natural language which takes in human context (the human interface). The lower layer is the rigorous part (but still human readable), mostly context free and emphasizes the machine (optimization) interface.
Just like we get the daily work done, we use the top layer to express and think, then verify at the lower layer.
Forth is a great language, totally fits the concept. But the article is trying to show that we can program in any language with vocabulary leading style (with the help of meta-layer perhaps) in which you do not lose any benefits of language (if you consider them benefits).
- 4ydx 12y agoHow precisely do you expect to be able to map from something imprecise to something precise? The idea of giving the author complete control over the higher level terms they use sounds like a nightmare in the making honestly :) Being able to understand somebody elses code requires that it be written in a way that is at least familiar in terms of syntax. To say that natural language is "effective" does not, honestly, ring a bell with me. I guess we think about effective on totally different terms. Math is effective. Spoken language is not in my opinion. On a general level this sounds more like somebody feeling frustrated that the computer didn't "understand them".
- hzhou321 12y agoHow do you map from something imprecise to something precise in daily life? For example, you tell the kids "go to school", very vague (walk or bus or wait for you to drive), and each detailed steps require even detailed actions (composability). So how did you reach the efficiency with only "go to school"? First of all, we have mechanisms to establish conventions -- which is the user maintainable dictionary I was referring to. Second, we have direct feed back -- if the kids didn't move or the school called, we know something went wrong, (then we strengthen or correct the conventions). In the two layer programming structure, both layers are within programmer's access. Programmer try to work at the top layer as we do in our daily life, but we will get signals from lower level compiler, and we can verify the lower level code directly (which is as readable as what you do today -- you are only working at the lower level language today). It is not one or the other, that is how we manage the daily efficiency. Are you a mathematician? How much math do you speak anyway? Even my fellow mathematician convey most of the mathematical meaning in English. Can you imagine mathematicians only write in math (as today's programmer do)? Theorem, at least from the math books on my shelf, are mostly composed in English (more words than math). And even in pure math equations, we make up new symbols (with special meanings under special context, not just operators, what do you think the concept of algebra is) all the time, which is along the same line of vocabulary based programming. If you think I am saying that math can work with English only, then you misunderstood me.
- 4ydx 12y agoOf course math works across all languages and I didn't think you were implying that, but using a word in a mathematical context carries a lot of precision with it. It isn't simply a layman's usage. The words don't make the description work, but the math behind it does. This applies to programming languages as well.
- scotty79 12y ago> Natural language is imprecise and vague. And it is relying on a lot of your experience. Yes. That's because if you need to be precise you remove yourself farther and farther from natural language towards professional jargon where words have more specified meanings and towards math and computer languages that you can call precise. > The top layer is the syntax layer, and it should follow the path of natural language which takes in human context (the human interface). It would be nice to keep at least some part familiar but more often than not you can't because some 'top layer' constructs you need to express have very cumbersome expression, if any, in natural language. For example natural languages lacks constructs for deep composability or indirection. Natural language is perfectly fine in daily work, like deciding what's for dinner, but trying to explain any non-trivial concept with natural language quickly becomes too cumbersome and person trying to convey the message moves onto more expressive and precise tools like math or drawings or pseudocode. Please look at how theorems and proofs looked before invention of math symbolism. That's natural language stretched to extremes. Also please read any modern code of law. That's what we get when people go out of their way to express concepts in natural language instead of creating some explicit domain symbolism. I'll take math or even cobol any day instead of that.