3 ms·
>> when you "commit" your release, you'd end up with a single, optimized artifact for deployment I agree this would be nice, but think of this problem more dee
by hacker_9 7y ago
>> when you "commit" your release, you'd end up with a single, optimized artifact for deployment
I agree this would be nice, but think of this problem more deeply and you quickly run into major issues. The biggest one being that your compiler now has a large scale optimisation step to do completely automatically, better than a human.
In order to make this work, you'd effectively have to build everything out of composable components, which you then can switch on/off with some sort of layering system. The problem here is how do you come to a decision on what those composable units look like? You don't know what you don't know - i.e. what those future layers you append are going to need to turn off or on.
And coming back to optimisation - once you know the features you are combining together in an algorithm, only then do you know the data structures that fit the problem.
Optimisation isn't a forward process when you turn parts off and end up with an efficient system. Optimisation requires a high level view, a low level view, an understanding of context, of memory requirements, of language capabilities, even leaps of logic.
For the last part when I mean is that whilst a compiler may be able to reorganize something in the form a*b=c (and even then knowing when to do this is a book on it's own), it can't know that if I, for example, disable a feature that adds nested nodes to a tree structure, that it could rewrite functions to no longer require recursion and instead treat them like serial lists.
You could rewrite the methods yourself and add them to your new layer, but you also will inevitably end up not fitting the previous composable structure.
I think the deeper problem is related more to the tying of syntax to structure, as structure is ultimately your application's performance profile. Untying these two though could lead to a way forward for the append style paradigm.