Conversation
|
TravisCI failed due to networking issue. |
|
I realize that this is somehow difficult to review. |
|
Thanks Remi for doing this JSON variant too. I think JSON is going to suffice for quite a while. Do we have some policies wrt. usage of Phobos in the compiler itself? Afaik, it's already used by the LDC compilation cache and the math CTFE built-ins (starting with LDC v1.2). I guess the crucial aspect about Phobos is that we don't want a dependency on a certain (or at least rather recent) Phobos version. |
|
|
I was thinking that perhaps we want to eradicate all Phobos usage, such that we can bootstrap without requiring Phobos. This could be a later task though, and I prefer to remove the libconfig dep sooner. |
|
Not to rain on the parade here, but I'm not sure about the motivation for changing this in the first place. After all, it's not like we have any issues with libconfig right now, or dropping it would get rid of the last external dependency or something like that. Yes, if I were to newly introduce a config file today, I would go with YAML/TOML/… (or possibly JSON, although it really isn't a good fit due to the lack of comments). But I'm not sure whether changing to an incompatible format without a pressing reason is ever going to be worth it – it would require everybody to change their setups, distro package build config, scripts and so on. |
Well, I hope they finally managed to fix their master, as AppVeyor and the release packages use older versions due to some bug I don't even remember OTOH. Their LGPL is responsible for half of the LDC license file. Having it as only external compilation and runtime dependency (libconfig-dev + libconfig) besides LLVM (and C++/D host compilers of course) is kind of ridiculous IMO for what we need it for - a lookup for an array of strings based on target triple. I agree that JSON's lack for (standardized) comments is weak; it just came to mind as it's supported by Phobos out of the box. An easily embedded single-module YAML parser would be perfect. If the config file format changes, we could make it less tiresome for distro maintainers etc. by combining it with the shared libs PR. They'll surely want to get rid of compiling the compiler twice and packaging manually, so reworking the scripts should pay off in such a case. Edit: D-YAML seems rather huge, I may have underestimated YAML complexity. ;) |
|
|
Regarding json and comments:
Its as simple as filejson.readText.removeComments.parseJSON
Where removeComments is easy to implement.
I use this pattern often, as disguising comments in json as json elements
is too ugly.
…On Feb 20, 2017 10:13 AM, "Johan Engelen" ***@***.***> wrote:
- I also hope we can remove the libconfig dependency (I remember it as
something annoying when setting up my Windows build env, and also recently
on my Pi3).
- The config file is very easy and simple at this moment. We don't
need complete support of any standard, I think an ad hoc parser will do
fine as rainer proposed. I'd prefer that, and then we don't have to change
the config format.
- Let's try to come to an agreement and stick with that. @rtbo
<https://github.com/rtbo> is spending a lot of time on this, and all
the work that goes to waste is demotivating.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#2007 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/ACF9YDgOn00HUfFpCg1NgHSOBuWucJFvks5redetgaJpZM4MFMgw>
.
|
I cannot agree more :-)
|
|
IMO:
|
Agree. This is a very small part of LDC that works fine -- why change it? I understand the wish to not say no to someone who's doing a lot of work, but it might be worth asking why it's important to put that work towards a goal like this. It sounds like it's adding a maintenance burden while bringing very little benefit. (BTW, if there must be a change of format, I'd much rather YAML than JSON, both because of the markup format, and because
What's the concern? Isn't this going to be a once-off parse-and-convert-to-an-internal-data-structure stage on program startup? |
It's absolutely not about that.
I don't see any maintenance burden by a (hopefully small) integrated parser. I see simpler building (you only need CMake, make/ninja, host C++ and D compilers and LLVM; especially convenient on Windows, where libconfig has to be compiled externally, then passing paths around via CMake variables etc. - stuff that puts your regular Windows dev off), simpler redistribution ( |
It was raised as a point of concern, I understand it's not the only factor.
It's the 'hopefully' that worries me ;-) But if there is a wish to move forwards with this, I would second your proposal to have a minimal parser to handle the existing config format. |
|
Closing in favor of #2016. |
Following work in #1832, I propose to eliminate the
libconfigdependency by changing the config file format toJSON.Advantages of
JSONoverlibconfig:libconfigdependency!Advantages of
libconfigoverJSON: