Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I like this quote from the comments:

"I don't have a clue how one would be able to build a gui with it, or how one can easily interact with a database."

Because SQL is functional programming. Functional programming doesn't just mean Haskell, it also means Microsoft Excel (which, I've been told, is the most used programming platform in existence).



I'm pretty sure that SQL is actually set programming, not functional or imperative.


SQL is like a swiss army knife for data. It includes some relational algebra, some relational calculus, and some functional programming.


SQL is a declarative language, not a functional one. Writing SQL is telling the DB what you want, not how to do it.


I disagree. SQL, by definition, is natively nonfunctional. The concept of a database requires state. However, you can write functional-esque (monadic) layers on top of SQL.

Excel is basically a wrapper around spaghetti code. It's great for small presentations, but using it for real programming is incredibly risky. There are an enormous number of stories floating out there about business apps written in Excel that turned out to have subtle but sometimes disastrous bugs due to random human errors as well as poor maintenance when the "program" changed hands.


If you don't use UPDATE or DELETE, then you're treating SQL as a static-single-assignment language.

This is pretty much what I do at work; we have massive quantities of geographic and linguistic data that we have to translate to [REDACTED], and we do this by uploading it all into PostgreSQL and then running through a long sequence of "CREATE TABLE foo AS SELECT hairy_expression FROM bar;" statements.


Good point.

For the time it was written (1970s, I believe) the SQL language was way ahead of the curve compared to the languages being used in enterprise.


SQL is much more like map/reduce than it is for/next.


map = AS

reduce = GROUP BY


"SQL, by definition, is natively nonfunctional."

I think I see your point, but is "natively nonfunctional" how you would describe lisp? There's not really any difference. One is binary relations and one is set relations.




Consider applying for YC's Winter 2027 batch! Applications are open till November 2.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: