8 ms·
Why would you want implement a subset of SVG? It's native for browsers, and is surely supported in a plethora of languages using various libraries.
by bestest 4y ago
Why would you want implement a subset of SVG? It's native for browsers, and is surely supported in a plethora of languages using various libraries.
- aidos 4y agoHmmm. There actually a lot to it and you don’t want to end up in a situation where documents don’t render properly unless you’re using a really complete viewer.
- cxcorp 4y agoBecause standards compliant SVG introduces XSS surfaces.
- badsectoracula 4y agoNow you replaced a trivial file format that (from a quick glance at the code) needed about ~35 of easily readable and self-contained Lua code to parse with an external dependency that would be much larger and harder to follow and either having (at least) an XML parser as its own dependency or implementing its own XML parsing, as well as being at the mercy of their developers. Also unless you are using some highly popular library, you may end up with some abandoned dependency. Examples of both are at [0] (C++ based parser, you'd also need to write some bindings for lua) and [1] (Lua based parser for a subset of the format, abandoned for almost a decade). There are times when using an external dependency might be a good idea, but a text-based file format that describes lines and can be implemented in a few lines of code is not one. [0] https://github.com/svgpp/svgpp https://github.com/svgpp/svgpp [1] https://github.com/luapower/svg_parser https://github.com/luapower/svg_parser
- Athas 4y agoSome people appreciate simplicity as a virtue - simplicity of implementation as well. To such people, using a third party library to conceal an incredibly complicated implementation is still in principle ugly. I don't know if that is what motivated the author here, but I certainly know lots of people who would cite that as their motivation.
- jheriko 4y agohe used a gigantic and elaborate framework/engine filled with cruft... so i doubt that was the thinking here.