<div dir="ltr"><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Brad,</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Thanks for your response. I've taken a little bit of time to consider your</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">thoughts and here is what I think.</div><span class="gmail-im" style="color:rgb(80,0,80);font-size:small;text-decoration-style:initial;text-decoration-color:initial"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Fair warning: Upstream is not outright opposed to a new language but</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">it will take a lot to make something like that upstreamable, assuming</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">we even find time to consider it in depth.</span><br></blockquote><div><br></div></span><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"> That's perfectly okay. I'm willing to do the work and I've started a folder</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">in my repository for compatibility testing. The tests I've written so far test</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">the interpreter that I've written to match the expected output you'd get with</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">CMake running in script mode. I'm going to be thorough in the compatibility</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">tests in order to make this process easier.</div><span class="gmail-im" style="color:rgb(80,0,80);font-size:small;text-decoration-style:initial;text-decoration-color:initial"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">A major obstacle to replacing the language is separating the code model</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">representation from the current language.  Some work has been done to</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">factor it out into a representation that can be used by the generators</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">that is not tied to the implementation of the current language, but more</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">work is needed and the original contributor working on that is no longer</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">active.  Search back through the dev list archives for posts by Stephen</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">Kelly talking about where his work left off.</span><br></blockquote><div><br></div></span><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I'll revisit this when I begin trying to integrate the library I've written with</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">the main CMake project. Hopefully I can pick up where he left off! Currently,<br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">it's pretty trivial to add new functions using C++ code. I'm hoping as long as</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">it stays that way, it should be pretty easy to use generator specific functions.</div><span class="gmail-im" style="color:rgb(80,0,80);font-size:small;text-decoration-style:initial;text-decoration-color:initial"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">If a new input language were to be introduced it should fix some of the</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">fundamental problems with the current approach.  These include:</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">* Each directory and its included files must be processed serially</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">  due to the imperative language with side-effects.  This means we</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">  can never make the implementation parallel.</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">* The imperative form of the language also means that IDEs cannot</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">  easily edit the build specification through GUI actions.  If at</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">  least things like a list of sources were doable in a declarative</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">  way that could help.</span><br></blockquote><div><br></div></span><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I agree that the affects of massive amounts of included code can be</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">quite noticeable but I think there's other ways to fix this than to make</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">the language declarative.</div><span class="gmail-im" style="color:rgb(80,0,80);font-size:small;text-decoration-style:initial;text-decoration-color:initial"><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">When thinking about alternative approaches before I've considered</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">the idea of having most of the build spec be declarative/functional</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">(no side effects) and then having an imperative part that computes</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">parameters to evaluate conditions and expressions within the main</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">spec.  The main spec could then be updated by IDEs in a structured</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">way, evaluated in parallel, etc. while the imperative part could</span><br style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial"><span style="font-size:small;background-color:rgb(255,255,255);text-decoration-style:initial;text-decoration-color:initial;float:none;display:inline">handle system introspection, configure-time file generation, etc.</span><br></blockquote><div><br></div></span><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">Having a purely functional syntax would certainly be much easier to</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">execute in parallel, but I think that change would be too drastic to be</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">a net benefit. I wanted to make the syntax easier for system introspection</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">as well, since that's where it is most complicated.</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">The changes I have in mind are more for existing CMake code,</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">such as whether "()" really need to come after an "endif" keyword.</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">I'm going to make a more thorough survey of the CMake code and</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">draw examples when I write the new specification. The end goal is</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">to make very readable and easily maintainable CMake code, while</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">staying focused as a build system generating language.</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial"><br></div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">The library could have facilities to make it easier for graphical front</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">ends to work with. For though, though, my main focus is improving</div><div style="font-size:small;text-decoration-style:initial;text-decoration-color:initial">the syntax.</div><br></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jul 5, 2018 at 8:07 AM Brad King <<a href="mailto:brad.king@kitware.com">brad.king@kitware.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 07/04/2018 01:08 PM, Taylor Holberton wrote:<br>
> I've been thinking about designing a new syntax for CMake<br>
<br>
Fair warning: Upstream is not outright opposed to a new language but<br>
it will take a lot to make something like that upstreamable, assuming<br>
we even find time to consider it in depth.<br>
<br>
> that better expresses some of the functionality that I've seen in<br>
> modern CMake code. I've started a CMake parsing library and plan<br>
> on using it to design the new syntax while maintaining support for<br>
> the traditional syntax as well.<br>
<br>
A major obstacle to replacing the language is separating the code model<br>
representation from the current language.  Some work has been done to<br>
factor it out into a representation that can be used by the generators<br>
that is not tied to the implementation of the current language, but more<br>
work is needed and the original contributor working on that is no longer<br>
active.  Search back through the dev list archives for posts by Stephen<br>
Kelly talking about where his work left off.<br>
<br>
If a new input language were to be introduced it should fix some of the<br>
fundamental problems with the current approach.  These include:<br>
<br>
* Each directory and its included files must be processed serially<br>
  due to the imperative language with side-effects.  This means we<br>
  can never make the implementation parallel.<br>
<br>
* The imperative form of the language also means that IDEs cannot<br>
  easily edit the build specification through GUI actions.  If at<br>
  least things like a list of sources were doable in a declarative<br>
  way that could help.<br>
<br>
When thinking about alternative approaches before I've considered<br>
the idea of having most of the build spec be declarative/functional<br>
(no side effects) and then having an imperative part that computes<br>
parameters to evaluate conditions and expressions within the main<br>
spec.  The main spec could then be updated by IDEs in a structured<br>
way, evaluated in parallel, etc. while the imperative part could<br>
handle system introspection, configure-time file generation, etc.<br>
<br>
-Brad<br>
</blockquote></div>