Is it possible to create a quine in every turing-complete language?

Any programming language which is Turing complete, and which is able to output any string (by a computable function of the string as program — this is a technical condition that is satisfied in every programming language in existence) has a quine program (and, in fact, infinitely many quine programs, and many similar curiosities) as … Read more

Is HTML Turing Complete?

By itself (without CSS or JS), HTML (5 or otherwise) cannot possibly be Turing-complete because it is not a machine. Asking whether it is or not is essentially equivalent to asking whether an apple or an orange is Turing complete, or to take a more relevant example, a book. HTML is not something that “runs”. … Read more

How did Haskell add Turing-completeness to System F?

In a word, general recursion. Haskell allows for arbitrary recursion while System F has no form of recursion. The lack of infinite types means fix isn’t expressible as a closed term. There is no primitive notion of names and recursion. In fact, pure System F has no notion of any such thing as definitions! So … Read more

What are practical guidelines for evaluating a language’s “Turing Completeness”?

You need some form of dynamic allocation construct (malloc ornew or cons will do) and either recursive functions or some other way of writing an infinite loop. If you have those and can do anything at all interesting, you’re almost certainly Turing-complete. The lambda calculus is equivalent in power to a Turing machine, and if … Read more

Are makefiles Turing complete?

Yes, see this. Once you have lambda, it’s all downhill from there. Here is a plagiarized Fibonacci example This should be enough to build a foundation for more generality (I’ve got to get back to work, or I’d play more.) dec = $(patsubst .%,%,$1) not = $(if $1,,.) lteq = $(if $1,$(if $(findstring $1,$2),.,),.) gteq … Read more

Are Perl regexes turing complete?

Excluding any kind of embedded code, such as ?{ }, they probably don’t cover all of context-free, much less Turing Machines. They might, but to my knowledge, nobody has actually proven it one way or another. Given that people have been trying to solve certain context-free problems with Perl regexes for a while and haven’t … Read more

Practical non-Turing-complete languages?

Don’t listen to the naysayers. There are very good reasons one might prefer a non-Turing complete language in some contexts, if you want to guarantee termination, or simplify code, for example by removing the possibility of runtime errors. Sometimes, just ignoring things may not be sufficient. The paper Total Functional Programming argues more or less … Read more

The type system in Scala is Turing complete. Proof? Example? Benefits?

There is a blog post somewhere with a type-level implementation of the SKI combinator calculus, which is known to be Turing-complete. Turing-complete type systems have basically the same benefits and drawbacks that Turing-complete languages have: you can do anything, but you can prove very little. In particular, you cannot prove that you will actually eventually … Read more

How useful is Turing completeness? are neural nets turing complete?

The point of stating that a mathematical model is Turing Complete is to reveal the capability of the model to perform any calculation, given a sufficient amount of resources (i.e. infinite), not to show whether a specific implementation of a model does have those resources. Non-Turing complete models would not be able to handle a … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)