turing-complete

Is CSS Turing complete?

独自空忆成欢 提交于 2019-11-26 19:16:18
CSS isn't, insofar as I know, Turing complete. But my knowledge of CSS is very limited. Is CSS Turing complete? Are any of the existing draft or committees considering language features that might enable Turing completeness if it isn't right now? Adam Davis You can encode Rule 110 in CSS3, so it's Turing-complete so long as you consider an appropriate accompanying HTML file and user interactions to be part of the “execution” of CSS. A pretty good implementation is available, and another implementation is included here: body { -webkit-animation: bugfix infinite 1s; margin: 0.5em 1em; } @-webkit

Practical non-Turing-complete languages?

老子叫甜甜 提交于 2019-11-26 18:49:34
问题 Nearly all programming languages used are Turing Complete, and while this affords the language to represent any computable algorithm, it also comes with its own set of problems. Seeing as all the algorithms I write are intended to halt, I would like to be able to represent them in a language that guarantees they will halt. Regular expressions used for matching strings and finite state machines are used when lexing, but I'm wondering if there's a more general, broadly language that's not

What is Turing Complete?

徘徊边缘 提交于 2019-11-26 16:46:11
What does the expression "Turing Complete" mean? Can you give a simple explanation, without going into too many theoretical details? Here's the briefest explanation: A Turing Complete system means a system in which a program can be written that will find an answer (although with no guarantees regarding runtime or memory). So, if somebody says "my new thing is Turing Complete" that means in principle (although often not in practice) it could be used to solve any computation problem. Sometime's it's a joke... a guy wrote a Turing Machine simulator in vi, so it's possible to say that vi is the

C++ templates Turing-complete?

情到浓时终转凉″ 提交于 2019-11-26 14:52:03
I'm told that the template system in C++ is Turing-complete at compile time. This is mentioned in this post and also on wikipedia . Can you provide a nontrivial example of a computation that exploits this property? Is this fact useful in practice? Example #include <iostream> template <int N> struct Factorial { enum { val = Factorial<N-1>::val * N }; }; template<> struct Factorial<0> { enum { val = 1 }; }; int main() { // Note this value is generated at compile time. // Also note that most compilers have a limit on the depth of the recursion available. std::cout << Factorial<4>::val << "\n"; }

Is the C99 preprocessor Turing complete?

感情迁移 提交于 2019-11-26 08:00:30
问题 After discovering the Boost preprocessor\'s capabilities I found myself wondering: Is the C99 preprocessor Turing complete? If not, what does it lack to not qualify? 回答1: Here is an example of abusing the preprocessor to implement a Turing machine. Note that an external build script is needed to feed the preprocessor's output back into its input, so the preprocessor in and of itself isn't Turing complete. Still, it's an interesting project. From the description of the afore-linked project:

Is CSS Turing complete?

坚强是说给别人听的谎言 提交于 2019-11-26 06:10:05
问题 CSS isn\'t, insofar as I know, Turing complete. But my knowledge of CSS is very limited. Is CSS Turing complete? Are any of the existing draft or committees considering language features that might enable Turing completeness if it isn\'t right now? 回答1: You can encode Rule 110 in CSS3, so it's Turing-complete so long as you consider an appropriate accompanying HTML file and user interactions to be part of the “execution” of CSS. A pretty good implementation is available, and another

What is Turing Complete?

人走茶凉 提交于 2019-11-26 06:04:21
问题 What does the expression \"Turing Complete\" mean? Can you give a simple explanation, without going into too many theoretical details? 回答1: Here's the briefest explanation: A Turing Complete system means a system in which a program can be written that will find an answer (although with no guarantees regarding runtime or memory). So, if somebody says "my new thing is Turing Complete" that means in principle (although often not in practice) it could be used to solve any computation problem.

C++ templates Turing-complete?

Deadly 提交于 2019-11-26 04:05:11
问题 I\'m told that the template system in C++ is Turing-complete at compile time. This is mentioned in this post and also on wikipedia. Can you provide a nontrivial example of a computation that exploits this property? Is this fact useful in practice? 回答1: Example #include <iostream> template <int N> struct Factorial { enum { val = Factorial<N-1>::val * N }; }; template<> struct Factorial<0> { enum { val = 1 }; }; int main() { // Note this value is generated at compile time. // Also note that