Hacker News new | past | comments | ask | show | jobs | submit login
Wenyan-lang: Classical Chinese Programming Language (ieee.org)
184 points by yread on Feb 1, 2020 | hide | past | favorite | 128 comments



The syntax is slightly cumbersome. For example, the function header of the mandelbrot snippet at https://wenyan-snippets.netlify.com/ reads:

吾有一術。名之曰「曼德博」。欲行是術。必先得二數。曰「寬」。曰「高」。乃行是術曰。

Decomposed:

吾有一術。I have a function.

名之曰「曼德博」。 Named "mandelbrot".

欲行是術。必先得 Who wants to run this function, must first get

二數。two numbers.

曰「寬」。Called "width".

曰「高」。Called "height"

乃行是術曰。 Then run this function as follows:

Essentially, what gets expressed using punctuation in mainstream programming languages is instead described by a short sentence. This would be terribly verbose in English, but it's kind of bearable in Classical Chinese, because each word is only a single character.


> Essentially, what gets expressed using punctuation in mainstream programming languages is instead described by a short sentence.

It's not too different from what you'd find in a mathematical proof, or even in actual descriptions of algorithms from old mathematical texts. In that context, usually "word" descriptions are appropriate at the highest structural level of a proof or algorithm, while symbols are handy for the most detailed steps. Of course, this is a claim about what humans are comfortable with; a compiler can deal with any formalized text, whether textual or symbolic.


It is terribly verbose in Chinese too. It is verbose because it's straight-up copying the style of ancient books talking about formulas for magic, without trying to optimize for ease of use. A less verbose (but still mostly gramatially correct) version might be like this:

有術曰「曼德博」。先得數曰「寬」,曰「高」。乃行是術曰。


It's more "art" than practical, but that's fine, I find it fun to read!

The equivalent in English is like if someone wrote a programming language with Shakespearean english syntax and keywords:

    I have a function, thou named "mandelbrot".
etc =)


http://shakespearelang.sourceforge.net/report/shakespeare/sh...

Arguably a bit more subtle than your sample code.


Very impressive, in that it is not mere transcription of terms used by Shakespeare into keywords, but it organizes the whole program as a drama.


That is way better than I thought it would be from other esolangs I've seen.


There's certainly a lot of dross out there that's just search & replace glosses of some other language or a respelling of Brainfuck, but there are some gems out there. Search for "piet language" for another example of something genuinely interesting.


Nice. Is there a longer Hello World anywhere?


Your description reminds me of Cobol.


It is a lot like COBOL, but oddly with more punctuation (probably because of the lack of consistent use of whitespace in Chinese). I think it may be a fun way to practice my 漢字.


The punctuation seems extraneous to me. They all come either before or after keywords so they don't seem to be needed to parse the script. IIRC it's very similar to actual Classical Chinese, which relied on words like 曰、乃、也 to indicate when a clause or sentence starts or ends. IIRC typically the punctuation was added as a part of the excercise of reading.[0]

[0] https://zh.m.wikipedia.org/zh-hant/%E5%8F%A5%E8%AE%80


Imperial Chinese COBOL is very natural sounding concept. That's for sure civil service exam material right there.


not sure if serious but this sounds like trying to learn english via python syntax


I learned English words like while, for and next from qbasic, for real (it had good help in your local language)


Ok but that is three words, what about the rest? Leaning three words is somewhat far removed from leaning a language. (Btw: I can’t grok your final statement in the parenthesis — it doesn’t make sense in English, what were you trying to say?)


It made sense to me: qbasic had good localized help.


It made sense to me as well but I can see how I got there and how I shamed the meaning of the sentence without thinking

> I learned English words like while, for and next from qbasic, for real (it had good help in your local language)

I replaced the word your with the word my in my head without conscious effort. I don't know if it is correct but it is kind of what I expected as I skimmed through the sentence.

There was an article or something saying when we read we can read fast because we don't read every word but rather try to auto complete as we go.


Oh right I see, yes it does make sense you’re right. I was really struggling with that last night, cheers.


The rest will come in when reading technical docs for libraries, APIs and such.


It's more like learning American English spelling from the names of DOM methods and interfaces.


Or Shakespeare English or Latin. The Classical Chinese is hard for chinese even. They are crazy. And said it is like cobol. Bye.


> I think it may be a fun way to practice my 漢字.

Bear in mind that this is Classical Chinese, not modern Mandarin. For example, as you can see in the helpful gloss a couple levels up, 是 in Classical Chinese is the demonstrative "this". (Whereas in modern Mandarin, 是 is the copula "to be [equating two nouns]", and "this" is 这 or perhaps 本.)


I'm familiar with that sense of 是 (also as 昰) from seeing it in some obscure Japanese text, where it was used to signify これ, which was probably about right when writing was new to Japan. In Japanese, 是 is more commonly used in words that to me seem unrelated to either the old, very old, or modern Chinese use of the character.

It's amazing how durable some of this stuff is, especially if you look at it from the perspective of recipients of Middle and Classical Chinese culture (such as Japan).


It's rather curious to plainly see in this decomposition how more basic words have simpler symbols, whereas proper names look like black midi. (I wonder if any of these have four or more simple characters jammed into one.)


> I wonder if any of these have four or more simple characters jammed into one.

yup!

https://en.m.wikipedia.org/wiki/Radical_(Chinese_characters)

> For example, the radical 女 appears on the left side in the characters 姐, 媽, 她, 好 and 姓


That's about what I meant, but so far I've seen three-part characters and am sorta curious how many more get used, in practice. Also afaik some radicals get chopped in the process, and it seems there are some rudimentary ones (in terms of graphics) that aren't ever used on their own—both of which don't present much of a challenge so I'd count them as half a part for my purposes.



Impressive. Would pinyin for entering the full symbol also be as elaborate as the sum of the parts, or is just ‘biángbiángmiàn’? Though I suspect that this character is where the ‘in practice’ condition kicks in.

Notably, in the mnemonic for the character I see another one that has four parts, exceeding my previous experience: 彎.

Also the PDF for the Source Han Sans font, linked in the Wikipedia article, has right under the biángbiángmiàn some other monstrosity, consisting of 18 parts if I'm seeing them right. Of course, it's likely another novelty thing: https://raw.githubusercontent.com/adobe-fonts/source-han-san...

Seems that the latter if ‘Taito’: https://en.wikipedia.org/wiki/Taito_(kanji)


As the readme for Source Han Sans mentions, neither of these characters is encoded in Unicode yet, so writing them isn't supported by most input methods. (Wikipedia uses SVGs to show the characters; the font recognizes the ideographic description sequence.)

However, once support arrives, it will be as easy as typing "biang", since there's currently no character with that pronunciation. It could be confused with a two-syllable word "bi ang", but there's no such word in Mandarin.


Knowing nothing about Chinese, I'm curious how we arrive at 曼德博 being "Mandelbrot". How does the language handle foreign names and loan words?


There are essentially two methods: phonetic transliterations (Mandelbrot = 曼德博 = man de bo) and translation (computer = 电脑 = diannao = 'electric brain'). As the former tend to look weird, and are most often proper names, they are often especially punctuated to distinguish them from the rest of a paragraph.


> they are often especially punctuated to distinguish them from the rest of a paragraph.

Wenyan-lang does this, but it's not really common in normal texts. The reader is just expected to figure it out themselves.

Also note that màn dé bó is the Pinyin transcription of 曼德博 and only reflects the Mandarin pronunciation. In Zhengzhang Shangfang's reconstructed Old Chinese pronunciation, it would be more like moːn tɯːɡ paːɡ. Those syllable-final consonants are preserved in many other Sinitic languages, like Cantonese (that's how they were reconstructed) so Mandarin-based transliterations don't work well for those. As an alternative, 勃 (also Mandarin ) has the reconstructed Old Chinese pronunciation bɯːd, which is a closer approximation of the "brot" in "mandelbrot".


it's not really common in normal texts

https://en.wikipedia.org/wiki/Chinese_punctuation


And which of these punctuation marks is used to mark something as a transliteration? The middle dot • serves as spacing in multi-part names, but that doesn't tell you where the transliteration begins or ends.


Very often 《…》/ <…> / 「…」are used to delimit transliterated proper names.


I've only seen angle brackets used to indicate titles of books, movies, etc., and regardless of whether the name is transliterated or not. The corner bracket quotation marks are more typical of Traditional Chinese typography, which I don't see as often, since I mostly read writing by mainlanders.


Given that "Mandelbrot" is German for "almond bread", the translation approach would also be possible... except that almonds don't seem to have been known in China in the classical period.


It's transliteration. There are characters and sounds that are used to mimic the sound of foreign words.

曼德博 sounds like man de bwo (man4de2bo2 in pinyin). 迈克 (Mike) sounds like my ke


Couldn't the whole thing be shortened as follows, or to something very similarly concise?

曼德博術寬高也 (ie. Mandlebrot is a function of width and height.)

In terms of concision, actual keystrokes required to type that are mandeboshukuangaoye (19). Compared to function mandlebrot(width,height){} (35).


That doesn't really make sense as a Classical Chinese sentence. 曼德博术使以广纵二数也。 is a bit closer to how you might see it in a non-mathematical text.

術means something closer to "method," "procedure," or "way to do something." It's not a function or something that takes arguments in the modern sense.

This programming language is following the style of ancient Chinese mathematical treatises very closely, which are all of the form

X术曰:……


FYI I studied ancient Chinese history and some classical Chinese. I believe you have a blinkered view of valid grammatical constructions, perhaps due to focus on later period texts. IMHO in gross simplification, the earlier you go the less grammatical fluff is required, and the more is open to interpretation. I am not an expert but compare, say, a Three Kingdoms period text to a Tang text. In my impression your construction is far more explicit and latter-day. Nobody wrote like that early on, especially for content tending toward the philosophical.


I'm writing in a style somewhat following a Warring States to Han Dynasty text (the 九章算术). The problem isn't the concision per se, it's that that's just not what 术 means here; it's not something that takes arguments. I'm being slightly verbose but I can't think of a construction that doesn't involve 以 or 数 (or synonyms thereof). It's true you don't need both.

Now there is a way to make your construction work with a wider context, for example in one where you've established 术 as the notion of a function.

Your general impression is correct that earlier texts tend to get more concise and that Classical Chinese is quite grammatically flexible. But there's still limits.

Moreover ancient mathematical texts tended to be far more explicit and written in a far more direct style. Ending particles such as 也 are actually fairly rare in such texts.


Could be far fewer keystrokes with character prediction. First would be 7 instead of 19, ignoring Enter/arrow/mouse clicks.


A couple notes on keystrokes:

1. Ignoring prediction, you need more than three keystrokes to type 事 ("shi"). You type the s, the h, and the i, and then you select the character you want from a menu of suggestions. If you're typing a rarer character (which 事 is not), you'll need additional keystrokes to page through the suggestions.

2. If you're serious about minimizing keystrokes, you'd use double pinyin input, not pinyin input. Two keys per syllable; probably three per character since a lot of repetition means the characters you want are likely to be top suggestions.


> and then you select the character you want from a menu of suggestions

Notably, anything reasonable that lets the user just keep mashing the keys is gonna be faster than selecting stuff on the screen, assuming the user is experienced with typing. Because seeing a wrong predicted character, then looking at the menu, then—crucially—locating the necessary character and then selecting it will be way slower than punching keys in without interaction. Making choices and, separately, selecting stuff on the screen are both slower than just jerking the fingers from muscle memory. More so if the user is a touch-typist.

If you know that your ‘事’ is something like ‘shi down-down-enter’, it would still be faster than the same thing with unfamiliar choices in the menu—or if the prediction and the choices change between invocations. Though this handicap would diminish after the choices settle on the user's typical most-used characters and the user in turn gets used to them.


This is not strictly true. On modern IMEs, usually the first character is enough if the compound you are typing is predictable.

Examples: dnxb would input 东南西北.

Then there is learning. While on OSX's pinyin input 曼德波 requires mandebo the first time, it then becomes the first result for all subsequent inputs. We may assume that most multi-character function names would quickly benefit from similar prioritization.


> dnxb would input 东南西北.

Yes, that's why I started out by saying "ignoring prediction".

However, it's perfectly fair to note that you can and should enter phrases all at once as opposed to one character at a time, which would reduce the double pinyin input from 3 keystrokes per character to two per character plus one per "input unit".

> Then there is learning. While on OSX's pinyin input 曼德波 requires mandebo the first time, it then becomes the first result for all subsequent inputs. We may assume that most multi-character function names would quickly benefit from similar prioritization.

Yes, I noted this specifically:

>> a lot of repetition means the characters you want are likely to be top suggestions


Apologies I mentally switched off when you mentioned 'double pinyin'. Maybe I use that anyway.


You could also treat 也 as ; in some other language syntaxes (eg. ruby), so newline could be semi-synonymous, so the use of 也 becomes superfluous unless you are writing one liners. So that's down further to 6 characters. Even if 'f mandelbrot(width,height' was used in an autocompletion IDE, the traditional syntax weighs in at 24 characters or 4x.


In idiomatic Wenyanwen, yeah, but you need to somehow delimit the token boundaries between 寬 and 高.


For the parsing problem, you can just enforce single character variable names.


https://github.com/wenyan-lang/wenyan/issues/560

Looks like the author decided to make the syntax more concise with their object parser/serializer.


Depends on what kind of concise we're talking. Those are in the BMP, so two bytes a piece. The keys are fairly short though, 2-3 bytes is pretty compact for useful keys in most JSON.

The placed number system without Arabic numerals is weird to me. I get that it's probably not all that efficient decoding long-form Chinese myriadic numbers, but it's still weird to see 「九〇〇」instead of 九百 and 「六一」instead of 六十一; though maybe I'm the weird one for thinking that looks weird.


Do you prefer 丗 than 三十/三〇


That would be a bit more obscure, but very classical!


Sounds quite poetic actually.


That sounds similar to what Knuth had in mind with literate programming:

https://en.m.wikipedia.org/wiki/Literate_programming


Not really: ‘literate programming’ is an inversion where free-form documentation is at the front while the code is embedded, instead of docs being swept into comments and readmes. What's described above is just regular syntax, only verbose—no arbitrary extra bits.


It sounds like HyperTalk, “writing code in natural language”.


APL


I'm super glad programming languages were invented in a country with an alphabet.

Imagine if the computing revolution were in China instead of USA... we might all be coding using Chinese characters instead of Latin characters right now.


> Imagine if the computing revolution were in China instead of USA... we might all be coding using Chinese characters instead of Latin characters right now.

Nah. We would all be using a binary language based on I-Ching trigrams for "octal" representation, and 6-bit (hexagram) "words". A hacker's dream right there.


For this reason I dont think it would ever have happened in China


I wouldn’t care so much, actually. After all, I am not even using my native language to write programs in, but English.

It doesn’t matter as long as I can do my work.


Well, my point is that Latin characters are much easier to learn than Chinese. You only have to memorize 26 characters, half a dozen punctuation symbols, and a dozen keywords vs. thousands of pictograms.


Chinese characters can be typed on non Latin keyboards like zhuyin. And maybe only somewhat relatedly, the fastest texters of Japanese I’ve seen don’t use a Latin keyboard but some crazy 9 button input grid.


This really isn't a problem for the task of learning PLs in Chinese where the number of keywords is bounded...

I would agree that Han characters are a suboptimal technology for everyday written communication due to its large character inventory but this is not a topic where that seems to pose a problem.


As others have noted, the choice of both syntax (extremely elaborate, to the point of reeking of esoteric languages like Shakespeare) and semantics (scalar imperative language, JavaScript) seem to be a poor match for Classical Chinese, known for the brevity and tacitness of its texts.

I always thought that if for some reason one wanted to map an existing programming language into Classical Chinese (instead of coming up with something semantically closer resembling the latter), one could do worse than start with the likes of APL.

Consider the Fibonacci example: https://github.com/wenyan-lang/wenyan/blob/master/examples/f...

Is this really how you would like to use Classical Chinese to convey the idea of a Fibonacci number? Indeed, this form maximises the number of words one can use in a single definition; is there anything else for which it is good?

Here's an equivalent program in APL (also naively recursive, that's not necessary how I'd implement Fibonacci sequence):

{⍵<2:⍵⋄+/∇¨⍵-1 2}

If the argument is below 2, that's the answer; otherwise, compute sum of the function applied, in turn, to the argument less 1 and 2.


Can you recommend an APL interpreter? I'd like to fiddle with that.


Dyalog APL is a mature, modern, and well-supported implementation of APL. https://www.dyalog.com/

It's also powering https://tryapl.org/ and available on https://tio.run/

You might also find K interesting -- an APL descendant with somewhat different aesthetics, though Dyalog has recently done a lot of catching up to it. https://code.kx.com/q/


It looks like there's a Jupyter kernel for dyalog. I'll give this a try. Thanks!



See also: Perl in Classical Chinese in Perl: https://metacpan.org/pod/Lingua::Sinica::PerlYuYan


Definitely a cool concept, but I think the core idea is relatively similar to English-based programming languages because both Chinese and English are highly analytical languages (they don't inflect/change words based on case, tense, etc too much).

I'm working on an "inflectional" programming language at the moment, where word order and a whole bunch of other "traditional" features of analytical-language-based programming languages are discarded in favor of word inflection. For example, rather than expressing variable assignment with the '=', we use the ablative case for the source expression and the nominative for the target variable.

Traditional: foo = bar

Inflectional: foo barFrom

I'm not sure whether it would be useful, but it's just an interesting idea to play around with. There's already perligata (Latin) but it doesn't use a lot of the constructs in Latin and doesn't take the inflectional idea too far, so I'm implementing this in Classical Sanskrit. The core idea could be applied to pretty much any highly inflectional language though, like Arabic or Finnish.


There's a fun example in the GitHub repo for calculating the square root of a number based off of a real algorithm found in a real ancient Chinese text (九章算術).

https://github.com/wenyan-lang/wenyan/blob/master/examples/z...

I don't have the time to translate at the moment but I'll just leave the two here for others to see just how different they read (and for those who can read Chinese, what similarities they have).

The Wenyan language:

吾有一術。名之曰「增乘開平方」。欲行是術。必先得一數。曰「實」。乃行是術曰。 注曰。『增乘開平方法,以商數乘下法遞增求之。』。 吾有四數。名之曰「果」曰「商」曰「餘」曰「廉」。有數一。名之曰「法」。 恆為是。施「取底除」於「實」於「法」。若其之『商』小於百者乃止也。 乘「法」以百。昔之「法」者。今其是矣云云。 恆為是。若「法」不大於零者乃止也。 乘「果」以十。昔之「果」者。今其是矣。 加「廉」以「商」。乘其以十。昔之「廉」者。今其是矣。 施「取底除」於「實」於「法」。名之曰「甲」。 昔之「實」者。今「甲」之『商』是矣。 昔之「餘」者。今「甲」之『餘』是矣。 昔之「商」者。今零是矣。 恆為是。加「廉」以「商」。乘其以「商」。若其不小於「實」者乃止也。 加「商」以一。昔之「商」者。今其是矣云云。 加「廉」以「商」。乘其以「商」。若其大於「實」者。 減「商」以一。昔之「商」者。今其是矣云云。 加「廉」以「商」。昔之「廉」者。今其是矣。 加「果」以「商」。昔之「果」者。今其是矣。 乘「商」以「廉」。減「實」以其。乘其以「法」。加其以「餘」。昔之「實」者。今其是矣。 施「取底除」於「法」於百。昔之「法」者。今其之『商』是矣云云。 注曰。『商第一位。上商得數以乘下法為乘方。命上商除實。上商得數以乘下法入乘方。一退為廉,下法再退。』。 注曰。『商第二位。商得數以乘下法為隅。命上商除實訖。以上商乘下法入隅,皆名曰廉。一退,下法再退,以求第三位商。』。 注曰。『商第三位。用法如第二位求之。』。 乃得 「果」。 是謂「增乘開平方」之術也。

The original Chinese:

開方術曰:置積為實。借一算步之,超一等。議所得,以一乘所借一算為法,而以除。除已,倍法為定法。其復除。折法而下。復置借算步之如初,以復議一乘之,所得副,以加定法,以除。以所得副從定法。復除折下如前。若開之不盡者為不可開,當以面命之。若實有分者,通分內子為定實。乃開之,訖,開其母報除。若母不可開者,又以母乘定實,乃開之,訖,令如母而一。

Note the original Chinese is based off the rod calculus. https://en.m.wikipedia.org/wiki/Rod_calculus


This is a very cool language. We are working on a generic localized programming language (https://citrine-lang.org/) and we are looking for help with the Chinese language, maybe the creators of this beautiful language want to help us out with the Chinese version?


FYI, you write that the language is for "every man," which would be off-putting for some contributors.


HN has a lot of users (millions, most likely) whose native language is not English, so it's a good idea to remember that not everyone here is familiar with the standards that we may take for granted.


Of course. The intention was to provide information so that they could improve their copy, not to preen.


It seems that he's specifically trying to make it accessible to a wider audience; why would that be off-putting?


Particularly in a field which is known for a less-than-enthusiastic embrace of female contributions, “every man” is less inclusive than “every person” or “everyone”.


At risk of giving HN’s more delicate male readers their daily attack of the vapors:

Such thoughtless dismissal of half the human race is not a good look for a product claiming to improve accessibility.


The thing that makes english good for computers is the small alphabet size (smallest of any language I know), and the fact that a phrase is just a sequence of characters. These characteristics make it easy to get started with as well. What is the situation with this language?


IMO that's kind of a survivor syndrome though. The origins of modern comp science was heavily intermingled with latin languages and english in the form of ASCII just didn't get in the way. The entire alphabet of 52 main characters not including punctuation is not even close to being a small set. The world has adapted and considers it a non-issue anyway but personally I'd still like to see a lot more localization so people don't have to learn a second language in the form of english first, as it is now.


> The thing that makes english good for computers is the small alphabet size (smallest of any language I know)

Compare Greek at a standard 24 characters to English's standard 26.


Scots Gaelic uses only 23 latin letters, or only 18 if you don't count accented letters (e.g. it uses both "e" and "è").


Hawaiian has 13 (including the ').


Can someone familiar with Chinese language clarify one thing please: What does "Classical" mean in this case? And are the characters Simplified Chinese or Traditional Chinese?


Classical means the writing style long time ago, like 2000 years ago. The characters are definitely traditional. Classical style is noted for its brevity. In the time before paper, the writing was on bamboo slips where the real estate for words was small so the writing had to be concise and brief. A few words described a whole event, a bit like APL.

https://en.wikipedia.org/wiki/Bamboo_and_wooden_slips


In Chinese, people usually don't call Classical Chinese as 'Classical', instead people addressed it as 文言(Wen Yan), which roughly means the 'Written Speech' indicating it is special form of written Chinese, not spoken Chinese, which is often called 白话(Bai Hua, the Plain Speech), or Vernacular Chinese.

Since WenYan is created specifically for written and rarely used for speaking, there is a unique phenomenon in Chinese called "文白分离(Wen Bai Fen Li)", means the 'the Separation of Written and Spoken Chinese'. For nowadays Chinese people, it still requires intensive learning in order to read WenYan text from the ancient time as if it is a foreign language.


> For nowadays Chinese people, it still requires intensive learning in order to read WenYan text from the ancient time as if it is a foreign language.

This is true for everyone trying to read texts written in a form of their language as it existed more than 2000 years ago. You get a lot of language change in that amount of time.


The characters are Traditional Chinese. The grammar is modeled after that of the literary classics written thousands of years ago. (And later works imitating that style.) In particular, it uses 是 to mean "this" instead of the verb "to be" and a bunch of characters that are not used for modern vernacular texts, like 曰 "say".


Classical are refined Chinese used in official communication/literary record in imperial China/Korea/Japan. The grammar etc haven't really changed over 2 millenia, it is much like how Latin is to Italian/French/Spanish.

Historically, they are all obviously written in traditional Chinese characters, However, you can write it in Simplified Chinese since there's usually a 1-1 mapping between Simplified Chinese / Traditional Chinese characters.


Many, if not by most definitions, traditional characters map to 1 simplified character. Unfortunately, not all.

Example, a 9 traditional : 1 simplified map

斗 ⇄ 鬥斗鬪鬦鬭鬬闘閗逗

Here's a list that probably is mostly complete

https://en.wikipedia.org/wiki/Ambiguities_in_Chinese_charact...


Many thanks. So the characters shown in the IEEE Spectrum article, are they in Traditional Chinese? I wonder whether the implementation of the programming language covers both characters or not.


Those are traditional Chinese characters, I have no idea if simplified characters are also supported (shouldn't be hard as it would be another symbol set, so probably) but if you're going to write classical Chinese, might as well have the full immersion.


your last sentence is inaccurate: an english reader cannot read any latin at all naively, but a modern chinese reader can interpret little/some/most of classical chinese, depending on the specific text in question


English is a weird Romantic-Germanic hybrid (Germanic by linguistic classification but with a tremendous/predominant vocabulary of Romantic origin). A more apt comparison would be with respect to a French/Italian/Spanish reader. See: Interlingua


Only for the fun of it (actually recreation), your sentence (phrase), slightly modified, in English and its possible translation in current Italian:

> English represents a strange Romantic-Germanic hybrid (Germanic by linguistic classification but with a tremendous/predominant vocabulary of Romantic origin). A more appropriate comparison would be with respect to a French/Italian/Spanish bibliophile.

L'Inglese rappresenta uno strano ibrido Romantico-Germanico (Germanico come classificazione linguistica ma con un vocabolario tremendamente predominante di origine Romantica). Una più appropriata comparazione sarebbe rispetto ad un bibliofilo Francese/Italiano/Spagnolo.

I have noticed that (in my experience) when you use in English the Latin-originated synonyms of more commonly used English (possibly Germanic originated) words you are perceived as having a higher level of education (and also as being a tad bit snob).


The Romance influence in English comes from the elites after the Norman conquest, which is why Latin-rooted forms are seen as more upper class (and, often, pretensious).


misread, my bad; but i remain suspicious because from what i've heard the latin grammar is something quite alien, but then again i heard it from an english speaker....


I am a native English speaker, though one with much more interest in the structure of language than average.

Latin grammar isn't all that different from English grammar. It's usually possible to translate a sentence from Latin into English in a way that simultaneously preserves both the meaning and the grammatical structure of the original.

Attempting to do that between unrelated languages is vastly more difficult; in such cases, a translation that tries to preserve the source grammar will usually end up being hopelessly ungrammatical in the target language.

I think you're overestimating, or at least overselling, the degree to which modern Chinese people can read classical text without training.


I'm actually with colorincorrect here. There's a nontrivial overlap between formal modern Chinese and Classical Chinese.

This is especially evident if you ever read contemporary Chinese works about Chinese history. Large tracts of Classical Chinese are discussed without translation assuming the reader understands the text in question and often the contemporary work itself can read very classically.

Modern literature can also occasionally lapse into Classical Chinese constructions for a sentence or two.

And anecdotally I don't think I've ever met a Chinese high school graduate who didn't have some proficiency with Classical Chinese.

I've said this before elsewhere, sometimes it's useful to think of Classical Chinese as a separate language from modern Chinese, sometimes it's useful to think of it as an extremely elevated register of modern Chinese. Modern literary works can be more or less "classical" in nature depending on the whims of the author.


> There's a nontrivial overlap between formal modern Chinese and Classical Chinese.

> This is especially evident if you ever read contemporary Chinese works about Chinese history. Large tracts of Classical Chinese are discussed without translation assuming the reader understands the text in question and often the contemporary work itself can read very classically.

If you read some non-contemporary early modern English literature, you may find Latin, classical Greek, or French discussed or used without translation in the expectation that the reader will be able to understand it directly.

But this is evidence that the reader is expected to have undergone significant training, not that English speakers can understand ancient Greek without training.

> And anecdotally I don't think I've ever met a Chinese high school graduate who didn't have some proficiency with Classical Chinese.

We can be even more definite here: this is because Chinese high school graduates have all received training in Classical Chinese.


You can successively "classical"ize a Chinese work that you can't do with English or French vis-a-vis Latin. I can take a sentence and iteratively make it more and more classical. Here's the sentence "His name is John," successively made more classical. Every version except the last can be found in all sorts of modern Chinese written works. Conversely every version except the first is valid Classical Chinese.

Even within Classical Chinese you can be more or less "Classical."

他的名字叫约翰。

其名为约翰。

其名约翰。

其名约翰也。

Moving away from examples in the language itself, high-level programs of advanced modern Mandarin comprehension, both for foreign speakers and native speakers test for some knowledge of Classical Chinese.

Every modern Chinese language for foreign speakers learning program I know of dedicates at least one (if not multiple) module at the advanced level to Classical Chinese (this is separate from a dedicated Classical Chinese course that goes in more detail) with Classical Chinese readings.

For ILR level 5 modern Mandarin fluency the U.S. State Department explicitly lists knowledge of Classical Chinese (to the level of a native speaker) as a prerequisite (and in fact Classical Chinese shows up on a sample test I cannot find at the moment).

It is also a component of the HSK level 6, which suggestively calls it “能读懂略带文言色彩的文章“, that is "can read articles with a slight amount of Classical Chinese flavor" hinting again at a register-like relationship.

And of course Chinese comprehension tests for native speakers in China and Taiwan have a Classical Chinese component.

I would be very surprised to find any similar standard for Latin and English or Latin and French. What ESL program teaches Latin?

Note this isn't just cultural pride from China. These are foreign institutions that have deemed a certain amount of Classical Chinese necessary to understand the modern Mandarin corpus (more so than just set phrases such as sine qua non in English, but true grammar and independent vocabulary).

Sure everyone receives training in Classical Chinese, but that's because it's a symbiotic relationship. Because everyone knows Classical Chinese it influences the modern language. Because it influences the modern language it becomes a prerequisite for Chinese language programs (even those for foreign speakers).


> And of course Chinese comprehension tests for native speakers in China and Taiwan have a Classical Chinese component.

> I would be very surprised to find any similar standard for Latin and English or Latin and French. What ESL program teaches Latin?

> Note this isn't just cultural pride from China. These are foreign institutions that have deemed a certain amount of Classical Chinese necessary to understand the modern Mandarin corpus (more so than just set phrases such as sine qua non in English, but true grammar and independent vocabulary).

It is just cultural pride from China, but cultural pride with many ramifications.

Literacy standards including Latin for high registers of English don't exist now. But they used to. And standards of Latin for high registers of French are of course even more historically normal -- there was a long period where Latin was the highest register of French (exclusively in writing).

You're making the point that Chinese people receive extensive training in Classical Chinese and are therefore familiar with it to differing degrees. But you know what they're not familiar with to differing degrees? Their modern language, which they all know natively. The fact that they can read some Classical Chinese after being trained in it just isn't evidence that they could read it before being trained in it.


I'm saying Classical Chinese and modern Chinese are to an extent inseparable and that this is reflected in every Chinese teaching program domestic or foreign.

Can you show me a sentence that is both Latin and English or both Latin and French? There are plenty of such examples for Classical Chinese and modern Chinese.

At times there's a blurry line between Classical Chinese and modern Chinese. It's a false dichotomy to say that you can train in advanced modern Chinese without training in some Classical Chinese.

Here's a non-exhaustive list of things in Classical Chinese you'll be exposed to because they're still widely used in modern Mandarin.

Its most common pronouns (especially first and third person): 我、其、之 etc.

Its connectives: 为、于、乃、因、与etc.

Its lack of 是 as "to be" and instead leaving "to be" implicit between verbs and nouns: take e.g. the PRC's constitution. Many paragraphs use 是 as "to be" zero times. Few use it more than once or twice.

On a similar note its demonstratives: 此、彼、兹、indeed even 是 again.

And when it comes to standard vocabulary, most of the time a classical meaning of a character remains productive in modern Chinese.

There's certain Classical Chinese works I'd be comfortable using to assess a foreign speaker's modern Mandarin comprehension. For example if a speaker cannot read the 2nd century poem 凤求凰 (especially the first part), they almost certainly cannot read a modern newspaper article. It reads almost exactly like how a modern angsty teenager might try to write a modern Mandarin love poem.

Just about the only category of things you won't see in modern Chinese from classical Chinese are its interjective particles (兮、也、矣、etc) which have no semantic meaning.

What makes Classical Chinese difficult to read for a modern Chinese reader is its extreme concision and its grammatical flexibility. Its vocabulary is only a secondary concern. I would say if you know modern Mandarin, you know probably around 70% to 80% (depending on the text) of the words you'll see in a classical Chinese text, especially for texts after the Warring States period. You're definitely not going to totally understand the text and it's going to be feel laborious picking over each paragraph, but you will understand the gist of what's going on, just based on your modern Mandarin knowledge.


"classical" chinese is the form of chinese used before around 1910's (but some texts which have the "modern style" predate this time). single obscure characters would be used to convey a complex specific meaning, a lot of the grammar and referents are implicit, structure is very dense, and in practice there would often be literary or historical references that would go over most readers ill-equipped to deal with such things. it was also fashionable to write in "symmetry", but modernists who pushed for literary reform thought a lot of this was just style over substance.

"modern" chinese was developed around the 1910s as a push for modernization/literacy as influenced by western imperialism/thought spreading into china. tldr they advocated for readability/accessibility, which meant a stylistic reform of the language.

if you can read modern chinese well enough, you can kinda understand about 30-80% of the meaning, depending how obtuse the text is and or when it was composed, but early chinese education (elementary school) includes some Tang poems from 600-900 AD, but is still quite readable. compared to something like middle english, which modern readers cannot read at all, you can see that the chinese language hasn't changed all that much

cf:

https://en.wikipedia.org/wiki/Classical_Chinese#Grammar_and_...

https://en.wikipedia.org/wiki/Written_vernacular_Chinese


> compared to something like middle english, which modern readers cannot read at all, you can see that the chinese language hasn't changed all that much

It helps that ancient texts are usually not presented in the original handwriting (which has changed a lot over the millenia) and of course the writing system masks changes in pronunciation. If you speak Mandarin, try reading a text in another Sinitic language using an alphabetic writing system, e.g. a random article of the Hakka Wikipedia: https://hak.wikipedia.org/ Then consider how different the last common ancestor of both languages must have been.


> compared to something like middle english, which modern readers cannot read at all, you can see that the chinese language hasn't changed all that much

This is nonsense. Here's some middle english (taken from https://www.chaucermss.org/?manuscript=Dd&tale=GP&version=si... ):

    A Millere was there / dwellyng many a day
    As any Pecok / he was proud and gay
    Pipe he coude and fisshe / and nettes bete
    And trne cuppes / & wel wrestel and shete
    Ay by his belt / he bar a long panade
    And of a swerd / ful trenchaūt was the blade
Middle English is much more similar to modern English than Classical Chinese is to modern Chinese (of any variety), for the obvious reason that Middle English is separated from modern English by less than half the period separating Classical Chinese from modern Chinese.


fair enough. i was told that by a old/english scholar and i checked wiki sample text to confirm, but i must have been mistaken.

>Middle English is much more similar to modern English than Classical Chinese is to modern Chinese (of any variety), for the obvious reason that Middle English is separated from modern English by less than half the period separating Classical Chinese from modern Chinese.

i think it depends on the specific text in question, but i'm drawing blanks because im not very informed on old lit in general. again tang poems are taught at an early age, but perhaps most text would be harder to read


Perhaps you are thinking of Old English, which really is different beyond comprehension. Here's a bit of Beowulf:

Hwæt. We Gardena in geardagum,

þeodcyninga, þrym gefrunon,

hu ða æþelingas ellen fremedon.

Oft Scyld Scefing sceaþena þreatum,

monegum mægþum, meodosetla ofteah,

egsode eorlas. Syððan ærest wearð

feasceaft funden, he þæs frofre gebad,

weox under wolcnum, weorðmyndum þah,

oðþæt him æghwylc þara ymbsittendra

ofer hronrade hyran scolde,

gomban gyldan. þæt wæs god cyning.


This is more fair. As yorwba points out elsewhere, though, some pretty large differences between Old Chinese and modern Chinese are masked by the fact that Classical Chinese is always presented with modern spelling[1]. (Other, larger differences are fully apparent.) To be more closely analogous, you'd render "þæt wæs god cyning" as "That was good king" -- and suddenly the gap from "that was good king" to "that was _a_ good king" doesn't look so large.

[1] There are good reasons for this; since Chinese writing bears very little phonetic information, we have only limited knowledge of what Old Chinese sounded like in the first place.


Applying the same cognate replacement (using Wiktionary as an etymology dictionary) to the full snippet above, I end up with

What. We gar-danes' in yore days

thede kings', thrym frained,

how the athelings ellen framed.

Often Shield Sheafing scathers' threats

many maidens, mead-seats' off-towed

eysed Eorlas. Since erst was

few-shaft found, he that frother bode,

waxed under welkin, worth-minds theed,

othat him each there umsittings'

over whale-road hear should

change yielded, that was good king.


Kind of reminds me of something I was subjected to in another life, called LSE (a frenchified BASIC) [1][2].

Here's an example:

    * Quelques déclarations
    * Suivies d'une boucle
    BOOLEEN A←.VRAI.,B←.FAUX.
    ENTIER U,W,X←200
    NOMBRE PI←3.14159
    CHAINE CHN
    TABLEAU DE ENTIER TBL[3,3]
    QUEUE DE CHAINE Q[8]
    ENSEMBLE DE NOMBRE  NPREMIER←{1.0,2.0,3.0,7.0}

    CHN←'Salut'
    X ← SELON X ALORS 1,2,3,7,11 SINON 0
    POUR U←0 JUSQUA 2 FAIRE
        POUR W←0 JUSQUA 2 FAIRE
            TBL[U,W]←X
        BOUCLER
    BOUCLER
TERMINER

Needless to say, the thing was an absolute dead-end.

The only thing I still feel it had going for it is that assignment to variables were done via the ← sign and not the dreaded '=' so common to modern languages.

[1] https://en.wikipedia.org/wiki/LSE_(programming_language)

[2] https://fr.wikipedia.org/wiki/LSE_(langage)


FTA:

> World's First Classical Chinese Programming Language

This is false. There is at least one prior art, first published 18 years ago: http://p3rl.org/Lingua::Sinica::PerlYuYan


I got a tiny projected inspired by Wenyan https://github.com/Cirru/jiuzhang-lang if anyone is interested.


Looks very interesting but I don’t understand chinse so I’d be curious what chinese programmers think about it. I think a scheme lisp in chinese would be quite efficient in terms of visually parsing the code.


This is the equivalent of building a programming language in the style of Mediaeval English. Fairly sure it's not meant to go mainstream.


Yep, it’s play. But, even just playing might generate ideas and insights that subsequently prove to have “real work” uses as well.

Play also has the advantage of being utterly unconstrained by any need to “be serious”, and in having no fear in failures. Can you imagine silly fun design risks being taken while crafting the next “Ada”? Or even the next Python or Swift?

At “worst”, the exercise runs its course having demonstrated pictographic writing systems impractical for real-world software development. (And, for my money, voice is really the next way to go.) Still, with a potential ready-made audience of 1.4 BILLION, I think such exploratory work is not a wasted investment.


I like this idea. Where's the Chaucerian English programming language?


Not directly, but in a same vein, there's language based on rock music texts: https://github.com/RockstarLang/rockstar

Example of the code:

  Evil Energy is death
  The Legend says  doo
  
  Spirit takes Will
  Give back Will plus The Legend
  
  Put The Legend into my perspective
  
  my dream was spellbound
  
  While Evil Energy is stronger than my dream
  Put Spirit taking my perspective into my perspective
  Knock Evil Energy down


It’s like AppleScript, but with sick guitar licks! Could be the next Gloryhammer!


It's a fun project in that you can write something that feels like classical Chinese and run it.

It will always be just a hobby like the latin perl script.


It's an esolang. I don't think it has much practical application over, say, Brainfuck.


So, is it not esoteric? Asking because this comment was downvoted.


Know chinese (abd currently studied classical text like zhungzi) and doing IT many years ... come on one is hard enough and joining two. You are crazy.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: