Live data from Hacker News

Unicode's transliteration rules are Turing-complete

seriot.ch

11–20 of 37 posts

Re: Unicode's transliteration rules are Turing-complete

#14

Does this mean I could post some untransliterated text here in a comment and make your browsers all do these computations?

I could be wrong, but I don't think it's common for websites to just transliterate any text they're given. Let's check: ウィキペディア

Re: Unicode's transliteration rules are Turing-complete

#15
post #10
post #9

Who implements transliteration rules? I assume operating systems? Or text renderers?

The ICU library. It’s so ubiquitous that it’s somewhat difficult to avoid this library if you are doing anything advanced with human text.

And ICU uses data from CLDR, which is mentioned in the blog. Here, there are 380 xml files: https://github.com/unicode-org/cldr/tree/main/common/transfo...

Yes, ICU is ubiquitous. But, some NLP projects use various other libraries, such as uroman (just for romanization - to Latin script).

Re: Unicode's transliteration rules are Turing-complete

#17
This is not interesting in the way that "DNS parsing is turing complete" is interesting. Nobody can send you a unicode file and make you run an infinite loop or whatever.

Within Unicode is defined a DSL used internally by the library implementers to define some business logic, like most DSLs it is turing complete. Anyone with the ability to make you run their rules file already has the ability to make you run arbitrary code (it's a software vendor for software you use).

It's still always fun to find Weird Machines, but as they go, this one is not very weird (it's one of the known families of programming languages, the Mathematica language being the most well known example. The person who specified this most likely was aware that this is turing complete and it's the rules author's responsibility not to write infinite loops).

Re: Unicode's transliteration rules are Turing-complete

#19

Does this mean I could post some untransliterated text here in a comment and make your browsers all do these computations?

Perhaps I've misunderstood, but I think it's not the text that is unicode complete, it's the transliteration rules that are.

Unless you install special rules you won't be doing extra computation.

Re: Unicode's transliteration rules are Turing-complete

#20

This is not interesting in the way that "DNS parsing is turing complete" is interesting. Nobody can send you a unicode file and make you run an infinite loop or whatever. Within Unicode is defined a DSL used internally by the library implementers to define some business logic, like most DSLs it is turing complete. Anyone with the ability to make you run their rules file already has the ability to make you run arbitra…

> Nobody can send you a unicode file and make you run an infinite loop or whatever.

I find it interesting/weird (that the spec is written in such unrestricted DSL) for pretty much that reason. They could send you input for rules that are in the spec, and hope you translated them to your programming language of choice in a fairly straightforward manner. Which may then have perfectly acceptable average runtime properties, whether you do it in UTF-8 or UTF-32 (fixed-width) space .. but a worst-case that can reliably be triggered with chosen input!

recent example: https://github.com/python/cpython/issues/149079

Post reply on HN