4 ms·
I have a question that I have often wanted to ask of someone that knows something about declarative programming. In my day job, I spend most of my time worryin
by demallien 13y ago
I have a question that I have often wanted to ask of someone that knows something about declarative programming. In my day job, I spend most of my time worrying about trying to make my code run faster (I do low-level user-interface work - building the libraries that application UIs then use, so it's all about moving pixels as fast as possible, getting data to the app as fast as possible etc. If I need to make a SW blit run faster, I go into the function doing the blit, and I may replace some of the C code with some SSE-style vectorised assembler. Or I may choose to run an expensive SQL query once a day, storing the result in a binary file that is then used to feed application data requests, or other things of that nature.
I just don't see how those kinds of optimisations could be done in a declarative language. Do I just have an unusual use-case, or are these languages seriously constrained with respect to the types of programs that they can be used for?
- randomhunt 13y agoThe right tool for the job. I wouldn't try to cut a piece of wood to length by using a hammer. Declarative languages tend to lend themselves to being used at a much higher level, for example easily encoding rules regarding salary payments rather than low level bit twiddling.
- maaku 13y ago> I just don't see how those kinds of optimisations could be done in a declarative language. Not to be an ass, but why not? All of your examples are, in principle, doable in a declarative language.
- louthy 13y ago> Not to be an ass, but why not? He's not saying it can't be done, he wants to ask "someone that knows something about declarative programming".
- jheriko 13y agoits about trusting the compiler... performance oriented code is a surprisingly small amount of stuff, as reading hacker news constantly reminds me. (ps i work in games and vfx - similar restrictions) although i guess there is no reason why you can't make declarative performance constraints ...