aboutsummaryrefslogtreecommitdiff
path: root/content
diff options
context:
space:
mode:
authorMartin Ashby <martin@ashbysoft.com>2022-10-09 13:17:50 +0100
committerMartin Ashby <martin@ashbysoft.com>2022-10-09 13:17:50 +0100
commit6f16ddb3d7c3f67b8f1380cfb197b3bfbf423c30 (patch)
tree34a9cf86a6b0165038c9c9a807d3c08957bd8503 /content
parent34e2a231b027fcbdb4901044f239cb3bd716f112 (diff)
downloadmfashby.net-6f16ddb3d7c3f67b8f1380cfb197b3bfbf423c30.tar.gz
mfashby.net-6f16ddb3d7c3f67b8f1380cfb197b3bfbf423c30.tar.bz2
mfashby.net-6f16ddb3d7c3f67b8f1380cfb197b3bfbf423c30.tar.xz
mfashby.net-6f16ddb3d7c3f67b8f1380cfb197b3bfbf423c30.zip
New short post about quines and rust.
Diffstat (limited to 'content')
-rw-r--r--content/posts/2022-10-09-quine.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/content/posts/2022-10-09-quine.md b/content/posts/2022-10-09-quine.md
new file mode 100644
index 0000000..d104a03
--- /dev/null
+++ b/content/posts/2022-10-09-quine.md
@@ -0,0 +1,10 @@
+---
+title: "Quine"
+date: 2022-10-09T13:11:52+01:00
+draft: false
+---
+
+A [quine](https://en.wikipedia.org/wiki/Quine_%28computing%29) is a program that takes no input, and it's output is it's own source code. A quine-relay is a program that outputs the source code for another program, and when that next program is run it outputs the source code of the first program. I recently saw [this quine relay](https://github.com/mame/quine-relay) program which was super impressive as it goes through 128 languages like this!
+
+Having recently learned some [Rust](https://www.rust-lang.org/), I thought I'd write a simple [quine in rust](https://code.mfashby.net/martin/rust-quine). It wasn't actually as difficult as I imagined, this took about 25 minutes. The rust standard library has a really convenient function `escape_default` which made it pretty easy!
+