
One instruction set computer - 0x12
http://en.wikipedia.org/wiki/One_instruction_set_computer
======
SimonPStevens
It's an interesting idea that pops up here every now and again. It's fairly
useless as anything other than a toy/educational system though.

I wrote a little OISC virtual machine and assembler a while back. I got as far
as adding interrupts to the system for keyboard input and console output
before I stopped.

<http://simonpstevens.com/projects/oiscvm>

Source code is on githib:

<https://github.com/simonpstevens/oiscvm>

~~~
0x12
Great to see you were busy with this.

Minimal architectures are interesting in their own right even if they don't
have an immediate practical application, though I can think of some fields
where they may be useful rather than merely a curiosity or a teaching aid.

I'll download your vm code and mess around with it some, thank you very much
for posting the links.

------
arethuza
On the functional side of things you can get by with just the two combinators
S and K:

<http://en.wikipedia.org/wiki/SKI_combinator_calculus>

You can define the Y combinator, and therefore recursion quite happily (if not
very efficiently) using S and K.

I believe there are also approaches that use as single universal combinator -
but I can't find any good references to these - I'd be quite interested to see
definitions of S and K in terms of a single universal combinator.

~~~
0x12
<http://en.wikipedia.org/wiki/Iota_and_Jot> <\- that one?

~~~
arethuza
I thought that definition looked a _bit_ like cheating - wrapping up S & K in
a form that makes it straightforward to get back to them!

There is also a U combinator referenced on this page:

<http://www.ucombinator.org/>

as U = λ f . f(f) - haven't had time to sit down and actually work it through
though.

[Edit: I notice that page says that U _enables_ universal computation, not
that it is sufficient.]

~~~
0x12
Yes, I agree it is a bit cheating.

They recover the S and K by applying U to itself in interesting ways, but
that's like saying 'this tool is so universal, you can use it as a hammer and
a chisel by banging one instance of the tool with another tool just like it'.

That's not a very mathematical way of putting it I guess but I believe that is
more or less the spirit of it.

------
0x12
For an encore: <http://en.wikipedia.org/wiki/Zero_instruction_set_computer>

------
bostonpete
Isn't this a bit of a misnomer? Wouldn't "one instruction computer" be more
fitting? I mean, every computer has one instruction set...

------
ableal
More of the same kind of amusement can be found on the esoteric languages
page, which explains:

 _A Turing tarpit is a Turing-complete programming language whose number of
commands, operators, or equivalent objects is very small. These include
brainfuck (8 commands, all with 0 operands), OISC (1 command, 3 operands), and
Thue (1 command, 2 operands)._

[http://en.wikipedia.org/wiki/Esoteric_programming_language#T...](http://en.wikipedia.org/wiki/Esoteric_programming_language#Turing_tarpit)

------
sambeau
It's always great to see Computing Theory posted to the HN homepage.

------
FeministHacker
This is a personal favourite of mine, and actually one of the key moments in
me and my girlfriend hooking up, strangely enough

------
ctdonath
A recent prior discussion of OISC processors brought up another HN
contributor's "Calculus Vaporis" <https://github.com/kragen/calculusvaporis>

------
andrewcooke
all of those seem to take operands. is it possible to have a single
instruction with no operands? alternatively, is it proven impossible?

[edit: langton's ant suggests so -
<http://en.wikipedia.org/wiki/Langtons_ant>]

~~~
jerf
Arguably, Rule 110 [1] fits the bill. Once you have your data, you just apply
Rule 110 endlessly.

One could argue that one has merely embedded the actual operands into the data
fed to Rule 110, and I would then observe that in the context of Turing
completeness, there is a fundamental fuzziness between data and code that goes
"all the way down". All your no-operands single-instruction can really be is
"do it", with "it" specified by the data.

[1]: <http://en.wikipedia.org/wiki/Rule_110>

~~~
wladimir
Right, this is very interesting, you are effectively running the data and code
intermingled instead of in different separate memory areas.

A fascinating thing about computing with rule 110 seems to be that it is
inherently parallel, the "instruction" is applied to the entire memory area in
lockstep. There is no control flow of any kind. So if you have static data you
need to encode it as "idle" instructions.

I/O is an even more interesting problem...

------
abcd_f
Well, hello there. Lean Brainfuck is coming right up.

