Universal Prokee Language
The Universal Prokee Language (UPL) is a programming language based on natural languages and semantic nets.
Contents
Programming in Chinese?
Some inspiration for UPL comes indeed from the Chinese language.
In most languages, written words are representations of their phonetic sequence. The atomic symbols of the written language therefore represent the sounds, which form the words of the language. The amount of different sounds of a human language is very small, so a small alphabet is sufficient to be able to write every word of such a language. The difference to Chinese is, that the defining element of a word of western (or non Chinese) languages, is how it sounds, its phonetic sequence. By knowing all spelling rules one can write and read German or English words without understanding them.
In Chinese the meanings of words are represented by Symbols (Chinese characters) directly, without being required to know a how word is spoken. At the early beginnings of the Chinese language every symbol represented a word and every word was written by a single symbol. And also today most Chinese words consist of only very few (one or two, rarely 4 ore more) characters. The consequence of this is, that a huge "alphabet" is required, and avoiding the introduction of unnecessary symbols is essential.
In German e.g. we have inflection of nouns and verbs. German words come in different forms regarding to cases (nominative, accusative, genitive and dative), genders (masculine, feminine and neuter), number (singular or plural), conjugation classes, persons (first second and third), moods (infinitive, indicative, imperative and subjunctive), voices (active and passive), tenses and so on. All those different forms are essential for German.
In Chinese, we have only one character representing a word (or a few characters for compound words). So the information carried by all the different forms of words as we have them in German, have to be encoded in a different way. This is done by replacing inflection with word order.
When we look at computer languages, we normally do not have inflection of keywords, but we do have a fixed word order to build valid sentences. Therefore, when we want to develop a programming language, which is more like human languages, Chinese would be a promising language to start with.
Semantic Nets
A semantic net is a representation of words (or objects, or classes of objects) and the relationships between those words.
Has-A Relationship
The has-a relationship between two objects (or words) describes ownership. F.e. a car has-a steering wheel.
The has-a relationship is the default relationship between consecutive words. The sentence "A car has a steering wheel." translates into UPL as shown below.
Car SteeringWheel
If we refer to the steering wheel, the statement above may also be interpreted as "the steering wheel of the car" or "a steering wheel of a car". See #Paths and Queries on how to refer explicitly to a specific item.
Is-A Relationship
The is-a relationship between two objects (or words) describes inheritance. F.e. a car is-a vehicle.
The default is-a operator is the colon ':'. The sentence "A car is a vehicle." translates into UPL a shown below.
Car:Vehicle
Multiple inheritance can be established by stating all superclasses concatenated by a comma ','.
F.e.
C:Letter,ProgrammingLanguage,RomanNumeral
would be interpreted as: 'C' is a letter, a programming language and a roman numeral.
Other Relationships
Other relationships can be established by a concatenation of has-a and is-a relationships.