TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

HTML + CSS3 is Turing complete

152 pointsby bgruberabout 14 years ago

7 comments

elitheeliabout 14 years ago
Way to steal my karma.... :)<p>As the original author of this, I was going to put it into a much more presentable state before showing it off here.<p>For those confused, here's a proper explanation. No real-world thing can actually be Turing complete (able to express basically any computation that we might want to perform of any size). That's because there are finitely many atoms in the universe, so we can only construct machines of finite size.<p>It's well known that Rule 110 (Google it) is Turing Compete.<p>What I've done is made an implementation of Rule 110 in HTML and CSS. Since CSS can't actually really manipulate state, some user interaction is required to "drive" it. In the one that bgruber linked to, it's clicking.<p>Here's a bigger version that doesn't require the user to know where to put his mouse. The tab-space combo is just as legitimate as requiring that you plug a computer into a wall to power it in order to run a Java program. <a href="http://elilies.com/rule110-full.html" rel="nofollow">http://elilies.com/rule110-full.html</a><p>Also, I haven't tested it on anything besides the latest Chrome on Mac.
评论 #2301226 未加载
评论 #2301315 未加载
评论 #2301208 未加载
评论 #2301922 未加载
评论 #2301546 未加载
评论 #2302054 未加载
评论 #2301604 未加载
评论 #2301590 未加载
CJeffersonabout 14 years ago
I'd like a more complete description of this.<p>My first thought is "no it's not", because you are encoding a fixed-sized grid in the HTML, which is then the total extent of the program. While no real machine has an "infinite tape", I think requiring the tape be embedded in the program itself is strengthing things a little far.
评论 #2301182 未加载
评论 #2301162 未加载
评论 #2301169 未加载
kclabout 14 years ago
There are two competing definitions of Turing complete here.<p>1. The mathematical definition of Turing completeness: models which can simulate the computation of a hypothetical Turing machine. Idealized circuits are an example of this. Turing machines are an example of this. Programs with infinite memory are an example of this.<p>2. The colloquial definition of Turing completeness: this is naturally ill-defined, but it roughly means an automated, finite model that performs arbitrary computation. I would say that a robotic Lego Turing machine is Turing complete. C is certainly Turing complete in this sense. Basic HTML isn't. The set of regexes (e.g, unix wildcards) isn't.<p>However, if I can choose a large enough regex, I can construct a decider for a given finite language. How then are regexes less powerful than C? The answer is they are just as powerful in the finite case, unless we set reasonable limits on what we mean by 'finite' and 'automated.'<p>This HTML+CSS is not Turing complete. The idealized version of this HTML+CSS is not Turing complete (unless you strangely accept the idealization of a "hand pressing tab space"). This HTML+CSS is also not Turing complete in the colloquial sense: it doesn't live up to the generally accepted notion of automation. It isn't executed by the machine.
评论 #2302770 未加载
评论 #2301897 未加载
评论 #2302063 未加载
setnorthabout 14 years ago
As far as I remember is LaTeX (or TeX itself) touring complete, too. In the end, if you can simulate a turing machine (or another "equivalent" calculating "device") the language is itself turing complete. While not being a html/css wizard, by the amount of complex examples i saw you could do with only HTML/CSS3, I am not surprised that you can write a cellular automaton in it.<p>edit: typo (personal hangup with touring/turing)
评论 #2301201 未加载
评论 #2301190 未加载
sspabout 14 years ago
I'm probably tilting at windmills, but it's Turing <i>Equivalent</i>, not Turing <i>Complete</i>.
评论 #2302069 未加载
taylorbuleyabout 14 years ago
<a href="http://jsbin.com/owehi4/" rel="nofollow">http://jsbin.com/owehi4/</a>
hasenjabout 14 years ago
I don't understand .. explain?<p>EDIT: part of not understanding is I ran it in firefox 3.5 -- not good. works better in chrome.
评论 #2301129 未加载
评论 #2301168 未加载
评论 #2301021 未加载