Ask HN: What would alien code look like?
Disclaimer: Not a programmer, but semi-technical and know a little bit about engineering concepts.
That said, lets be imaginative for a bit and pretend we made contact with an advanced space travelling race of alien. We have the opportunity to look their technology and programming behind it.
What do you think would be significantly different from the way they write their code and ours? Would they have the same logic as us? Could they use logic gates that we don't have yet? Would their computers have to be based in binary? What could they use instead?
Fundamentally, could their programs be translated directly into human code, like C++, or would a difference in conceptual understanding be so different that human code could not express alien logic?
Feel free to let your mind run with this. Would love to hear some crazy thoughts. Thanks
36 comments
[ 4.1 ms ] story [ 114 ms ] threadWe would have to overcome whatever language barriers we find before being able to do the equivalent of "programming" - I don't think there would be any language below whatever their equivalent of microcode though, nor do I think any language could express everything necessary.
Well, maybe Lisp ;-)
...Since Earth code is fifty years old, and Martian code is fifty million years old, Martian code has been evolving into a big ball of mud for a million times longer than Earth software. (And two million times longer than Windows...)
...There is only one thing to do with it: obliterate the trunk, fire the developers, and hire a whole new fscking army of Martian code-monkeys to rewrite the entire fscking thing.
This is such an obvious and essential response to the big ball of mud pattern that, despite the fact that we know nothing about Mars, we can deduce that it must have happened on Mars. Probably several times. Probably several hundred. For each of these attempts but the last, of course, the result was either (a) abject failure, (b) another big ball of mud, or (c) both.
But the last, by definition, succeeded. This is the crucial inference we can draw about Mars: since the Martians had 50 million years to try, in the end they must have succeeded. The result: Martian code, as we know it today. Not enormous and horrible - tiny and diamond-perfect."
No comment on what follows, but you might find it entertaining.
http://moronlab.blogspot.com/2010/01/urbit-functional-progra...
Notable concepts from the article: a "fixed-point" of language design, the idea of working backward from an aesthetic (Martian) to a language, and Kelvin versioning, in which "releases count down by integer degrees Kelvin. At absolute zero, the system can no longer be changed."
It's true, though; I found the actual language the author's made (or is still making?) to be pretty opaque.
The kind of programs we know today (encoding static text segments using a tower of abstractions and compilers) would still continue to exist. What we today call "programming" as a whole, will be what aliens call "embedded programming"—the kind you do under severe resource-constraints, where every gate must be secure, reliable, and could be hit with hard radiation at any time. We'd easily be able to understand these programs, given an appropriate disassembler. They would likely be written mostly by constraint-solving AIs, however, not tediously by aliens, who have better things to do. Aliens would, however, check them over out of paranoia/"defense-in-depth." They would be intensely parallel: imagine how NASA shuttle software works, with several independently-contracted codebases on independent hardware voting on each decision—but multiply the scales a millionfold.
Most programs, however, would not be "embedded"; they could expect to rely on a "silly" amount of resources. They would be inscrutable, mostly JIT-genetically-evolved from small "goal scripts" (which themselves would still, indeed, resemble human source code—clear and exact communication of rules and intent within a business domain survives no matter the language used.) They would rely on a "universal library" of "common sense", both in process knowledge (algorithms, protocols) and semantic knowledge (datatypes, fixtures, "facts" in the RDF sense) that would allow programmers to actually write "Do What I Mean" programs as well as could ever be achieved.
There would only be a single "programming language", for the same reason that we, today, have a Unicode character encoding. All programs would be internally stored in something resembling S-expressions (just a binary-encoded tree), and represented, textually or graphically (or audially or kinesthetically or experientially or somatically or telepathically...) through a bijective transformation. Every identifier in a program would be a universally-unique resource-locating ID (i.e. something that is both a UUID and a URL) allowing for importing of live code from external (network) libraries, cross-program optimization and symbolic unification, global API versioning, and removal of all "name clashes."
Also, a bonus sociological perspective: there would be living software—like with carbon-based life, we would classify software into "plants" (natural resources that we care about mostly as an enabler), "animals" (feeling but unthinking goal-directed objects that we think should have some, but not all, the rights of sentients) and "people" (which would have just the same rights bio-people do.) "Animal" software would have control systems that mimic (or simply are) emotions; an alien Roomba would indeed be considered a pet. But in the converse view, the aliens would consider genetically programming carbon-based plants and animals to have symbiotic functions, just as we currently live in symbiosis with robots and machines. They might all be ultra-vegans, for the simple reason that any combination of flavor, texture, and nutritional content could be turned into the fruit of a plant (a symbiotic arrangement), and so would abhor the non-symbiosis with which we consume our own environment.
I think that's a bit optimistic. Even within the realms of human programming languages, competence may require struggling with concepts that are as difficult as, say, monads or virtual destructors or Prolog cuts or abstract factory factory factory factories or call-with-current-continuation. Those are all at least one step up from recursion or pointers. I don't see any reason to expect that alien languages would be nearer in conceptual difficulty to C than to Haskell or C++ or Scheme or Prolog.
One thing I would bet on is that they wouldn't code in anything resembling C++. Even now, only a handful of decades into human computing, languages are becoming increasingly high level and abstracted from the machines themselves. Assuming that our alien friends have had a few centuries / millenia to improve on things, I'd expect that they'd have progressed to much more intuitive, more automated, and less detail-oriented methods. Especially if we assume that they've developed reasonably strong AI, the very idea of "programming" could be as strange to them as someone building their own computer from wire and logic gates would be to us.
They don't have to be binary, but it's a lot easier, so it's a near certainty. Plus true/false is also fundamental.
So I think at a low level it'll be pretty similar.
Math is usually considered to be universal, and computers are based on math, so that will all be the same.
Memory access however could be totally different. Our machines are Von Neumann, but aliens could use a totally different architecture.
[1] There is one gate for each combination of binary input and output. There are three inputs: 0 0, 1 1, and 0 1 (1 0 is the same thing). For each input there are two possible outputs, total 6. There are 6 gates: and, or, xor, nand, nor, nxor (xnor)
Or put another way:
(A gate that always returns 0 or 1 is useless, so those two don't count.)If you want logic gates that depend on position, then you have more options (16 in total, compared to the 8 I listed), and you can see them here: http://en.wikipedia.org/wiki/Logical_connective#Table_of_bin...
Our computers don't use them, I suppose alien ones could, but I doubt they would.
http://news.ycombinator.com/item?id=397335
The memristor is an imply gate:
Edit: jonsen's post has better information. I was indeed thinking of a memristor.
The complexities would have to be abstracted away, and if they were space travelling, the abstractions have to be reliable. So probably, by the time we meet them, they have some type of black-box elementary code particulars for many different functions that everyone needs to join together to produce machines.
Probably, they would have developed some type of inform interface method, where you can specify what you want in and out and the appropriate atomic block gets delivered to you. They would have some type of global repository that harnesses the power of many different individuals working on problems to avoid any form of repetition.
Currently, we interface with code through typing. This is inefficient for us, and we don't know how they will coummicate. However, for them to be capable of abstract though, they will need to create pictures in their mind. It does not seem farfetched to assume that they have much faster interfacing methods that work directly on pictures they visualise. This allows them join the atomic blocks much quicker.
In effect, they will try to eliminate the manual work entirely, and only do the specifications part of things (tell it what you want), and let the computer build the rest of the things.
On the other hand, perhaps they lack our sense of moral, and will work with biological computers, and not metal-based.
http://en.wikipedia.org/wiki/Balanced_ternary
I first learned of balanced ternary from this article:
http://www.americanscientist.org/issues/id.3268,y.0,no.,cont...
(Beware; the balanced-ternary example values there don't seem to be rendering negative digits correctly.)
Whether we look at snails with 12 neurons for a brain, or a human or cetacean that have the most complex brains on earth, the biochemistry behind how they work is all rooted from the same evolutionary source.
We can hypothesize that on a another planet where life arises using the same kinds of naturally occurring elements (hydrogen, oxygen, carbon, nitrogen, etc etc), and that this life lives in a similar environment (a warm, wet, ball of rock) that we might see convergent evolution across many, many worlds that share these properties.
DNA is what life here on Earth eventually settled on, but remember that the latest theories of life's beginnings on our world is that RNA probably came first. So its not 100% proof positive that DNA or its chemical equivalents are the only way to make a living, complex cell. Different replicative mechanisms could create different biochemistry, even on a world that is nearly identical to Earth.
The point of this is that even on a world with a different kind of replicative biochemical system, complex life could evolve similar large-scale structures. Fins for the water, legs for land, wings for air, eyes for seeing, etc, etc.
So, does this hypothetical situation also extend to things like brains? If this alternate biosphere uses a chemical system very different from DNA, how does that affect the chemistry of what makes a brain? Perhaps arsenic is like seratonin or dopamine, for example.
Putting aside the chemistry for a moment, does a similar physical environment that encourages things like legs, eyes, and skin encourage the development of similar brain structures to control those systems? Or, are there vastly different kinds of brain structures that can control the stuff that makes up a body?
IBM has been working on simulating the neuronal columns that make up a cat brain. Mice, cats, and humans all share some variation of these columns. It makes sense because we all share common ancestors and we inherited these basic structures from them. But would we necessarily expect to see these structures in life coming from a different biochemical history?
So pulling this back to the original question, how much of our mathematics and computing models correspond to how our form of intelligence has evolved?
Based on the universe we can see and test, we have developed a very large and thorough mathematical knowledge-base of how the universe fits together. But it does beg the question, if another kind of sentient life discovers the same mathematics do they utilize that knowledge in the same ways that we have?
Binary logic is a very efficient way to do our kind of computing. But its not the only way. Quantum computation is an easy example of a non-binary way to do computation. We've also only been doing this for a little over a century, and if we can take anything from the lessons of history its that we should never assume what or how we do something now is going to be the best way for all time.
I can't and shouldn't offer a definitive answer to the question. No one on Earth can provide anything more than a strong hypothetical argument one way or another. Remember, black swans and all.
What it would take to answer this would be to find that ever so elusive alien tech and stick some probes in it and start studying it. Experimental evidence is the only way to ever really prove something.
I will offer a hypothetical answer though, here at the end. From everything I have learned in my life, its likely that math and physics work everywhere we can see. And we can see a long, long way away. Even if some sentients on another world with a vastly different arrangement of biochemistry and thinking-stuff (aka brain analogues) invent their types of 'computers' that work differently tha...
However we only engage directly with a small subset of the universe and in ways that have been evolutionarily useful.
Aliens might well have evolved to engage in a different subset.
We certainly have different subsets here on Earth -- consider colour vision for example and the effects on colour coding interpretations between humans, fish, birds, reptiles, bees, etc.
Communication requires being able to predict response to stimulation. The degree of similarity with which we perceive a given stimulation will determine how well we can communicate.
Computer programs can been seen as a kind of communication with a computer, and it only makes sense for programs to be written in a convenient communicative form.
While it might seem obvious that aliens would use digital computers it isn't necessarily so.
Analog computers might make more sense for them -- the main reason we don't use them much these days is that they're hard to reprogram -- but with nanotech or biotech it might be far more trivial.
There are also quantum computers, and non-electrical computational systems.
People also assume numeracy, but consider aliens without recursion which deal with numbers by subitization up to some large quantity rather than counting.
It's very possible that there's things we can't imagine how to begin answering (even things we really care about) that another species finds trivial. Or funnier, we could have roughly similar mental powers, but our thought processes are so different that each species' insights seem entirely mystical to the other.
I hear that psychologists (and following them, AI researchers) keep finding that intelligence is buried in our visual and lingusitic systems. What if these aliens have very different organs? http://www.youtube.com/watch?v=auXQtoAyCGA&feature=PlayL...
And off-topic, might this explain "rubber-duck debugging," where we explain our problems to a rubber duck? (Because using language clarifies our thoughts.) And why we often write pictures on paper to better visualize abstract problems? (To leverage our powerful visual apparatus.)
Admittedly, programming has mathematical foundations (algorithms) so it has a good change to still be relevant.
If they do have programs, then the according to the Church-Turing thesis the programs could be translated to human code, but not necessarily in a clear way.
The same holds for us, we are sending robots already and it will only be more and more robots in the future.
Also, "artificial" AIs will be the ones doing the programming. They can be extremely more complex than humans, because their electronic brains can actually be scaled up, and new data can be much faster interpreted and shared.
The code they write will be machine code, because they can compile their own abstract ideas themselves. On a low level the code will be extremely optimized. Like how an expert human programmer would optimize his 100 lines of assembly code in the 70s.
Resources will not be wasted, in fact they will have way more computing power and use it very effectively at the same time.
So, how would the code look like? Sadly only ones and zeroes. We would have to translate it to assembly ourselves and then extract more abstract concepts of it, for us to understand it.
This doesn't seem likely. Unless this alien species is isolationist to the extreme, they'll need to communicate with others of their species. Therefore they need a language that can communicate high-level concepts, something assembly is not known to be good at doing.
Or to put it another way, even though we communicate with our bodies in a very low-level way (sending neural impulses to contract or relax muscles), our language is very high level. We don't say, "Fire neuron 10212, fire neuron 39232...", we say, "Come over here, please." We don't think in terms of firing neuron either; that's a job for the low-level subconscious.
In a similar way, I'd expect any artificial life form to have a language to express high level concepts, and "compile" with their subconscious.
[1] At least that is how I see mathematics right now as a math/cs student; please correct me if I am mistaken.