8 ms·
The syntax is slightly cumbersome. For example, the function header of the mandelbrot snippet at https://wenyan-snippets.netlify.com/ https://wenyan-snippets.ne
by yorwba 7y ago
The syntax is slightly cumbersome. For example, the function header of the mandelbrot snippet at https://wenyan-snippets.netlify.com/ 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.
- Guthur 7y agoYour description reminds me of Cobol.
- microcolonel 7y agoIt 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 漢字.
- Ericson2314 7y agoImperial Chinese COBOL is very natural sounding concept. That's for sure civil service exam material right there.
- knolax 7y agoThe 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 https://zh.m.wikipedia.org/zh-hant/%E5%8F%A5%E8%AE%80
- colorincorrect 7y agonot sure if serious but this sounds like trying to learn english via python syntax
- Aardwolf 7y agoI learned English words like while, for and next from qbasic, for real (it had good help in your local language)
- wrboyce 7y agoOk 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?)
- macintux 7y agoIt made sense to me: qbasic had good localized help.
- mcny 7y agoIt 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.
- wrboyce 7y agoOh right I see, yes it does make sense you’re right. I was really struggling with that last night, cheers.
- aasasd 7y ago
- thaumasiotes 7y ago> 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 本.)
- microcolonel 7y agoI'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).
- umvi 7y agoI'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.
- deleted 7y ago[deleted]
- zozbot234 7y ago> 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.
- enz 7y agoI 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.
- umvi 7y agoWell, 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.
- knolax 7y agohttps://github.com/wenyan-lang/wenyan/issues/560 https://github.com/wenyan-lang/wenyan/issues/560 Looks like the author decided to make the syntax more concise with their object parser/serializer.
- microcolonel 7y agoDepends 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.
- guicho271828 7y agoDo you prefer 丗 than 三十/三〇
- microcolonel 7y agoThat would be a bit more obscure, but very classical!
- aasasd 7y agoIt'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.)
- uryga 7y ago> 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) https://en.m.wikipedia.org/wiki/Radical_(Chinese_characters) > For example, the radical 女 appears on the left side in the characters 姐, 媽, 她, 好 and 姓
- aasasd 7y agoThat'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.
- nothrabannosir 7y ago11: https://en.wikipedia.org/wiki/Biangbiang_noodles https://en.wikipedia.org/wiki/Biangbiang_noodles
- aasasd 7y agoImpressive. 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-sans/release/SourceHanSansReadMe.pdf https://raw.githubusercontent.com/adobe-fonts/source-han-san... Seems that the latter if ‘Taito’: https://en.wikipedia.org/wiki/Taito_(kanji) https://en.wikipedia.org/wiki/Taito_(kanji)
- dunkelheit 7y agoSounds quite poetic actually.
- zozbot234 7y ago> 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.
- rch 7y agoThat sounds similar to what Knuth had in mind with literate programming: https://en.m.wikipedia.org/wiki/Literate_programming https://en.m.wikipedia.org/wiki/Literate_programming
- aasasd 7y agoNot 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.
- sandoooo 7y agoIt 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: 有術曰「曼德博」。先得數曰「寬」,曰「高」。乃行是術曰。
- contingencies 7y agoCouldn'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).
- gibolt 7y agoCould be far fewer keystrokes with character prediction. First would be 7 instead of 19, ignoring Enter/arrow/mouse clicks.
- contingencies 7y agoYou 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.
- thaumasiotes 7y agoA 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.
- contingencies 7y agoThis 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.
- bfung 7y agoIt'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 =)
- jerf 7y agohttp://shakespearelang.sourceforge.net/report/shakespeare/shakespeare.html http://shakespearelang.sourceforge.net/report/shakespeare/sh... Arguably a bit more subtle than your sample code.
- trevyn 7y agoNice. Is there a longer Hello World anywhere?
- billfruit 7y agoVery impressive, in that it is not mere transcription of terms used by Shakespeare into keywords, but it organizes the whole program as a drama.
- c3534l 7y agoThat is way better than I thought it would be from other esolangs I've seen.
- jerf 7y agoThere'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.
- Igelau 7y agoKnowing nothing about Chinese, I'm curious how we arrive at 曼德博 being "Mandelbrot". How does the language handle foreign names and loan words?
- contingencies 7y agoThere 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.
- yorwba 7y ago> 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 bó) has the reconstructed Old Chinese pronunciation bɯːd, which is a closer approximation of the "brot" in "mandelbrot".
- contingencies 7y agoit's not really common in normal texts https://en.wikipedia.org/wiki/Chinese_punctuation https://en.wikipedia.org/wiki/Chinese_punctuation
- yorwba 7y agoAnd 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.
- qbaqbaqba 7y agoAPL
- taneq 7y agoIt sounds like HyperTalk, “writing code in natural language”.