Missing a new kind of programing

All things Programming
Post Reply
User avatar
RoGeorge
National Metrics Strategist
Posts: 385
Joined: Sat Dec 19, 2020 4:47 am

Missing a new kind of programing

Post by RoGeorge »

As a non-software developer, the type of programing languages looks like this to me, from simple to complex:

- 1. Machine level, where one puts numbers into a machine's memory, then the machine interpret those numbers as instructions or data. Nobody does this any more.

- 2. Assembly level, where one can write text mnemonics to be translated one to one into machine level, by a helping program called assembler. Mnemonics are easier to use than putting numbers in a memory.

- 3. Higher level programming languages, where one can use certain English words as keywords of the given programming language. The keywords are broken down into mnemonics by a compiler interpreted, depending the language.



At this point I'm tempting to split point 3. into
- 3.a. Procedural programming
- 3.b. Object oriented programming
- 3.c. Functional programming (I have never tried this yet)



However, from the perspective of a non software-dev, I do not care at all about programming languages, or programming paradigms, or other things like that. I only care about solving the problem I need to solve, but with the help of a computer. I'll put this as

- 5. Natural language description of how to solve the given problem



To give an example, it's very easy to use level 5, the natural language, and write something like:

Water-meter logger program:
- place a webcam to watch the water-meter under the sink
- at every minute take a snapshot of the water-meter
- use image recognition to identify the numbers captured in each photo
- turn the OCR digits into a number
- attach the timestamp to the reading and log that in a file

In natural language (level 5) it looks trivial, but to convert this into a program (level 3), it's not trivial, in the sense that translating from level 5 to 3 will need a lot of tedious work of handling all the details, and then it will need a lot of programming skills to implement, test and debug it all for a reliable level 3 program. When something is tedious or repetitive, it also means it can be handled in an automated way, by a computer.

There is a need for a level 4 that right now is missing, something to help with the automated translation between the natural language (level 5) and the programming level (level 3).

For now, instead of a level 4 language, we have armies of software devs, but it looks like all this translation from level 5 to 3 should be possible to be done in an automated way, just like the other automated translations between higher and lower levels of detail.

From what I see, there is a current attempt to skip a level 4 "language" entirely by using machine learning. The pitfall about this is ML produces fuzzy results, they need piles of data and in the end they can still mistake too often.



- Are there any other attempts for a language in between the natural language (level 5) and the programming language (level 3)?
- If not, what to use, or how to solve the translation from natural language once and for all (without externalizing the task to somebody else)?
User avatar
antae
Director of Sandbags
Posts: 507
Joined: Sat Dec 19, 2020 8:49 am
Location: Ukraine

Re: Missing a new kind of programing

Post by antae »

Regarding #5 and its limitations,
When I buy something in a supermarket, and when I put the goods onto the stripe, stand at cashier's desk, I talk to a cashier and she ask questions. She does not ask something new or hard to understand, but she repeats my words and re-asks what I said to be sure we understand each other. This is an example of a natural language.

A man is walking through the desert and found Aladdin's lamp.
He rubbed the lamp, and Genie jumped out of there.
The genie says: - "Make a wish!"
Man: I want to go home!
Genie: Let's go!
Man: I want it faster!
Genie: Then let's run!
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
RoGeorge
National Metrics Strategist
Posts: 385
Joined: Sat Dec 19, 2020 4:47 am

Re: Missing a new kind of programing

Post by RoGeorge »

Yes, in a natural language there is A LOT of contextual meaning and tacit asumptions. In a programming language there is almost no contextual meaning. There is something, but very shy, e.g. the variables availability only to certain areas, or the polymorphism from OOP.

Maybe we should invent then a level 4 natural language, as standardized subset of the natural language, a subset to be used with machines only. But that would mean to turn everybody into a dev/programmer. Many won't have the knowledge or the discipline to use such a subset of natural language. And even if everybody will learn that, for now it appears impractical to standardize something like that.

Also, any standard is good for ensuring compatibility, but it also means enforced stagnation.

It would be interesting to count how many meanings are in a wish like "I want to go home", or at least to evaluate the order of magnitude. Might be much lower than we expect, probably not in the billions, not in the millions, I'd expect to be something like 1000 or maybe a 100 meanings at most. Even 100 seems way too much for a human, but for a computer this is peanuts. A computer could easily estimate the outcome of all the possible meanings and prune out at least the very bad ones.

Eventually it might ask for clarifications about what branches of all the possible meanings to keep or trim.
User avatar
antae
Director of Sandbags
Posts: 507
Joined: Sat Dec 19, 2020 8:49 am
Location: Ukraine

Re: Missing a new kind of programing

Post by antae »

I did some research, and I think the seat #4 is for Declarative_programming, which aims to explain what business wants, while imperative approach (#3) explains what actions to do. #5 has to be shifted to #6, because I think something intermediate must be there, I just do not know what.

Some examples are scenarios for Puppet, Chef, Ansible – they're written in a declarative manner. Jenkins pipeline syntax, different kinds of DSL, for example, Jenkins job DSL

Also another thing which comes to my mind is the tests written with Behavior-driven development

Declarative style is very important for business because it require less skills to work with, business can hire more cheaper workers, greater economy. Surely, a few engineers are needed to fulfill #3 so a big audience can work on level #4.

Also a good example is an automatized call center, where the big audience (programmers of #4 level) are customers who say commands to a robot by voice, and only a few programmers (which are employees) write scenarios on underlying layer #3.
My opinion ^_^ may differ from yours. That's OK. Difference makes us humans, not robots.
User avatar
Henry Crunn
Site Admin
Posts: 453
Joined: Fri Dec 18, 2020 2:04 pm
Location: 56N 3W

Re: Missing a new kind of programing

Post by Henry Crunn »

The problem with machines doing anything with natural language is that the users of natural language do not agree on what it means.

I'm an Englishman, from England.
It is not OK, for example, for my chain smoking travelling companion to stand up to get his hand luggage at the end of a 12 hour American Airlines flight and exclaim "I'm dying for a fag". On a BA flight it would have been fine ... maybe.
There are lots of examples like that.

Your level 4 language might be Esperanto but I suspect that there are ambiguities there too.
--
You can't get the wood.
You can't get the 'shiver me timbers' wood' you know.
Tony0945
Bride Kidnapping Expert
Posts: 295
Joined: Tue Mar 23, 2021 9:01 pm

Re: Missing a new kind of programing

Post by Tony0945 »

@Henry Crunn,
back in the '60s a US Air Force captain who had served in the UK told me of his shock when a British girl told him to "knock me up sometime".
User avatar
dont_think_twice
Director of Sandbags
Posts: 670
Joined: Sat Dec 19, 2020 4:15 am

Re: Missing a new kind of programing

Post by dont_think_twice »

RoGeorge wrote: Tue Oct 19, 2021 4:58 pmMaybe we should invent then a level 4 natural language, as standardized subset of the natural language, a subset to be used with machines only.
You mean COBOL?
COBOL statements have an English-like syntax, which was designed to be self-documenting and highly readable. However, it is verbose and uses over 300 reserved words. In contrast with modern, succinct syntax like y = x;, COBOL has a more English-like syntax (in this case, MOVE x TO y).
https://en.wikipedia.org/wiki/COBOL
User avatar
mrbassie
Director of Sandbags
Posts: 649
Joined: Sat Dec 19, 2020 9:29 am

Re: Missing a new kind of programing

Post by mrbassie »

Henry Crunn wrote: Tue Oct 19, 2021 8:02 pm

Your level 4 language might be Esperanto but I suspect that there are ambiguities there too.
“Bonvoro alsendi la pordiston, lausajne estas rano en mia bideo”

The latter part could interpreted as a frenchman has hogged my arse sprinkler.
Foor stairs
Post Reply