From 2ddbc2b056af0585b905606a2c6887d43f9c3b01 Mon Sep 17 00:00:00 2001 From: Leonardo Santiago Date: Sat, 1 Jun 2024 17:30:03 -0300 Subject: localize bearblog, update some UI --- content/_index.md | 5 +++-- content/about.md | 3 ++- content/blog/rust-is-not-about-memory-safety.md | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) (limited to 'content') diff --git a/content/_index.md b/content/_index.md index db8eace..a4f9a56 100644 --- a/content/_index.md +++ b/content/_index.md @@ -1,7 +1,8 @@ +++ -title = "lowest case" +title = "home" author = ["santi"] -lastmod = 2024-06-01T10:31:58-03:00 +description = "a lower case only blog, purely for aesthetics" +lastmod = 2024-06-01T17:29:17-03:00 draft = false +++ diff --git a/content/about.md b/content/about.md index 6f59209..5ca6f1b 100644 --- a/content/about.md +++ b/content/about.md @@ -1,7 +1,8 @@ +++ title = "about" author = ["santi"] -lastmod = 2024-06-01T12:12:47-03:00 +description = "a lower case only blog, purely for aesthetics" +lastmod = 2024-06-01T17:29:17-03:00 draft = false menu = "main" +++ diff --git a/content/blog/rust-is-not-about-memory-safety.md b/content/blog/rust-is-not-about-memory-safety.md index b060f3c..e794a39 100644 --- a/content/blog/rust-is-not-about-memory-safety.md +++ b/content/blog/rust-is-not-about-memory-safety.md @@ -1,7 +1,8 @@ +++ title = "rust is not about memory safety" author = ["santi"] -lastmod = 2024-06-01T15:21:30-03:00 +description = "a lower case only blog, purely for aesthetics" +lastmod = 2024-06-01T17:29:17-03:00 tags = ["rust", "correctness"] draft = false +++ @@ -36,7 +37,7 @@ i say _well behaved_ because i can't say _invalid_. it is in fact defined by the framing it this way really exposes the fragility of C, because undefined behavior has to always be taken into account. and, by the nature of it, there is no way to represent it other than as a black box, such that, if your code ever encounters it, then literally all you can say is that **the whole result of the program** is undefined - that is, it can be anything. you cannot show properties, nor say what will happen once your program enters this state, as the C specification literally does not define it. it may come to a halt, write garbage to the screen or completely delete half of the files of your program, and there's no way to predict what will come out of it, by definition. in the lucky case, it will segfault while executing and you'll be extremely pissed off, but that is not at all guaranteed. this is akin to having a float expression with some deep term being `NaN`, in that it eventually must evaluate to `NaN` and you can't draw any conclusions about the result of the expression (other that it isn't a number). -language designers are by no means dumb, and yes, they know much, much more than me about these problems. undefined behavior exists exactly because there must be parts of your code that your compiler **must** assume that aren't possible, so that it can correctly compile. for example, let's say that you inadvertently try to dereference a pointer that you have no knowledge about. the C compiler simply does not have enough information to know if it is `NULL`, if it is still pointing to valid memory, or if the memory has been initialized, so what it's approach is simply emit code **as if** it was a valid, initialized, non-null pointer. +language designers and compiler developers are by no means dumb, and yes, they know much, much more than me about these problems. undefined behavior exists exactly because there must be parts of your code that your compiler **must** assume that aren't possible, so that it can correctly compile. for example, let's say that you inadvertently try to dereference a pointer that you have no knowledge about. the C compiler simply does not have enough information to know if it is `NULL`, if it is still pointing to valid memory, or if the memory has been initialized, so what it's approach is simply emit code **as if** it was a valid, initialized, non-null pointer. it is essential to realize that this is an **assumption**, and in almost most cases, it simply does not care whether or not it actually was actually still valid, so writing to it may have a myriad of effects of different effects (none of which are the compiler's concerns). sometimes, your system might correctly intercept a read/write from invalid/null memory and raise you a signal, but that is not guaranteed. -- cgit v1.2.3