Hacker News new | ask | show | jobs
by lindbergh 1111 days ago
In their definition of programming languages types, I'm not sure I see how SQL which they cateogrize as declarative really differs from FP, especially with lazy evaluation. Both are a succession of functions applied onto a previously declared variable : just think of a long SQL query with many ctes modifying the previous ones; each of them can be thought of as a variable which takes its value from the application of a function on other variable (a bit like the let function in ocaml).

I always thought of LaTeX as being the prime example of declarative programming.

1 comments

SQL does not support higher-order functions or lambdas (except possibly in some special dialect I'm not aware of)
Right, good point. I just find the structure and the mindset to be similar.