r/ProgrammingLanguages • u/mttd • Jul 09 '26
🦄 Unicode's Transliteration Rules Are Turing-Complete
https://seriot.ch/computation/uts35/
70
Upvotes
r/ProgrammingLanguages • u/mttd • Jul 09 '26
42
u/gasche Jul 09 '26
The reactions here seem to assume that this means "Unicode is Turing-complete", which is not the case. The unicode standard specifies a domain-specific language of rewrite rules called "transliteration rules", and internalization data for a language may contain a bunch of fixed rewrite rules for a given human language. The poster shows that this language of rewrite rules is Turing-complete (which is not so surprising; it is rather easy to make rewrite rules Turing-complete): if you write your own rewrite rules, then you can write some that can simulate a Turing machine (or do whatever). This does not mean that the rules that exist today and were designed for human languages are Turing-complete.
10
u/SwedishFindecanor Jul 09 '26
That does not surprise me the slightest ...
Unicode is so complex that there is practically no program that processes text in any non-trivial way that supports all of Unicode correctly.
I once started writing a text editor as a hobby project, but had to spend most the time on mapping between Unicode and an internal 32-bit encoding that corresponded to glyphs on screen, so I got fed up and stopped. I could continue that work if there is demand, but I would have to make special cases for almost every group of characters, and then for different locales: because Unicode interpretation depends on the current locale as well. And it too would still not support all of Unicode.
2
u/Toothpick_Brody Jul 09 '26
I never knew Unicode had rewrite rules lol. Is it time for a Unicode type system? 🤔 Unicode logic?
-13
u/EggplantExtra4946 Jul 09 '26
Unicode is officially a badly designed clusterfuck.