Live data from Hacker News

Radiation-hardened quine

github.com

51–60 of 76 posts

Re: Radiation-hardened quine

#52

Earlier quoted context omitted.

The Japanese use Chinese characters. The Japanese also have alphabets. (At least two.) But Chinese characters aren't exactly an alphabet and the Japanese don't use Chinese characters directly as an alphabet, though many characters are based on Chinese ones.

Since we're being technical, Japanese does not have any alphabet as such; an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Japanese uses syllabaries ('kana' in Japanese), where almost all characters represent more than 1 sound. Hiragana is typically used to write Japanese words and grammatical particles, while katakana is typically used to write foreign words and for spe…

>a 1 to 1 correspondence between a single character and a sound.

While you're correct that the Japanese writing system is not an alphabet, I feel like your definition here is so vague it almost contradicts your point. After all, each kana character has a much closer correspondence with a particular "sound" than many actual alphabets.

So to clarify, the characters of an alphabet (notionally) correspond to particular phonemes.

Re: Radiation-hardened quine

#53
post #38

Earlier quoted context omitted.

> an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Do any languages have an alphabet according to this definition?

Korean?

IIRC Hangul has some weird pronunciation quirks depending on where some letters are in a syllable.

Re: Radiation-hardened quine

#54
post #38

Earlier quoted context omitted.

Since we're being technical, Japanese does not have any alphabet as such; an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Japanese uses syllabaries ('kana' in Japanese), where almost all characters represent more than 1 sound. Hiragana is typically used to write Japanese words and grammatical particles, while katakana is typically used to write foreign words and for spe…

> an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Do any languages have an alphabet according to this definition?

Cyrillic-using languages generally do.

Re: Radiation-hardened quine

#55
post #38

Earlier quoted context omitted.

> an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Do any languages have an alphabet according to this definition?

Korean?

At the least, Korean has voiced-versus-non-voiced-depending-on-word-position changes, and IIRC there are other similar rules (about changing pronunciation in certain contexts) as well.

Re: Radiation-hardened quine

#56

Earlier quoted context omitted.

The Japanese use Chinese characters. The Japanese also have alphabets. (At least two.) But Chinese characters aren't exactly an alphabet and the Japanese don't use Chinese characters directly as an alphabet, though many characters are based on Chinese ones.

Since we're being technical, Japanese does not have any alphabet as such; an alphabet has, by definition, a 1 to 1 correspondence between a single character and a sound. Japanese uses syllabaries ('kana' in Japanese), where almost all characters represent more than 1 sound. Hiragana is typically used to write Japanese words and grammatical particles, while katakana is typically used to write foreign words and for spe…

> Japanese is a language isolate, a language that is not related to any other known language. Someone will reply that it's distantly related to Korean, but this is a fringe theory in linguistics that is not widely accepted

When using some strict definition of "related" (e.g. "neither language is a strict descendent of the other"), that may be true, but anybody that's studied both languages has probably noticed that there's an eery similarity between the two, even if it's merely the result of many centuries of cross-pollenization....

My own experience is not so great, I've only studied Korean a bit, but I did study it in Japanese (which I know fairly well), and the similarity made it a lot easier, because so many things corresponded 1-to-1... However Korean friends that are fluent in Japanese constantly rave about how easy it was for them to learn, not just because of the huge amount of shared Chinese-derivative vocabulary (many words are completely identical, with formulaic changes in pronunciation), but because the whole structure of grammar, sentence/conversation-planning, idioms, etc, is so similar that a huge proportion of their Korean instincts pretty much just work as-is in Japanese.

Re: Radiation-hardened quine

#57
post #15

Here's the google translate link to his blog post about it. My favorite part: "Ruby I terrible." http://translate.google.com/translate?sl=auto&tl=en&js=n&pre...

The whole paragraph can be translated like this:

"I didn't really think I'd be able to write this [program], but somehow I was able too. Ruby is scary, isn't it? I wonder if you could write this in another language?"

Re: Radiation-hardened quine

#58

Interesting! Does anyone know of a language or operating system that uses Reed–Solomon error correction on every file? https://en.wikipedia.org/wiki/Reed–Solomon_error_correction Or to top that, imagine a computer where the entire memory space, perhaps shared with persistent flash memory, was encoded in this manner, so that even the filesystem was protected against bit flips. When I was doing Mac repair a few years b…

In the early 1970's I implemented the driver for, and programs using, a digital videotape drive (IIRC, it incorporated an Ampex 2 inch reel-to-reel recorder, and used the sound track for positioning information). It used hardware Reed-Solomon error correction (IIRC, it was capable of correcting up to 11-bit errors). It stored a massive (for the time) database of scanned drawings for a number of aircraft maintenance manuals.

Re: Radiation-hardened quine

#59
post #9
post #5

I can't read this code at all, but, does this code basically contain the same code twice, so if something from the first half is removed the second half saves it?

Yes, Line 15: /#{eval eval if eval==instance_eval}}/.i rescue##/ They are checking the two instances and rescuing the corrupted one. But how exactly it works is beyond me.

Also, in line 17, I think it's running whichever of the two codes is longer (since the longer one is the one that didn't have a byte deleted)

    eval eval"[eval||=9,instance_eval||=9].max_by{|s|s.size}#"##"
See the max_by ... size part

Re: Radiation-hardened quine

#60

I was curious how well this quine would withstand having more than one character removed, so I performed a test. I did 1000 iterations removing 2 characters each time, then 1000 more removing 3 characters each time, and so on. Here are the results up to 23 removals: http://i.imgur.com/PwWN7Z7.png

Nice, Love it when people actually perform experiments! :D In how many cases was the wrong output still functional?
Post reply on HN