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.

SVG Is Turing Complete

101 pointsby pentestercrabover 5 years ago

8 comments

adrianNover 5 years ago
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 未加载
Gehinnnover 5 years ago
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 未加载
jasonhanselover 5 years ago
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.
grenoireover 5 years ago
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 未加载
saagarjhaover 5 years ago
&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 未加载
_5659over 5 years ago
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.
im3w1lover 5 years ago
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_exploreover 5 years ago
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 未加载