top | item 9567183

Silon – Adders and Logic Gates in Pure CSS

173 points| stirno | 11 years ago |silon.slaks.net | reply

39 comments

order
[+] jacquesm|11 years ago|reply
In case you're wondering what makes it tick:

https://github.com/SLaks/Silon/blob/gh-pages/styles/basic-ga...

[+] teraflop|11 years ago|reply
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.

[+] vardump|11 years ago|reply
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...
[+] pdkl95|11 years ago|reply
It's not really any surprise that templates (or CSS) could be Turing complete, as all the lambda() function does is the same thing a template does - replacing the macros in a template with an argument.

This is actually an important lesson that is often missed: if the app you're writing gives the anonymous users any kind of find/replace macro capability, you're giving them a fully Turing complete language (though it's probably not easy, but that rarely stops anyone) and all the potential problems that can bring.

[+] yellowapple|11 years ago|reply
Languages of the future will be compiled to CSS in the same way that languages of the present are compiled to Javascript.

I get shivers just thinking about all the fun I can have breaking web semantics this way.

[+] devsquid|11 years ago|reply
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??

[+] devsquid|11 years ago|reply
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|11 years ago|reply
Maybe I missed it. What's the security connection here?
[+] slaks|11 years ago|reply
I'm on GitHub pages, so I should be fine.
[+] tombh|11 years ago|reply
Very cool :)

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

[+] crimsonalucard|11 years ago|reply
It's like programming with a crayon on a dirty wall. Sure.. but why?