3 ms·
It strikes me that the monadic model seems to be over-specifying the query in the same way that SQL does. Compare to a datalog query where the compiler can deci
by jamii 12y ago
It strikes me that the monadic model seems to be over-specifying the query in the same way that SQL does. Compare to a datalog query where the compiler can decide in what order to join the tables and how to perform those joins (eg we use a constraint solver to perform all the joins simultaneously). A clever compiler could probably recover the original intention from the monadic query - similar to how an imperative language forces you to totally order all your statements and then the compiler goes to a great deal of effort to figure out whether that ordering was important or arbitrary so it can emit better code.
Mike Pall has a great deal to say about accurately recording and preserving programmer intention to allow better optimisations throughout the stack - http://www.freelists.org/post/luajit/Ramblings-on-languages-and-architectures-was-Re-any-benefit-to-throwing-off-lua51-constraints http://www.freelists.org/post/luajit/Ramblings-on-languages-... . Similarly, I recall hearing Carmack talking about wanting to separate logic from optimisations because they spend so much effort removing old optimisations when the hardware changes, but I can't find the source anymore :(
- tosh 12y agoThanks for your thoughts and the link. Would love to hear/read Carmack's thoughts on this in case you stumble over it again.
- dougabug 12y agoSQL does not specify join order. Determining efficient join order based on constraints and statistical distributions of the data is one of the main tasks which a Cost Based Optimizer performs.