319 points · by akkartik · 10y ago · 57 comments
This section reminded me of something a friend posited about space travel.
There are some inventions that just being exposed to the idea of them is enough to invent them. For instance, it seems that cultures that encounter others that have written language fairly quickly invent their own, even without knowledge of how the others work. The Cherokee syllabary was invented by an illiterate silversmith in the 1820s after he saw other people communicating via paper and knew that they represented a way to transmit information (https://en.wikipedia.org/wiki/Sequoyah#Sequoyah_and_Cherokee...). The writing system that he invented was a syllabary, not an alphabet like the people he'd been observing or a logographic system like some other Native American languages. Having a writing system is a contagious idea all its own and knowing that they exist is sufficient to invent one.
It may be that efficient space travel is one of these inventions: just seeing someone else do it may be enough to invent it ourselves. I don't mean in the sense that we may observe details that give us hints as to how it works (though that's probably also true), I mean in the way that the article says "If nobody had gotten to the score of 180 before me, I couldn’t have thought of any faster way of solving this puzzle. Without that piece of information, the brain just comes up with reasons why the score is already optimal". Simply observing working space travel may be enough for us to invent it ourselves. We may even invent a system entirely unlike the one we observed.
[0] https://nevalalee.wordpress.com/2016/09/28/astounding-storie...
[1] https://archive.org/stream/galaxymagazine-1956-11/Galaxy_195...
And even in computer science you have that kind of inequality of difficulty of problem and solution: NP is the class of problems in which solutions can be checked if they are correct in polinomial time.
For some reason, the alphabet seems to be extremely difficult to invent. IIRC it only happened once, with the Jews laying down the foundations and then the Greeks actually taking it all the way with vowels (I shudder to think what the world would look like if the Bronze Age collapse hadn't wiped out literacy in Greece). OTOH syllabaries/logographic systems have been invented independently a _lot_ of times all over the world.
Alphabets, abjads, and abugidas were effectively independently invented only once (it's debatable to what degree the creators of Hangul were aware of other alphabets). Syllabries appear to be the very natural development of writing.
You might be right, although the one known invention of it spread around pretty well, seeing as the Phoenicians primarily got around by sea. And I'm not sure it's always needed: while I'm not familiar with Cherokee, to the extent I understand Japanese, at the lowest levels it's encoded as a syllabary because that's the way their language works, and the ideographs they borrowed from China known as kanji in part help to distinguish between the many homonyms that are inherent in such a language, with the relatively few exceptions to strict use of syllables either easily encoded or a matter of spoken dialect.
I'm jealous you found such a great friend to play the game with. ;-) I found the game interesting but without social interaction it wasn't able to keep me engaged... So I uninstalled it after a day or so.
Secondly... I reinstalled the game and opened up the second puzzle to see what my score was. Surely _my_ solution must have been better than the standard 240? Nope! Now I'm scratching my head trying to figure out how you did it. You bastard! ;-)
I'm in a university, surrounded by people who do this sort of thing for fun, and no one I know will play the game. We've come to jokingly call it "work-simulator" and most people I've talked to who should enjoy this game just see "oh no it's work".
That sort of thing seems like a better use of my time than playing a game. Then again, there are times when I just want to play a game, and I don't want to code, so I don't begrudge anyone how they choose to spend their time.
Also point #4, he writes an interactive write-compile-test system using an executable hooking into a shared library which contains all of your code. That way you can compile and see the results quickly on a still running executable of your game. Very fast feedback without having to "respawn" to a part of your game to test.
I've played many hours of this game and have committed many grievous programming sins to improve my scores.
This is also known as Goodhart's law: https://en.m.wikipedia.org/wiki/Goodhart%27s_law
Now, if you were talking about the DCPU-16, I'd agree.
Since real instruction sets have to be practical for production use, I imagine it would be harder to get the same effect.
Plus you wouldn't get cool features like being able to conditionally execute every instruction.
https://en.wikipedia.org/wiki/ARM_architecture#Conditional_e...
You would be very close if it were ARM :)
My wild guess is that the developer wisely chose to sidestep imbalance towards parts of his public and any possible IP issues on the IS. Plus if he writes this kind of games he probably had fun writing his own IS.
I'm not so sure. Have you ever hand-optimised asm? I recall spending hours if not days trying to reduce the instruction count by 1 or 2 instructions in a tight DSP loop (Motorola 56k). It always seems like an interesting puzzle to me.
(Also anyone interested in TIS-100 and Shenzhen I/O should at least take a look)
mov p0 acc # place input value into internal register
mul 2 # multiply register by 2
mov acc p1 # place register value into output
slp 1 # sleep 1 cycle, wait for next input
The only way (I can think of) to optimize this is by cheating, i.e. by writing an algorithm specifically fitted for the kind of input we have to deal with. Looking at the input, we see that for example there are only 3 input values (0, 25 and 50) and there seems to be more zeros than other values. Based on this info we can try to predict what value is likely to show up as input and follow a dedicated path to handle it, in order to be as efficient as possible.I must admit I was happy with the 240 solution and never thought there was a better way until I read this article. Now I feel obliged to at least go down to 156 :D
Programmers must stop equating cheating with engineering.
Shenzhen I/O is a great game too! But I got stuck at one point and as another comment points out, I also gave up on it. Maybe it's time to log into Steam. :)
I've noticed your recent, prolific rise to prominence here on HN. You seem to have come out of nowhere and shot past most other users whose accounts are much older. I would be interested in reading an article from you on what you've learned and observed over the past year.
[Boy, harsh. It's not like there's an email address on the guy's profile. Guess I should have contacted him telepathically. Yet another reminder to keep showdead on.]
Well, since you asked...
The most important thing that I've learned is that it's a good idea to put yourself out there: Say what you think, be honest, and be ready to defend your ideas (but also be ready to admit you were wrong if you find out that you are).
Also, don't worry about the possibility saying something stupid. Some of the best conversations I've had on HN happened because I said something stupid: If you say something stupid, that usually means that you aren't well educated in that area, and hold misconceptions. It's best to get those misconceptions out there, so that you'll know that they're wrong.
Remember to attack ideas, not people. Even when you really, really, want to attack people. It's not worth it.
Don't focus on your karma too much: just because you got downed doesn't mean it wasn't worth saying.
And yes, unit tests usually are automated. They are however just one type of automated test, and at the smallest scale too. Integration and system tests are just as important and can give much more bang for much less buck.
Some of the optimization techniques I found before life took my interest away from the game (we[0] are building a real embedded system of significant complexity, and actually visited Shenzhen a few months ago) were judicious use of leading @SLP (usually as a final optimization), use of memory (acquired later in the game) instead of processing inputs, careful investigation of the limited use of conditionals to split codepaths, and basic addition using shared buses.
Also, to some extent, Shenzhen I/O = TIS-100 + SpaceChem
TIS-100 felt more like building some interconnected pipeline but Shenzhen feels more microcontroller-y
Now for that second campaign...