4 ms·
Canvas is written with a imperative (Turning complete) language. SVG is declarative. Pretty large difference.
by paulddraper 10y ago
Canvas is written with a imperative (Turning complete) language.
SVG is declarative. Pretty large difference.
- pavlov 10y agoPostScript/PDF is also an imperative language. Yet it works for billions of documents. Users don't care about Turing completeness. "Declarative" is one of those concepts that sounds highly desirable until you start thinking about extensibility and future inter-implementation compatibility. The sad tale of the SVG 2 standard, as told in the original post, is a textbook example.
- xioxox 10y agoPDF is not a Turing-complete, but Postscript is. PDF removed several features which made Postscript a programming language.
- pavlov 10y agoThat was a great approach IMO. First build a flexible toolset that allowed the market explore the problem space, then, a decade later, collect the learnings into a new, narrower standard. If SVG 2 were like that, it probably would have got a warmer reception from browser vendors. But standards committees creating declarative formats have never been very interested in removing features.
- tonyedgecombe 10y agoI'm not sure I would call PDF a narrower standard, one of the problems with it is Adobe couldn't stop themselves adding new features.
- bryanrasmussen 10y agoSVG is a declarative markup language that can include a Turing complete scripting language. I mean it is a pretty large difference, and it's even a pretty large difference between how you described SVG and how I did it, and neither one of us is complete.
- paulddraper 10y agoFor graphics and animated graphics, no Turning language needed. (Interactive graphics of course is different.) Moreover, very few SVG viewers would interpret embedded JS.
- bryanrasmussen 10y agofor animated graphics no Turing language needed - true. However a Turing complete language can sure make things easier. Also for animated graphics some things that are not interactive (if we defined interactive as meaning with user interaction) like randomness for example - need something similar to a programming language to do it.