this was the coolest thing I've ever seen in my entire life.
Silon – Adders and Logic Gates in Pure CSS
11–20 of 40 posts
Re: Silon – Adders and Logic Gates in Pure CSS
#12In case you're wondering what makes it tick: https://github.com/SLaks/Silon/blob/gh-pages/styles/basic-ga...
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.
Re: Silon – Adders and Logic Gates in Pure CSS
#13In case you're wondering what makes it tick: https://github.com/SLaks/Silon/blob/gh-pages/styles/basic-ga...
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.
Re: Silon – Adders and Logic Gates in Pure CSS
#14Earlier quoted context omitted.
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.
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.
More to the point, Boolean expressions and truth tables are not equivalent representations that should be treated on an equal footing; there's an exponential blowup involved when converting from one to the other. Just try extending that 4-bit adder to 16 or 32 bits. The functions that can be tractably represented using this scheme are a strict (very small) subset of the functions that can be computed by true Boolean circuits.
Re: Silon – Adders and Logic Gates in Pure CSS
#15Earlier quoted context omitted.
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.
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.
Re: Silon – Adders and Logic Gates in Pure CSS
#16Earlier quoted context omitted.
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.
Sure, but if the headline was "CSS can be used to implement a lookup table", it would be much less eye-catching. More to the point, Boolean expressions and truth tables are not equivalent representations that should be treated on an equal footing; there's an exponential blowup involved when converting from one to the other. Just try extending that 4-bit adder to 16 or 32 bits. The functions that can be tractably repr…
Re: Silon – Adders and Logic Gates in Pure CSS
#17You 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...
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.
Re: Silon – Adders and Logic Gates in Pure CSS
#18Earlier quoted context omitted.
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.
Sure, but if the headline was "CSS can be used to implement a lookup table", it would be much less eye-catching. More to the point, Boolean expressions and truth tables are not equivalent representations that should be treated on an equal footing; there's an exponential blowup involved when converting from one to the other. Just try extending that 4-bit adder to 16 or 32 bits. The functions that can be tractably repr…
It is the programmer's job to decide what point on the "using storage""using CPU time" continuum is appropriate for the current problem. Obviously, larger chained adders at 16 or 32-bits would be crazy. (of course, at that point you would want to implement a carry lookahead anyway to avoid the horrible propagation delay in the last carry bit)
Re: Silon – Adders and Logic Gates in Pure CSS
#19You 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...
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??
Re: Silon – Adders and Logic Gates in Pure CSS
#20Earlier quoted context omitted.
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.
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.