Hacker News new | past | comments | ask | show | jobs | submit
I don't know about the "stuff Haskell people get excited about", but IMHO, Haskell is a mathematician's language and the language of mathematics isn't a natural language. Dijkstra himself was also a mathematician, and his positions regarding programming languages features like 1-based indexing [1] are already conflicting with practice, the famous case being Lua which receives mixed opinions about it. I find for instance 1-based indexing more "natural", and that's coming from someone whose second and third languages are assembly and C (the first being... Basic).

Yet the point about DSL is interesting, in particular internal/embedded DSLs [2]. I lied a little earlier, my third programming language was actually Forth. His creator said in 2001, "When you devised an application you wrote a hundred words [i.e. functions] or so that discussed the application and you used those hundred words to write a one line definition to solve the application" [3].

I've been trying to do that exactly that in other languages, make it so that the code expresses "naturally" what it does as much as possible. When you succeed, people call your code "beautiful" or "elegant" (nobody ever told me that :-) which, I think, subsumes "naturality".

This is of course harder to do in low-level languages such as the ones I mentioned (except Basic maybe) because you get caught in details such as memory management. But high-level languages are not exempt of these problems (and contrary to Forth or Lisp, their syntax is often written in stone). Then there's essential complexity [4], which can be "unnatural" no matter what, like thinking about things in a concurrent programming context, with languages that don't natively support it like they support automatic memory management (i.e. garbage collection).

The topic is dangerously close to "readability", which is known to be 80% subjective.

[1] https://www.cs.utexas.edu/~EWD/transcriptions/EWD08xx/EWD831...

[2] https://en.wikipedia.org/wiki/Domain-specific_language#Domai...

[3] https://www.ultratechnology.com/1xforth.htm

[4] https://en.wikipedia.org/wiki/No_Silver_Bullet

Dijkstra's personal language design (GCL) actually used anything-based indexing -- you specify the lower bound explicitly when you declare the array, so even if indexing starting from some runtime value k (e.g. k=7, k=b.lower-bound for some existing array b, etc.) is most natural, you provide that as the lower bound. Then a(i) would be translated to e.g. a[i-k] in compilation.
{"deleted":true,"id":50211174,"parent":50207733,"time":1792771312,"type":"comment"}