logoalt Hacker News

Unicode's transliteration rules are Turing-complete

61 pointsby beefburgeryesterday at 9:44 AM19 commentsview on HN

Comments

SonOfLilittoday at 3:45 AM

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).

show 1 reply
beefburgeryesterday at 9:44 AM

I've been wondering for a while if anything in Unicode could accidentally compute. It turns out that UTS #35 transliteration rules are Turing-complete. I show how to compute Collatz with just 3 rewrite rules running on stock ICU.

show 1 reply
anankaietoday at 1:40 AM

At this point it feels more difficult to ensure that your format cannot compute than to ensure it can

NooneAtAll3today at 1:40 AM

reminds me of Word's autocorrect being turing-complete https://www.youtube.com/watch?v=jlX_pThh7z8 (3:57, but whole video is fun)

ks2048today at 2:08 AM

Does the Latin-Katakana example given imply that some input value can cause it to not terminate?

linzhangruntoday at 1:25 AM

Waiting for someone to vibe a compiler targeting Unicode transliteration rules...

hyperhellotoday at 2:16 AM

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

show 2 replies
dvttoday at 2:00 AM

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

show 1 reply
sgjohnsontoday at 2:23 AM

reminded me of the PowerPoint Turing Machine

https://www.youtube.com/watch?v=uNjxe8ShM-8

cyberaxtoday at 3:48 AM

So... Who's porting Doom to run on this?

esttoday at 1:35 AM

Does it work on modern OS or just PyICU ?

quotemstrtoday at 4:27 AM

From a computer science POV, it's spooky how Turing-completeness arises spontaneously out of the most mundane data-processing machines. You look at UTS#35, see "Transforms provide a set of rules for transforming text via a specialized set of context-sensitive matching rules." and think, "Ah! Rewrite rules! Those are often Turing-complete! Maybe this one is too!".

And so it is (https://en.wikipedia.org/wiki/Semi-Thue_system#Undecidabilit...).

It's a scary and wonderful part of our world that you can bootstrap so much complexity out of a little iterated self-reference.

My only quibble with the article is in this line...

> The surprise is that it lives in a data format for locale files, shipped in every OS, whose specification doesn't mention the possibility.

... I'm not surprised. After all, the processor that interprets the data format is Turing-complete not only in its instructions, but in the page table! See https://github.com/jbangert/trapcc

If anything, when you build a system and it starts to get complex, you have to go out of your way to ensure it's decidable and can't accidentally bootstrap the universe.

i18nagentaitoday at 3:42 AM

[flagged]