News for hackers. Stuff that matters.
Re:Wenyan-lang: Classical Chinese Programming Language by contingencies on Saturday February 01, 2020 @09:01PM (#22214653)
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).

Re:Wenyan-lang: Classical Chinese Programming Language by dwohnitmok on Sunday February 02, 2020 @01:10AM (#22215456)
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术曰:……

Re:Wenyan-lang: Classical Chinese Programming Language by contingencies on Sunday February 02, 2020 @01:19AM (#22215476)
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.
Re:Wenyan-lang: Classical Chinese Programming Language by dwohnitmok on Sunday February 02, 2020 @01:41AM (#22215542)
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.

Re:Wenyan-lang: Classical Chinese Programming Language by gibolt on Saturday February 01, 2020 @09:07PM (#22214682)
Could be far fewer keystrokes with character prediction. First would be 7 instead of 19, ignoring Enter/arrow/mouse clicks.
Re:Wenyan-lang: Classical Chinese Programming Language by thaumasiotes on Sunday February 02, 2020 @12:05AM (#22215248)
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.

Re:Wenyan-lang: Classical Chinese Programming Language by aasasd on Sunday February 02, 2020 @01:24AM (#22215490)
> 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.

Re:Wenyan-lang: Classical Chinese Programming Language by contingencies on Sunday February 02, 2020 @12:13AM (#22215271)
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.

Re:Wenyan-lang: Classical Chinese Programming Language by thaumasiotes on Sunday February 02, 2020 @12:48AM (#22215384)
> 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

Re:Wenyan-lang: Classical Chinese Programming Language by contingencies on Sunday February 02, 2020 @01:21AM (#22215484)
Apologies I mentally switched off when you mentioned 'double pinyin'. Maybe I use that anyway.
Re:Wenyan-lang: Classical Chinese Programming Language by contingencies on Saturday February 01, 2020 @09:55PM (#22214849)
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.
Re:Wenyan-lang: Classical Chinese Programming Language by jhanschoo on Sunday February 02, 2020 @12:25AM (#22215311)
In idiomatic Wenyanwen, yeah, but you need to somehow delimit the token boundaries between 寬 and 高.
Re:Wenyan-lang: Classical Chinese Programming Language by contingencies on Sunday February 02, 2020 @01:20AM (#22215478)
For the parsing problem, you can just enforce single character variable names.