
Silon – Adders and Logic Gates in Pure CSS - stirno
http://silon.slaks.net
======
jacquesm
In case you're wondering what makes it tick:

[https://github.com/SLaks/Silon/blob/gh-pages/styles/basic-
ga...](https://github.com/SLaks/Silon/blob/gh-pages/styles/basic-gates.css)

~~~
teraflop
Aww, after seeing that I'm a little disappointed.  Each CSS file is basically
just a giant truth table that describes which state each bit should be in
under all possible combinations of inputs. 

It makes for a cool demo of how simple Boolean circuits _work_ , but you can't
really say it's "doing computation" in CSS when all of the actual computation
has been done ahead of time. 

Still, it's clever. 

~~~
pdkl95
Using a lookup table is a valid way to implement something.  It is used often
for precalculating expensive functions. ( trig tables are very common).  This is
just one extreme of the runtime-vs-memory trade-off. 

~~~
TD-Linux
On FPGAs, it's actually how most logic functions are implemented.  FPGAs are a
big grid of SRAM-based lookup tables, some latches and fixed function blocks,
and a whole ton of interconnections. 

~~~
Dylan16807
But not a _single_ lookup table.  If you can chain lookup tables it's
equivalent to any other kind of gate.  If you have to process all possible
input combinations at once you can't do any meaningful computation. 

------
vardump
You can implement an adder in CSS?  Somehow this reminds me of C++ templates. 
These things seem to gain power and have new features until they become
turing-complete.  And beyond...

~~~
devsquid
haha, thats a funny thought.  I like CSS.  I would love for it to have variables
so I could consolidate changes and edit them via JS.  Sorta like all the CSS-
libraries. 

o.o am i doing it?? 

~~~
girvo
I highly recommend checking out LESS -- even if you ignore all of it's
features, being able to define variables alone is worth it :)

~~~
devsquid
Yes i have been meaning too

------
devsquid
Hey heads up Steve Gibson of the Security Now podcast just shared your
website.  You might be getting a ton of traffic, if thats a concern

~~~
nosir33
Maybe I missed it.  What's the security connection here? 

------
tombh
Very cool :)

I didn't realise you could click on them until after a good while though. 

------
devsquid
Good job man! 

------
nickysielicki
this was the coolest thing I've ever seen in my entire life. 

~~~
jacquesm
Why? 

~~~
nickysielicki
Because this is _hacker_ news, and this is a really cool CSS hack. 

~~~
jacquesm
I agree it is a cool hack.  I was wondering why you thought it was the coolest
thing you'd seen _in your life_ , rather than say this week or maybe even just
today. 

------
crimsonalucard
It's like programming with a crayon on a dirty wall.  Sure.. but why?