![]() |
|
![]() |
| The conclusion to the article has some pretty good points regarding configuration languages; I wonder if any present language satisfies all or most of those points. |
![]() |
| > Cue has no functions so there is nothing to recurse.
CUE developer here. This is wrong. CUE doesn't have functions, but it does have abstraction and beta-reduction, just like lambda calculus. Types can refer to themselves. There is also mutual recursion between types. We have a termination checker than ensures CUE programs are total (although it works by very different principles compared to other total languages). If you disable the CUE termination checker you get a a Turing complete language. If you leave it alone you get a primitive recursive language. Here is CUE implementing an arbitrary number of steps of rule 110 cellular automaton[1], which is Turing complete: https://cuelang.org/play/?id=Ityqia88Mvq#w=function&i=cue&f=... |
![]() |
| While imperative, and not 'pure' even C was created to set upper bound of the number of iterations of every loop being known before entering, thus PR
Dennis Ritchie's research at MIT was focused on what he called loop programming. The complexity of loop programs - ALBERT R. MEYER and DENNIS M. RITCHIE https://people.csail.mit.edu/meyer/meyer-ritchie.pdf Structured programming, the paradigm that almost every modern programmer follows by default is really pushing you to primitive recursive functions. That almost universal acceptance of structured programming compared to the other two types, pop and functional, is why people are confused about Dykstra's goto is harmful paper. While primitive recursive functions don't contain the entire set of computable functions, they do contain almost all intuitive ones that are guaranteed to HALT (total). Unfortunately there are some real needs for languages to support loops that have an indeterminate number of iterations when you enter the loop, but it is a foot gun that is avoidable by only using them when required. Even COBOL was modernized with unrestricted goto being moved to the ALTER command. I can't think of a modern, useful language that doesn't allow for PR functions. But even in C, if you avoid 'while', explicitly avoid fall through, etc... you will produce code that almost always is a total functions that will always HALT. There are cases like even type inference in ML, which is pathological in that it is way cheaper than the complexity class, thus worth the risk, despite not being total functions that make it hard for a language to restrict those use cases. So I would say that with a pragmatic approach, all languages support defaults that support most of the points, but imposed constraints that enforce them would seriously constrain the utility of the language. If you review even the hated SOLID and Clean frameworks, they're pushing you towards this model too IMHO. I think the universal acceptance of structured programming, makes this easy to forget or even fail to teach. But as an old neck beard, we were taught the risks of WHILE etc... |
![]() |
| I am a CUE developer. CUE is primitive recursive. It also happens to fulfill your desired criteria for a "good" configuration language. |
![]() |
| Possibly there are more ways to be non-Turing-complete than being a nice total terminating function. For instance, an infinite loop is neither capable of universal computation nor is terminating. |
> people seem to prefer ELI5 talk
they might've not gotten downvoted. (Didn't downvote myself, but this makes sense to me.)