r/AskComputerScience • u/silakto339 • Nov 09 '19
i hate syntax-reserved punctuation
one fine day i was commenting on reddit and i wrote a couple of punctuation symbols expecting them to be displayed but instead... they were caught by the markdown software. this is bad. this means there are strings i cannot display as i wished. "use a backslash to escape them!". yeah but then what if we want to pass the string to several nested bash-like programs? ever found yourself putting over 9000 backslashes in a command line? how can i empower an editor to have markdown functionalities WITHOUT reserving any punctuation?
a very not human readable idea: we write using only odd string positions and we fill the even positions with _. a ☭ in a even position functions as delimiter (like a double quote) for the beginning of a new formatting mode declaration, which ends when the same mode is declared again by the same pattern (kind of XML tags). example:
hello-world
... becomes...
-h-e-l-l-o--☭i☭t☭a☭l☭i☭c-w-o-r-l-d☭i☭t☭a☭l☭i☭c
it's like a way to attach metadata to a file where needed without reserving escape sequences/characters.
an even less human readable would be to put two space delimited numbers ahead of each string. the first would be the length of the description of the current format mode, the second would be a counter of words before the next format mode change. example:
19 17 one two three ... ok nineteen? one two ... club seventeen
19 53 1 2 3 ... 19 1 ... 53
i don't even know how to call what i'm attempting to so, and surely i don't want to resort writing with lambda calculus like combinators for the sake of minimality.
any idea?
3
u/FlaskBreaker Nov 09 '19
We could also use a custom binary encoding and encode reddit posts by hand but there is a reason why this isn't done that way.
The reason is that Markdown is designed for humans to talk to machines, not for machines talking to machines. Thus, Markdown must be easily comprehensible to humans. If it were designed with only machines in mind, it would be completely different language and would address a completely different set of problems (like the ones you are talking about).
Your suggestions aren't easy to understand for humans. So, it doesn't solve our problem (human-computer communication) and, because of that, isn't a good solution for THIS problem (both of your proposals are actually good to solve other problems).
7
u/UncleMeat11 Nov 09 '19
But the whole point of having metadata based in normal characters is to let people write formatted content easily without requiring much tooling. Your system is almost entirely unusable without explicit tooling. Why not just go full wysiwyg and build something like Word?