I wonder why round-trip is such a small concern for people implementing serializers/deserializers of various kinds.
I usually throw in an "Unknown" node type, which stores things unaltered until I can understand things again. The parsers I usually write are very small, so I haven't seen what issues comes up at scale, maybe there are dragons lurking .
I see the author is here — I wonder if you also handle PDFs? Quick look at the site indicates that yes, but could you tell more about it? Do you also have a custom parser/serializer? Do you allow for PDF editing?
The reason for asking, is that I've had a shower thought of building custom PDF/doc reader for myself, that would allow me to easily take notes and integrate with Anki. Been doing that in Obsidian with the pdf plugin, but it's too slow. At the same time, I've heard that PDF spec is not easy to work with, so I'm curious about your experience on that front.
The original Word format was a literal dump of a part of the data segment of the Word process. Basically like an mmapped file. Super fast. It is a pity that modern languages and their runtimes do not allow data structures to be saved like that.
The article links to a classic Joel on Software article "In Defense of Not-Invented-Here Syndrome" written in 2001.
It's interesting to see how this has played out 24 years later with "vibe coding" and how Amazon does business.
> Indeed during the recent dotcom mania a bunch of quack business writers suggested that the company of the future would be totally virtual — just a trendy couple sipping Chardonnay in their living room outsourcing everything. What these hyperventilating “visionaries” overlooked is that the market pays for value added. Two yuppies in a living room buying an e-commerce engine from company A and selling merchandise made by company B and warehoused and shipped by company C, with customer service from company D, isn’t honestly adding much value.
It could easily be the case that its just outside of the goals or scope of docx-rs, but I wonder. It would probably be pretty reasonable to add some kind of a catch-all "unknown" variant, that backs itself up with storing the names of tags as interned strings?
Justified under the idea that unexpected tags should be uncommon by the fact they are unexpected (if its common you should have expected it), and can be relegated to a less-performant cold-path as a result.
It would probably mean not having the most fun time ever for the developer depending on docx-rs if an explicit requirement is interacting with and modifying a tag that ends up in the "whatever" bucket, but at least you could make sure that you (de)serialize losslessly.
7 comments
[ 4.1 ms ] story [ 22.2 ms ] threadThe reason for asking, is that I've had a shower thought of building custom PDF/doc reader for myself, that would allow me to easily take notes and integrate with Anki. Been doing that in Obsidian with the pdf plugin, but it's too slow. At the same time, I've heard that PDF spec is not easy to work with, so I'm curious about your experience on that front.
It's interesting to see how this has played out 24 years later with "vibe coding" and how Amazon does business.
> Indeed during the recent dotcom mania a bunch of quack business writers suggested that the company of the future would be totally virtual — just a trendy couple sipping Chardonnay in their living room outsourcing everything. What these hyperventilating “visionaries” overlooked is that the market pays for value added. Two yuppies in a living room buying an e-commerce engine from company A and selling merchandise made by company B and warehoused and shipped by company C, with customer service from company D, isn’t honestly adding much value.
https://www.joelonsoftware.com/2001/10/14/in-defense-of-not-...
Justified under the idea that unexpected tags should be uncommon by the fact they are unexpected (if its common you should have expected it), and can be relegated to a less-performant cold-path as a result.
It would probably mean not having the most fun time ever for the developer depending on docx-rs if an explicit requirement is interacting with and modifying a tag that ends up in the "whatever" bucket, but at least you could make sure that you (de)serialize losslessly.