TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

SVG Is Turing Complete

101 点作者 pentestercrab超过 5 年前

8 条评论

adrianN超过 5 年前
SVG doesn't contain looping constructs AFAIK and is thus not Turing complete. Copy pasting lines that simulate one step of a TM is not the same.
评论 #20982411 未加载
评论 #20982436 未加载
评论 #20983945 未加载
评论 #20982536 未加载
评论 #20982410 未加载
评论 #20982431 未加载
评论 #20983815 未加载
评论 #20982214 未加载
Gehinnn超过 5 年前
I wouldn&#x27;t say this proves that SVG is turing complete. I don&#x27;t see why a perfect (i.e. correct and complete) SVG interpreter could solve the halting problem using this idea. Computationally speaking, specifying each iteration manually is equivalent to directly drawing the final image - the difference is just the representation.<p>However, it&#x27;s nice to see how expressive SVG is.
评论 #20982120 未加载
评论 #20982136 未加载
jasonhansel超过 5 年前
If SVG were actually Turing complete, that would be a serious bug in the SVG spec, since it would be possible for the SVG layout algorithm to never terminate.
grenoire超过 5 年前
Unfortunate about the performance. A side question I have is whether or not this is Turing complete given the lack of looping and recursion possible (at least in this example). The author defines each iteration &#x27;manually.&#x27;
评论 #20981844 未加载
saagarjha超过 5 年前
&gt; Runs in Chromium 73.0.3683.103 after several seconds, seriously, this thing is slow!<p>Interestingly, this renders on my iPad almost instantly.<p>Also, fun fact: you can embed JavaScript in an SVG. Just add a script tag: <a href="https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;SVG&#x2F;Element&#x2F;script" rel="nofollow">https:&#x2F;&#x2F;developer.mozilla.org&#x2F;en-US&#x2F;docs&#x2F;Web&#x2F;SVG&#x2F;Element&#x2F;scr...</a>
评论 #20983820 未加载
评论 #20982389 未加载
评论 #20982182 未加载
_5659超过 5 年前
It seems trivial as a naive guess that SVG is TC if it can contain JavaScript, which is TC.<p>However, the posted solution seems inelegant and uncompelling. Simply iterating in SVG, which can infinitely scalable.<p>The author expresses apprehension in this closed issue: <a href="https:&#x2F;&#x2F;github.com&#x2F;tom-p-reichel&#x2F;svg-is-turing-complete&#x2F;issues&#x2F;1" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;tom-p-reichel&#x2F;svg-is-turing-complete&#x2F;issu...</a><p>It is mentioned that they intend to demonstrate this using feComposite in the source code.<p>There are bits and pieces of how one would prove TC for SVG.<p>A first step, would be identifying basic operations, as they have done. The next step would be compiling to a tag system, and simulate cyclic tag behavior.<p>It is expressed elsewhere that the lack of loops would exempt TC. Perhaps it can still be argued through DOM manipulation.
im3w1l超过 5 年前
SVG can contain javascript, so yeah.<p>E.g. <a href="http:&#x2F;&#x2F;srufaculty.sru.edu&#x2F;david.dailey&#x2F;svg&#x2F;clipdrag12.svg" rel="nofollow">http:&#x2F;&#x2F;srufaculty.sru.edu&#x2F;david.dailey&#x2F;svg&#x2F;clipdrag12.svg</a>
londons_explore超过 5 年前
On Chrome android I get a SIGSEGV in the GpuWatchdog process of Chrome. No stack gets decoded.<p>Interestingly, it only happens if I plug in or remove the power cable while the page is loading. It happens reliably.
评论 #20982122 未加载