diff options
author | Akshay <[email protected]> | 2020-06-18 06:09:57 +0100 |
---|---|---|
committer | Akshay <[email protected]> | 2020-06-18 06:09:57 +0100 |
commit | 3739ce5d1969df71f272d18a3ff8b5e13cd27f4f (patch) | |
tree | a78ba875dbc37b23e5211e9aa6fa7293704110c3 /posts | |
parent | 43032d7952c9dafce3ba8590db928cfd7edf5519 (diff) |
new post: turing complete type systems
Diffstat (limited to 'posts')
-rw-r--r-- | posts/turing_complete_type_systems.md | 22 |
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 @@ | |||
1 | Rust'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 | |||
6 | It is impossible to determine if a program written in a | ||
7 | generally Turing complete system will ever stop. That is, it | ||
8 | is impossible to write a program `f` that determines if a | ||
9 | program `g`, where `g` is written in a Turing complete | ||
10 | programming language, will ever halt. The [Halting | ||
11 | Problem](https://en.wikipedia.org/wiki/Halting_problem) is | ||
12 | in fact, an [undecidable | ||
13 | problem](https://en.wikipedia.org/wiki/Undecidable_problem). | ||
14 | |||
15 | *How is any of this relevant?* | ||
16 | |||
17 | Rust performs compile-time type inference. The type checker, | ||
18 | in turn, compiles and infers types, I would describe it as a | ||
19 | compiler inside a compiler. It is possible that `rustc` may | ||
20 | never finish compiling your Rust program! | ||
21 | |||
22 | I understand that this post lacks content. | ||