Neil's News

+ 2010
+ 2009
+ 2008
+ 2007
+ 2006
+ 2005
- 2004
 Silence
 Snowflakes
 Paranoia Pays
 Microsoft Help
 Polyglot 11: More C
 Polyglot 11: C
 Polyglot 10: Smalltalk
 Toronto Wisdom
 Exterminated
 The Last Straw
 BT Broadband Trap
 Polyglot 9: Moo
 Polyglot 8: SVG
 Polyglot 7: POV-Ray
 Polyglot 6: Python
 Polyglot 5: PHP
 Polyglot 4: Euphoria
 Polyglot 3: JavaScript
 Polyglot 2: Java
 Polyglot 1: VB
 POV-Ray
 Etch A Sketch
 Slashdotting
 Flashy Lies
 Scientific Illiteracy
 Creeping Featurism
 VidScope
 Saturn V
 Perspectives
 Slide Rule
 eBay Sale
 Iron Filings
 Gimble
 VBA Security
 Random Morsels
 Exact Change
 Easter Egg
 Diametral Pitch
 mod_deflete
 Ethical Spam?
 Deadlines
 CPU Power
 Fosdem 2004
 Academic Reversal
 Mars Memorial
 Culture Clash
 Watching the Users
+ 2003
+ 2002

Polyglot 8: SVG

2 October 2004

This one was somewhat unexpected. I started implementing the 'colours' application the Moo language, with the output being SVG. Then I discovered that SVG was perfectly capable of generating the pattern all by itself. Who needs the Moo?

SVG is a 2D vector graphics format, it doesn't really like being treated as a bitmap. Thus it takes a little while to render a large grid of pixels. The JavaScript code inside the SVG which does all the computations was lifted straight out of the earlier JavaScript version. SVG is an interesting format, but like all emerging formats it will remain confined to intranets, kiosks and other controlled environments until the majority of browsers can view it.

It would also help if it didn't allow hackers to crash SVG-enabled clients at will. It is trivial to build a memory bomb or infinite loop which crashes Adobe's SVG viewer and its host browser (bug reported to Adobe a week ago, no response received so far, though I'm sure my arrest warrant is in the post as usual). Mozilla is also vulnerable but it takes a bit more work [bug 261974]. I don't know if other implementations (Batik, XML::LibRSVG) are vulnerable.

Here's the SVG source code and a running implementation of the 'colours' program. Currently renders 50 times slower in Mozilla than in IE+Adobe.

< Previous | Next >

 
-------------------------------------