sq / JSIL

CIL to Javascript Compiler
http://jsil.org/
Other
1.73k stars 241 forks source link

Merge configurations #989

Open iskiselev opened 8 years ago

iskiselev commented 8 years ago

I'd like to discuss how we merge separate levels configurations and how we can improve it. Problems:

  1. Analyzer settings are not typed, so they cannot be merged - only replace in full.
  2. There is no way to reset any collection/dictionary or remove any value from it - only add additional values to the end.

First problem may be resolved if we'll merge config through reflection or as JSON. I don't know how we could solve second problem. Any ideas?

kg commented 8 years ago

Deleting values from lists is tricky. I guess we could define a syntax for it.

Defining strong types for analyzer settings would be fine with me, as would doing it via reflection.

iskiselev commented 8 years ago

What do you think such syntax:

With it, simplest way to merge setting, will be serialize to JSON both source and target, merge them as JSON and do list post-processing. After it, deseriallize settings back.

kg commented 8 years ago

null to remove makes sense. some sort of meta value like { "command" : ... } sounds fine too. ideally we do something to make it clear that it's a meta-value, like making it __COMMAND__ or something. No particular impulse there towards what.

We may just want to look at existing textual configuration file formats and see if there's something out there we should replace the json with.