Python is a high-level programing language. This means that it's closer to human language and further from machine language. The advantage of this is that it's easy to read and simple to implement.
A language cannot be closed-source. Its compiler and run-time libraries can be closed-source. A formal grammar of a language can be kept as a secret though and be legally protected (NDAs, etc.) and fees collected for usage.
Source code refers to a computer program written in a high level (human readable) language such as C, C++, Java which use English – like statements. It is converted into object code (or machine code) by a computer.
Machine-specific assembly language in the 1940s was probably the first (vaguely) human-readable programming language, but by the 1950s computer engineers realized that assembly language was far too laborious and error-prone to build entire systems out of — and thus in 1955 the first modern programming language was born ...
How about LOLCODE?
HAI
CAN HAS STDIO?
VISIBLE "HAI WORLD!"
KTHXBYE
Simplicity itself!
COBOL is a lot like that.
SET MYVAR TO 10.
EXECUTE MYMETHOD with 10, MYVAR.
Another sample from Wikipedia:
ADD YEARS TO AGE.
MULTIPLY PRICE BY QUANTITY GIVING COST.
SUBTRACT DISCOUNT FROM COST GIVING FINAL-COST.
Oddly enough though, despite its design to be readable as English, most programmers completely undermined this with bizarre naming conventions:
SET VAR_00_MYVAR_PIC99 TO 10.
EXECUTE PROC_10_MYMETHOD with 10, VAR_00_MYVAR_PIC99.
Inform 7
Inform 7 is perhaps the language I feel is most appropriately designed in a human language fashion. It is quite application specific for writing adventure games.
It is based on rule-based semantics, where you write a lot of rules describing the relationship between objects and their location. For instance, the section below is an Inform 7 program:
"Hello Deductible" by "I.F. Author"
The story headline is "An Interactive Example".
The Living Room is a room. "A comfortably furnished living room."
The Kitchen is north of the Living Room.
The Front Door is south of the Living Room.
The Front Door is a door. The Front Door is closed and locked.
The insurance salesman is a man in the Living Room. The description is "An insurance salesman in a tacky polyester suit. He seems eager to speak to you." Understand "man" as the insurance salesman.
A briefcase is carried by the insurance salesman. The description is "A slightly worn, black briefcase." Understand "case" as the briefcase.
The insurance paperwork is in the briefcase. The description is "Page after page of small legalese." Understand "papers" or "documents" or "forms" as the paperwork.
Instead of listening to the insurance salesman:
say "The salesman bores you with a discussion of life insurance policies. From his briefcase he pulls some paperwork which he hands to you.";
move the insurance paperwork to the player.
Example cited from Wikipedia
AppleScript is pretty close to that, though that is obviously platform dependent.
Here's a script for opening iTunes and playing a playlist
tell application "iTunes"
activate
play playlist "Party Shuffle"
end tell
Source: AppleScript Examples
Projects promoting programming in "natural language" are intrinsically doomed to fail.
-- Edsger W.Dijkstra, How do we tell truths that might hurt?
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With