aboutsummaryrefslogtreecommitdiff
path: root/posts
diff options
context:
space:
mode:
Diffstat (limited to 'posts')
-rw-r--r--posts/turing_complete_type_systems.md22
1 files changed, 22 insertions, 0 deletions
diff --git a/posts/turing_complete_type_systems.md b/posts/turing_complete_type_systems.md
new file mode 100644
index 0000000..b6ec7bc
--- /dev/null
+++ b/posts/turing_complete_type_systems.md
@@ -0,0 +1,22 @@
1Rust's type system is Turing complete:
2
3 - [FizzBuzz with Rust Traits](https://github.com/doctorn/trait-eval/)
4 - [A Forth implementation with Rust Traits](https://github.com/Ashymad/fortraith)
5
6It is impossible to determine if a program written in a
7generally Turing complete system will ever stop. That is, it
8is impossible to write a program `f` that determines if a
9program `g`, where `g` is written in a Turing complete
10programming language, will ever halt. The [Halting
11Problem](https://en.wikipedia.org/wiki/Halting_problem) is
12in fact, an [undecidable
13problem](https://en.wikipedia.org/wiki/Undecidable_problem).
14
15*How is any of this relevant?*
16
17Rust performs compile-time type inference. The type checker,
18in turn, compiles and infers types, I would describe it as a
19compiler inside a compiler. It is possible that `rustc` may
20never finish compiling your Rust program!
21
22I understand that this post lacks content.