▲ 43 ▼ Everything about TOML format - Orchard Dweller (www.youtube.com) submitted 2 years ago by ruffsl@programming.dev to c/programming@programming.dev 50 comments fedilink hide all child comments Visualizer: https://toml-to-json.orchard.blog/ Code: https://github.com/orcharddweller/tom... TOML spec: https://toml.io/en/v1.0.0
[–] AMDmi3@lemmy.world 27 points 2 years ago (2 children) That's not a problem of a format and should be handled by transport or storage. permalink fedilink source parent hideshow 4 child comments replies: [–] Turun@feddit.de 4 points 2 years ago (1 child) It very much is an aspect of the format. You may deem it unimportant, but it's a feature that is missing from toml and yaml. permalink fedilink source parent hideshow 2 child comments replies: [–] AMDmi3@lemmy.world 4 points 2 years ago* It's not a responsibly of the format, so, at most, it's a mere side effect. In any practical process which could result with truncated data, even if it handles data with such property, it should be wrapped in a container which includes length. At the very least, it would allow to trace the source of truncation, e.g. was the data originally truncated, or was it truncated in the process, and change the format without shooting in oneselves foot. And the generating side should always provide success flag which should be properly handled, since it may produce syntactically correct, but semantically invalid data. Such as checking exit code of process which generates json/yaml in question permalink fedilink source parent [–] NewPerspective@lemmy.world 1 point 2 years ago (1 child) What about processes that terminate before writing the whole thing? You can't protect against everything. Blame other processes all you want but the language spec allows for confusion. permalink fedilink source parent hideshow 2 child comments replies: [–] AMDmi3@lemmy.world 2 points 2 years ago* (last edited 2 years ago) You just check the exit code, no? The other process may fail while generating syntactically correct data too, regardless of format. permalink fedilink source parent
[–] Turun@feddit.de 4 points 2 years ago (1 child) It very much is an aspect of the format. You may deem it unimportant, but it's a feature that is missing from toml and yaml. permalink fedilink source parent hideshow 2 child comments replies: [–] AMDmi3@lemmy.world 4 points 2 years ago* It's not a responsibly of the format, so, at most, it's a mere side effect. In any practical process which could result with truncated data, even if it handles data with such property, it should be wrapped in a container which includes length. At the very least, it would allow to trace the source of truncation, e.g. was the data originally truncated, or was it truncated in the process, and change the format without shooting in oneselves foot. And the generating side should always provide success flag which should be properly handled, since it may produce syntactically correct, but semantically invalid data. Such as checking exit code of process which generates json/yaml in question permalink fedilink source parent
[–] AMDmi3@lemmy.world 4 points 2 years ago* It's not a responsibly of the format, so, at most, it's a mere side effect. In any practical process which could result with truncated data, even if it handles data with such property, it should be wrapped in a container which includes length. At the very least, it would allow to trace the source of truncation, e.g. was the data originally truncated, or was it truncated in the process, and change the format without shooting in oneselves foot. And the generating side should always provide success flag which should be properly handled, since it may produce syntactically correct, but semantically invalid data. Such as checking exit code of process which generates json/yaml in question permalink fedilink source parent
[–] NewPerspective@lemmy.world 1 point 2 years ago (1 child) What about processes that terminate before writing the whole thing? You can't protect against everything. Blame other processes all you want but the language spec allows for confusion. permalink fedilink source parent hideshow 2 child comments replies: [–] AMDmi3@lemmy.world 2 points 2 years ago* (last edited 2 years ago) You just check the exit code, no? The other process may fail while generating syntactically correct data too, regardless of format. permalink fedilink source parent
[–] AMDmi3@lemmy.world 2 points 2 years ago* (last edited 2 years ago) You just check the exit code, no? The other process may fail while generating syntactically correct data too, regardless of format. permalink fedilink source parent