, 14 min read
Declarative programming is a dead-end for the lowly programmer
19 thoughts on “Declarative programming is a dead-end for the lowly programmer”
, 14 min read
19 thoughts on “Declarative programming is a dead-end for the lowly programmer”
Minimal cue: View HTML as Lisp written with a funny notion. As with Lisp, you define your own atoms (tags) and attach behavior.
I failed to explain this well to the HTML5 WG early. So the plumbing is a bit of a mess. We since have frameworks that use exactly this approach.
Lisp is usually described as extensible. 🙂
I meant the above as a metaphor. Just occurred to me, you could take literally, and implement Lisp using HTML and Javascript.
An amusing and horrible notion. 🙂
So, logical languages (like Prolog, miniKanren, etc.) are also declarative. Do they fall under the same criticisms? They are not mainstream programming, and are used to handle a different domain of problems.
So, logical languages (like Prolog, miniKanren, etc.) are also declarative.
I would claim that they are obvious dead-ends for the lowly programmer.
Maybe you are right about Prolog Haskell etc (that they are dead ends for programmers) but not for the same reasons. A prolog programmer can solve all the same problems as a python programmer.
Andre: There is a pattern to this madness though. XSLT is “hot and new” and yet it is as much a dead-end as Prolog on Haskell.
I thought XSLT rose and fell in the 2000s… I haven’t seen it being “hot and new”…
Compared to Prolog, XSLT is hot and new.
Dear Mr. Lemire,
The distinction between declarative, imperative, functional programming is like beauty. In the eye of the beholder. It is true that highly focused declarative languages can give one they are not particularly flexible. But every so-called functional language has declarative aspects, and even good fortran programs from 50 years ago made heavy use of functions, so weren’t they functional too? I find all these terms unproductive. Programmers are always looking for leverage, and generality. Sometimes a powerful tool is narrow in application. Occasionally a nice balance between flexibility and general purpose use arises, and that language becomes popular. The best languages and tools rarely become popular because as an industry, programmers are more attuned to job protection than productivity. I have seen time and time again an inferior language or toolchain adopted, always with the excuse that it is more popular and therefore “safer”. I have been working on a new language that combines some of the most powerful features of prolog, with the cleanliness of Modula-2, and novel data structures. Since algorithms + data structures = programs, isn’t the lack of innovation in data structures really the problem nowadays? Seems to me that the relational table is a dead-end. As for LISP, its insidious parenthetical notation makes it unreadable to most people, and transformative languages as categorized by John Backus don’t transfer well between people, which is probably why he never liked them. The truth is that all languages are merely a notation that allows one to more conveniently express a program that ultimately is mapped to the low level instruction set of the CPU, which hasn’t change significantly in 50 years; we still have memory, registers, the basic operations, boolean, etc. … so every program is a bridge from the problem domain to a CPU implementation, and the directness, brevity, clarity, simplicity, all very depending on the language and toolchain selected. The goal of modern language design is improve our overall productivity by simplifying and streamlining the notation, and introducing new productive concepts.
I’ll add my voice to the small chorus that I think “declarative” is not the best word for the languages you’re lumping together. I think the general purpose vs special purpose/domain specific spectrum is much more relevant.
Agreeing with Andre: You can say bad things about the marketability of functional language programming skills. However, languages like Haskell and OCaml are _at least_ as extensible as languages Java, Python or R. If you insist on ranking the latter over the former, then I think you’re just talking about the vibrancy of the respective library ecosystems, which has little to do with the technical properties of the languages themselves.
…perhaps why I am an “Applications Developer” and not a “Programmer” – lowly or otherwise?
Found this blog as a reference from something else I was researching. Over my head, but incredibly interesting. I’ll come back when I can.
I use Prolog to write web applications yet I’m not a PhD or a Google engineer. I get well paid for doing it. Yet by your article it’s s dead end for me. I definitely do not agree with this.
I am sure you also use SQL. Most web folks do. A lot of them get well paid.
SQL, HTML and CSS are domain-specific. What’s the point of using the same language for every domain?
How about the problems you can solve with SPARQL, those are not interesting?
XSLT might be a dead end, yet it’s the most advanced language I know, with built-in service location, dependency injection, pattern-matching at the declaration level and high code reusability in both in source and compiled (in 3.0) form.
JavaScript sucks.
‘I use the term “lowly programmer†to distinguish regular programmers from PhDs with IQs above 200 and teams of highly paid Google engineers.’
I would like to be one of those “highly paid Google engineers”. You can remove the “Google” name from there, that doesn’t change anything. that would make for a more interesting blog post.
Css is not Turing complete. Do you even know what that means?
See http://lemire.me/blog/2011/03/08/breaking-news-htmlcss-is-turing-complete/
I liked your provacative article.
Declarative languages like sql are not a dead end.
Thats like saying the axioms of group theory are a dead end because they havent changed since they were formulated.
Sql has been extended with analytic clauses, model clauses, procedural calls, inline functions… and some relational databses can now handle objects, xml, json.
Also declarative “code” is being more widely used to control cutting edge products like Docker and Kubernetes.
Products like Spring tools are becoming more and more decalarative.
Lowly programmers are becoming more like army generals who commands their forces by issuing orders which can be specific procedural: advance 5 mile to hill x or declarative: surround the enemy seventh corp with battalion ten.
Understatement of the century. I think if it was so easy to do anything we like in these languages, there would be no need for CSS/HTML/SQL. These latter languages solve problems that are nearly impossible to solve in Java, C, … That’s why they exist and will always exist.