digitalmars.D - DUB: json or sdl?
- Ki Rill (5/5) Sep 22 2021 Out of curiosity, which one do you use in your dub projects and
- drug (6/13) Sep 22 2021 My reason for sdl format using is its conciseness, human readability and...
- deadalnix (2/4) Sep 22 2021 And this is why I use json parser that accept comments :)
- bauss (4/9) Sep 22 2021 Json because it's a consistent format across environments outside
- Tobias Pankrath (2/5) Sep 22 2021 I use it on the job (not a D shop).
- jfondren (44/53) Sep 22 2021 Reason to prefer JSON:
- Mike Parker (3/8) Sep 22 2021 SDL. It's much cleaner to me than JSON. And the fact that JSON is
- Ki Rill (3/13) Sep 22 2021 What do you think of Rust's `toml` format?
- Mike Parker (3/8) Sep 22 2021 Looks readable. Never used it though, so I don't know how it is
- Elronnd (5/6) Sep 22 2021 It's not 'rust's'; it's a general-purpose standardisation of INI
- guai (4/5) Oct 01 2021 It is inconsistent in its own rules and cannot be used as a
- Steven Schveighoffer (10/17) Sep 22 2021 I actually used to prefer sdl, but lately, I'm using json.
- Ki Rill (5/11) Sep 22 2021 I wish `json` would accept comments. I prefer to leave lots of
- bauss (2/14) Sep 23 2021 Json5 accepts comments
- JN (3/8) Sep 22 2021 I use JSON. I am more familiar with JSON, never seen SDL used
- SealabJaster (4/5) Sep 23 2021 SDL. It's cleaner and easier to read, and I have no use cases
- guai (3/5) Oct 01 2021 second that
- Guillaume Piolat (6/11) Sep 23 2021 JSON.
- Martin Tschierschke (9/14) Sep 24 2021 My thought about the missing comments:
- Mathias LANG (7/12) Sep 26 2021 I use `dub.json` because it is well-established and easier for
- Steven Schveighoffer (3/6) Sep 26 2021 YAML stands for "YAML Ain't Markup Language". Yeah, I was surprised too.
- Meta (3/10) Sep 27 2021 I thought it stood for "Yet Another Markup Language"?
- Adam D Ruppe (2/3) Sep 27 2021 It used to but they changed it.
- bauss (13/27) Oct 03 2021 https://en.wikipedia.org/wiki/YAML#History_and_name
- Tejas (2/17) Sep 27 2021 You prefer YAML even over [JSON5](https://json5.org/)?
- Dga123 (5/10) Sep 27 2021 - JSON for projects
- Dukc (5/10) Sep 27 2021 I prefer SDL per se, but
- Imperatorn (3/8) Oct 05 2021 json, but just because I'm used to it already. Kinda miss to be
Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?
Sep 22 2021
22.09.2021 13:19, Ki Rill пишет:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?My reason for sdl format using is its conciseness, human readability and possibility of comments. P.S. I remember that very long negative thread about sdl format by default and how it was funny when the thread starter agreed later that sdl was much convenient that json.
Sep 22 2021
On Wednesday, 22 September 2021 at 10:29:58 UTC, drug wrote:My reason for sdl format using is its conciseness, human readability and possibility of comments.And this is why I use json parser that accept comments :)
Sep 22 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?Json because it's a consistent format across environments outside of D, unlike sdl which is basically only used by D and only by dub really.
Sep 22 2021
On Wednesday, 22 September 2021 at 10:45:41 UTC, bauss wrote:Json because it's a consistent format across environments outside of D, unlike sdl which is basically only used by D and only by dub really.I use it on the job (not a D shop).
Sep 22 2021
i hate json, but that's the format i use i wish we could just use a ``build.d`` file, so we can have more control and stick to using D
Sep 22 2021
On Wednesday, 22 September 2021 at 21:25:11 UTC, russhy wrote:i hate json, but that's the format i use i wish we could just use a ``build.d`` file, so we can have more control and stick to using DI would go with most simple syntax for simple builds - a command line syntax, where each command is a list of tokens separated by whitespace, the earlier example: ``` dependency sumtype 0.10.0 dflags -betterC -dip1000 ``` and just fall back to D for complex builds, maybe with reggae api.
Sep 23 2021
On Wednesday, 22 September 2021 at 21:25:11 UTC, russhy wrote:i hate json, but that's the format i use i wish we could just use a ``build.d`` file, so we can have more control and stick to using DI would go with most simple syntax for simple builds - a command line syntax, where each command is a list of tokens separated by whitespace, the earlier example: ``` dependency sumtype 0.10.0 dflags -betterC -dip1000 ``` and just fall back to D for complex builds, maybe with reggae api.
Sep 23 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?Reason to prefer JSON: 1. dub is stricter about the format, and will complain about errors for SDL would result in values being silently ignored. 2. you want something like a 2008 Perl install to be able to do something with your dub.json files, instead of writing a D program. 3. you hope that a glacier of increasing dub.json files will eventually tear out the roots of dub having more than one config format 4. you have a phobia about malicious comments getting injected into your dub.sdl files 5. you used jq and liked it to the point of finding other formats intolerable Reasons to prefer SDL: 1. comments in dub.sdl files, 2. ```d /+ dub.json: { "dependencies": { "sumtype": "~>0.10.0", }, "dflags": ["-betterC"], } +/ vs. /+ dub.sdl: dependency "sumtype" version="~>0.10.0" dflags "-betterC" +/ ``` dub converts SDL to JSON for ~/.packages/ , and the same code might be used to convert SDL documentation to JSON, so I think the main problem of multiple dub configuration formats (that it's more of a chore to talk about dub configuration) is not that bad.On Wednesday, 22 September 2021 at 10:45:41 UTC, bauss wrote: Json because it's a consistent format across environments outside of D, unlike sdl which is basically only used by D and only by dub really.With JSON you do not have to remember what an array or a hash looks like, but that doesn't tell you that the `"dflags"` key has an array of strings rather than looking like `"dflags": "-betterC",` You have to look up what dub expects either way, so the consistency fails to help with the most frustrating part of dub configurations, which is writing them in the first place.
Sep 22 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?SDL. It's much cleaner to me than JSON. And the fact that JSON is standard elsewhere matters not one iota to me.
Sep 22 2021
On Wednesday, 22 September 2021 at 13:22:33 UTC, Mike Parker wrote:On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:What do you think of Rust's `toml` format?Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?SDL. It's much cleaner to me than JSON. And the fact that JSON is standard elsewhere matters not one iota to me.
Sep 22 2021
On Wednesday, 22 September 2021 at 14:57:09 UTC, Ki Rill wrote:On Wednesday, 22 September 2021 at 13:22:33 UTC, MikeLooks readable. Never used it though, so I don't know how it is to write.SDL. It's much cleaner to me than JSON. And the fact that JSON is standard elsewhere matters not one iota to me.What do you think of Rust's `toml` format?
Sep 22 2021
On Wednesday, 22 September 2021 at 14:57:09 UTC, Ki Rill wrote:What do you think of Rust's `toml` format?It's not 'rust's'; it's a general-purpose standardisation of INI which happens to be used by cargo. IMO it's an excellent format for flat data, not so much for nested data.
Sep 22 2021
On Wednesday, 22 September 2021 at 14:57:09 UTC, Ki Rill wrote:What do you think of Rust's `toml` format?It is inconsistent in its own rules and cannot be used as a drop-in replacement for JSON and other regular formats So, meh
Oct 01 2021
On 9/22/21 6:19 AM, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?I actually used to prefer sdl, but lately, I'm using json. sdl is an ok format to write, but I always forget the way to write arrays or objects. With json I always know what I need to use. I prefer a comment-allowing form, especially for config files, where comments can provide instructions on what directives do. Having dub init spit out a bunch of comments that describe how to configure dub, and how to add dependencies, configs, etc, would go a long way to making it not as bad a format. -Steve
Sep 22 2021
On Wednesday, 22 September 2021 at 14:15:43 UTC, Steven Schveighoffer wrote:I prefer a comment-allowing form, especially for config files, where comments can provide instructions on what directives do. Having dub init spit out a bunch of comments that describe how to configure dub, and how to add dependencies, configs, etc, would go a long way to making it not as bad a format. -SteveI wish `json` would accept comments. I prefer to leave lots of comments for future me in case I forget what I did, important information about a package, etc...
Sep 22 2021
On Wednesday, 22 September 2021 at 15:07:21 UTC, Ki Rill wrote:On Wednesday, 22 September 2021 at 14:15:43 UTC, Steven Schveighoffer wrote:Json5 accepts commentsI prefer a comment-allowing form, especially for config files, where comments can provide instructions on what directives do. Having dub init spit out a bunch of comments that describe how to configure dub, and how to add dependencies, configs, etc, would go a long way to making it not as bad a format. -SteveI wish `json` would accept comments. I prefer to leave lots of comments for future me in case I forget what I did, important information about a package, etc...
Sep 23 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?I use JSON. I am more familiar with JSON, never seen SDL used outside of dub and I find JSON cleaner.
Sep 22 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:...SDL. It's cleaner and easier to read, and I have no use cases where external languages need to read a dub.json file. I agree that the acronym is unfortunate because of SDL2.
Sep 23 2021
On Thursday, 23 September 2021 at 08:10:29 UTC, SealabJaster wrote:SDL. It's cleaner and easier to read, and I have no use cases where external languages need to read a dub.json file.second that
Oct 01 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?JSON. I have a build tool that parses dub.json to extract meta-data from the project. A good SDL parser didn't exist back then. As for TOML, its syntax for arrays is unfortunate, I don't feel like it's better than JSON (or even XML for what matters).
Sep 23 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?My thought about the missing comments: The DUB-parser of the .json files might just remove all "comment": "My comment" from the parsing result and we would have a way to place them. "comment": "List of authors is probably not complete" "authors": [ "Martin Tschierschke" ],
Sep 24 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?I use `dub.json` because it is well-established and easier for people to get familiar with. I don't want to force people to learn yet another markup language to read our package definition. Well, that's not true... I would prefer to use yet another markup language (YAML) over JSON, because it's well-established, supports comments, and is a superset of JSON.
Sep 26 2021
On 9/26/21 7:58 PM, Mathias LANG wrote:Well, that's not true... I would prefer to use yet another markup language (YAML) over JSON, because it's well-established, supports comments, and is a superset of JSON.YAML stands for "YAML Ain't Markup Language". Yeah, I was surprised too. -Steve
Sep 26 2021
On Monday, 27 September 2021 at 00:30:52 UTC, Steven Schveighoffer wrote:On 9/26/21 7:58 PM, Mathias LANG wrote:I thought it stood for "Yet Another Markup Language"?Well, that's not true... I would prefer to use yet another markup language (YAML) over JSON, because it's well-established, supports comments, and is a superset of JSON.YAML stands for "YAML Ain't Markup Language". Yeah, I was surprised too. -Steve
Sep 27 2021
On Monday, 27 September 2021 at 17:52:03 UTC, Meta wrote:I thought it stood for "Yet Another Markup Language"?It used to but they changed it.
Sep 27 2021
On Monday, 27 September 2021 at 17:52:03 UTC, Meta wrote:On Monday, 27 September 2021 at 00:30:52 UTC, Steven Schveighoffer wrote:https://en.wikipedia.org/wiki/YAML#History_and_name ``` Originally YAML was said to mean Yet Another Markup Language, because it was released in an era that saw a proliferation of markup languages for presentation and connectivity (HTML, XML, SGML, etc). Its initial name was intended as a tongue-in-cheek reference to the technology landscape, referencing its purpose as a markup language with the yet another construct, but it was then repurposed as YAML Ain't Markup Language, a recursive acronym, to distinguish its purpose as data-oriented, rather than document markup. ```On 9/26/21 7:58 PM, Mathias LANG wrote:I thought it stood for "Yet Another Markup Language"?Well, that's not true... I would prefer to use yet another markup language (YAML) over JSON, because it's well-established, supports comments, and is a superset of JSON.YAML stands for "YAML Ain't Markup Language". Yeah, I was surprised too. -Steve
Oct 03 2021
On Sunday, 26 September 2021 at 23:58:23 UTC, Mathias LANG wrote:On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:You prefer YAML even over [JSON5](https://json5.org/)?Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?I use `dub.json` because it is well-established and easier for people to get familiar with. I don't want to force people to learn yet another markup language to read our package definition. Well, that's not true... I would prefer to use yet another markup language (YAML) over JSON, because it's well-established, supports comments, and is a superset of JSON.
Sep 27 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?- JSON for projects - SDL for embedded recipes, e.g script, because it's usally small (name + 1 or two dependencies) and looks less shocking than the JSON equivvalent in a comment on top of the module.
Sep 27 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?I prefer SDL per se, but [dub2nix](https://github.com/lionello/dub2nix) currently requires JSON so I often end up using that. On the other hand I could use SDL as source format and transpile with dub when needed.
Sep 27 2021
On Wednesday, 22 September 2021 at 10:19:18 UTC, Ki Rill wrote:Out of curiosity, which one do you use in your dub projects and why do you prefer one over another? For example, I use json. Simply because when I see `sdl`, I think of `SDL2` graphics library. What's your reason?json, but just because I'm used to it already. Kinda miss to be able to add comments though (in general)
Oct 05 2021