Quote:
Originally Posted by yash101
BASIC is a very good language. As a matter of fact, I do most of my programming in either C or VBASIC! It is nearly plain English! However, it is hard to write long programs in BASIC without making it too confusing.
The revolutionary language would be when:
To drive a motor:
change [motor name] speed to [high/8 bit integer]
To turn on an LED:
turn on [led name]
To do a complex calculation:
[variable name] equals the (square root of 64 plus 8) divided by two
You probably get the gist of it. Preserve all grammar and make it so that pseudocode is the actual code  . That would be the end of programming language development, especially when we get it to run directly on the processor hardware like assembler!
|
Interesting because I wrote a language just like that using the Propeller.
I pointed it out elsewhere.
The idea being that you'd put say: the drive train on one Propeller, the end-effector on another Propeller, some important autonomous systems on a 3rd Propeller.
Then send instructions to say the drive train like:
"Move the front right wheel 2 revolutions."
How does it work?
The string processing knows to expect strings like:
"Move the X wheel Y Z."
The string matching is a bit fuzzy to allow for some minor errors.
So X could be the words: front right, front left, rear right, read left.
Y is the magnitude.
Z are the words: RPM or revolutions (case insensitive).
If you think about this it is now really simple to understand natural language in the exact same way that old instruction based games would do so.
Parse down the natural language to get the relevant details and call the necessary code. That's it.
You can now talk in your natural language of choice to the robot parts.
This works really well on the Parallax Propeller because the Cogs all run separately so a Cog can parse strings at the input and send only the relevant instructions to the Hub shared memory to act upon. So whole strings become simple short numeric variables in the Hub shared memory.
Does this mean the language runs at the same level as assembler?
Not at all and unless you embed a natural language processing system into the hardware it won't. Though with an FPGA this is obviously quite possible and it could still be programmed like microcode. Even the Propeller doesn't have the hardware for this because it is a niche case of design.
There is a high degree of similarity here between voice recognition and some of the algorithms needed for natural language processing.
As a result of using a library to perform floating point calculations on the 1st generation Propeller in effect I am already performing your mathematical calculation as well. It parses the string with the equation, calls the relevant functions in the proper order of operations. When I was in high school I could not see the sense in buying a TI-82 which at the time was very expensive. I already had a Zenith 8086 laptop from my family business work and it was worth thousands with a CGA style display. So I wrote in BASIC a graphing calculator. The teachers did not appreciate that it could show you the work as it worked. Later in college I wrote a program on the TI-85 to do Fourier transforms that could also show the work because at the time only much more expensive HP calculators had the built-in software. It was quite interesting to work with the teacher to address some of the issues in the program logic. I actually think I retained more about the math like that than by doing it by hand.
To put this in historical context I used a programming language called RCL (Robot Control Language) in Mount Olive High School on an RB5X robot. It was a Forth based language that used the structure of the Forth language to create natural language processing for the robot. For example if you had a working arm: "Move elbow 5 degrees". Would move the elbow 5 degrees. How it did that depended on how it was setup. Maybe it had actual feedback or maybe not. So that's a language back from the late 70s and 1980s that could do this. I have an RB5X robot in my garage I am in the process of parting back together with the arm.
In the end though natural language processing is an abstraction. In the same way LabView is an abstraction. You still need to learn how to structure the code or no matter how simple the dialect you won't get the results you expect.