As some of you may know, I’ve been working on declarative programming languages recently (see Yarn). I’m convinced that the declarative model is much closer to the Hundred-Year language that Paul Graham has brought up than are other paradigms. Here is how I think it will pan out.
In my ideal universe the declarative language is a language used by the application programmer for specifying exactly what type of behavior is suppose to exist in a program. Declarative languages make good infrastrutral glue languages since they don’t bog the developer down in the details of implementation. You needn’t even specify the type of algorithm or the strategy of evaluation in the specification. Of course one needs a sufficiently rich declarative language, but I’ll get speak on that more comprehensively in another post. In some cases the machine (read compiler) will be able to implement the algorithms without any further information and we will arive at an application whose performance is acceptable. This is somewhat like how prolog works in the ideal (that is, if you remove cut and side-effects). Of course, as has been shown with constraint logic programming languages, having extensive domain knowledge can bring about great improvements in evaluation strategy. Basically knowing restrictions on the domain allows much better algorithms to be used. Any declarative based infrastructure for the Hundred-Year language will have to address this issue. Likely the best approach is a type of plug-in model where predicates can have many different underlying algorithmic strategies. Eventually given that many restrictions on the domain are specified in a declarative way, it may be possible to do much of this algorithmic implementation (compilation) automatically, freeing the application programmer from these concerns. It may even be possible in some cases to automatically discover cross-cutting domains that the application programmer did not even know existed in order to achieve better performance than a human would usually be able to.
As we have seen with garbage collection, declarative models can remove common programming errors, improve robustness, and in some cases achieve better performance (as is sometimes the case in multi-threading applications). However for some reason garbage collection can have poor performance with respect to manual collection strategies especially when lots of information exists about the lifetime, for instance when it is only present within the dynamic-extent of some function call. It would be nice if we could make more progress on these old issues so that we can have confidence to forge ahead (Henry Baker’s paper on linear types may be of interest here).