diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..8dd6d56 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +public/ +.hugo_build.lock diff --git a/.hugo_build.lock b/.hugo_build.lock deleted file mode 100644 index e69de29..0000000 diff --git a/public/404.html b/public/404.html deleted file mode 100644 index 9d42cf6..0000000 --- a/public/404.html +++ /dev/null @@ -1,234 +0,0 @@ - - - - - - - - -404 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

vulpine solutions

-
- -
-
-

404

-

ʕノ•ᴥ•ʔノ ︵ ┻━┻

- -
- - - - - - diff --git a/public/blog.tar.gz b/public/blog.tar.gz deleted file mode 100644 index 5dabb3a..0000000 Binary files a/public/blog.tar.gz and /dev/null differ diff --git a/public/blog/go-panics-are-fundamentally-flawed/index.html b/public/blog/go-panics-are-fundamentally-flawed/index.html deleted file mode 100644 index 2b30ac6..0000000 --- a/public/blog/go-panics-are-fundamentally-flawed/index.html +++ /dev/null @@ -1,288 +0,0 @@ - - - - - - - - -go's panics are fundamentally flawed | vulpine solutions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

vulpine solutions

-
- -
-
- -

go's panics are fundamentally flawed

-

- - - -

- - -

(alternative title: panic() considered harmful)

-

errors, how do they work anyway?

-

errors in Go programs are represented by values. when calling a function that may return an error, it’ll return (T, error), and you can handle the error the same way you would any other value.

-

(note: the (T, error) syntax doesn’t imply Go has tuples, because it doesn’t. functions can just return multiple values.)

-

now, this approach does have some problems. Go lets you ignore the error very easily, by using the discard operator _ rather than assigning it to a variable. it’s also extremely verbose–anyone who has used Go a substantial amount has written if err != nil { return err } a thousand times. both of these issues are fixable, though: the compiler could emit a warning or an error (heh) when discarding an error value, and new syntax could be introduced to bubble errors up more easily.

-

panic! at the goroutine

-

what isn’t fixable, though, is the panic system. any function, no matter its signature, can call panic() at any point, with any value. as soon as it’s called, the call stack unwinds all the way to main() and the program crashes. a function doesn’t have to indicate that it can do this. in fact, it can’t, except in a documentation comment.

-

you can catch panics with a call to recover(). you can’t put this below a function that might panic, though, you have to use defer before the panic happens. recover() will return the value passed to panic(), or no value if no function panicked. (ironically, recover() also doesn’t return an error, or even a boolean, when nothing panicked. you check if the return value is nil instead.)

-

this is basically a worse version of try { } catch { } in other languages. you can’t guarantee that the value returned by recover() is an error, it can be any type. it moves error recovery away from the source of the error. and, of course, it’s inconsistent: the (T, error) pattern lulls you into a false sense of security, making you think that you handled all possible errors in your application, when surprise! it can always panic.

-

how this could be fixed

-

simple: remove panic() entirely. all functions that panic now must instead return an error, and the caller must handle that error. now when a function doesn’t return an error type, you know it can’t ever crash your program! problem solv–

-

oh. the language itself panics quite a bit as well. trying to access a slice index that doesn’t exist, trying to assign to a nil map, dereferencing a nil pointer, trying to write to a map from multiple goroutines simultaneously, and more can all cause panics. that requires a little more thought.

-

well, here we go:

- -

but really, the biggest problem with panics is that all of the decisions surrounding them are set in stone, forever. Go intends to never release 2.0, which is understandable: they don’t want a repeat of the Python 2 to 3 transition. but it also means the language can never truly grow past some of its faults.

-

luckily, this is all just a thought experiment. if i want a more reasonable error handling system, there are so many other languages to choose from. such as c#–System.NullReferenceException …oh, never mind.

- -
-

- -

- -
- - - - - - diff --git a/public/blog/hello-world/index.html b/public/blog/hello-world/index.html deleted file mode 100644 index e189a88..0000000 --- a/public/blog/hello-world/index.html +++ /dev/null @@ -1,267 +0,0 @@ - - - - - - - - -hello world! | vulpine solutions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

vulpine solutions

-
- -
-
- -

hello world!

-

- - - -

- - -

oh hey, it’s the stereotypical “hello world” post. look at me! i copy pasted a hugo tutorial!

-

turns out making a blog is really difficult, and not for technical reasons. it’s just really hard to actually write things consistently. -i can’t promise anything in that regard–expect this site to get about one post a year, and that’s if i actually remember it exists.

-

until then though, have fun reading the one rant i’ve already written. hope you like go because if not, it probably isn’t for you!

- -
-

- -

- -
- - - - - - diff --git a/public/blog/index.html b/public/blog/index.html deleted file mode 100644 index 70a57fd..0000000 --- a/public/blog/index.html +++ /dev/null @@ -1,281 +0,0 @@ - - - - - - - - -Blog | vulpine solutions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

vulpine solutions

-
- -
-
- - - - - -
- -
-
- -
- -
- - - - - - diff --git a/public/blog/index.xml b/public/blog/index.xml deleted file mode 100644 index 90fe175..0000000 --- a/public/blog/index.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - Blog on vulpine solutions - https://blog.vulpine.solutions/blog/ - Recent content in Blog on vulpine solutions - Hugo - en-gb - sam, CC-BY-SA 4.0 - Mon, 02 Dec 2024 00:00:00 +0000 - - - rust is good, just not for me - https://blog.vulpine.solutions/blog/rust-is-good-just-not-for-me/ - Mon, 02 Dec 2024 00:00:00 +0000 - https://blog.vulpine.solutions/blog/rust-is-good-just-not-for-me/ - <p>Rust is the big new<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> thing in just about every programming niche. web frameworks? of course there&rsquo;s a Rust one! in fact, there&rsquo;s dozens of them. command line tools? good luck finding one that <em>isn&rsquo;t</em> written in Rust these days. databases? oops, all Rust!</p> <p>all of this carcinisation<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> has me feeling kind of left out, though. you see, i&rsquo;ve never really vibed with Rust: i have tried it multiple times, even building a handful of (unfinished, naturally) projects with it, but i always bounce off of it eventually. for a long time, i attributed this to Rust just not being what it&rsquo;s hyped up to be, that it&rsquo;s actually a lot worse than everyone says it is, but&hellip; it really isn&rsquo;t. it <em>is</em> a good programming language. a great one, in fact! i want to dig a little deeper into <em>why</em> i, personally, don&rsquo;t vibe with it. (not very deep, mind you, because self-reflection is difficult as <em>hell</em>)</p> - - - go's panics are fundamentally flawed - https://blog.vulpine.solutions/blog/go-panics-are-fundamentally-flawed/ - Tue, 05 Nov 2024 00:00:00 +0000 - https://blog.vulpine.solutions/blog/go-panics-are-fundamentally-flawed/ - <p><em>(alternative title: <code>panic()</code> considered harmful)</em></p> <h2 id="errors-how-do-they-work-anyway">errors, how do they work anyway?</h2> <p>errors in Go programs are represented by values. when calling a function that may return an error, it&rsquo;ll return <code>(T, error)</code>, and you can handle the error the same way you would any other value.</p> <p>(note: the <code>(T, error)</code> syntax doesn&rsquo;t imply Go has tuples, because it doesn&rsquo;t. functions can just return multiple values.)</p> <p>now, this approach does have some problems. Go lets you ignore the error very easily, by using the discard operator <code>_</code> rather than assigning it to a variable. it&rsquo;s also extremely verbose&ndash;anyone who has used Go a substantial amount has written <code>if err != nil { return err }</code> a thousand times. both of these issues are fixable, though: the compiler could emit a warning or an error (heh) when discarding an error value, and new syntax could be introduced to bubble errors up more easily.</p> - - - hello world! - https://blog.vulpine.solutions/blog/hello-world/ - Mon, 04 Nov 2024 00:00:00 +0000 - https://blog.vulpine.solutions/blog/hello-world/ - <p>oh hey, it&rsquo;s the stereotypical &ldquo;hello world&rdquo; post. look at me! i copy pasted a hugo tutorial!</p> <p>turns out making a blog is really difficult, and not for technical reasons. it&rsquo;s just really hard to actually write things consistently. i can&rsquo;t promise anything in that regard&ndash;expect this site to get about one post a year, and that&rsquo;s <em>if</em> i actually remember it exists.</p> <p>until then though, have fun reading the one rant i&rsquo;ve already written. hope you like go because if not, it probably isn&rsquo;t for you!</p> - - - diff --git a/public/blog/rust-is-good-just-not-for-me/index.html b/public/blog/rust-is-good-just-not-for-me/index.html deleted file mode 100644 index 8c4bfd1..0000000 --- a/public/blog/rust-is-good-just-not-for-me/index.html +++ /dev/null @@ -1,295 +0,0 @@ - - - - - - - - -rust is good, just not for me | vulpine solutions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

vulpine solutions

-
- -
-
- -

rust is good, just not for me

-

- - - -

- - -

Rust is the big new1 thing in just about every programming niche. web frameworks? of course there’s a Rust one! in fact, there’s dozens of them. command line tools? good luck finding one that isn’t written in Rust these days. databases? oops, all Rust!

-

all of this carcinisation2 has me feeling kind of left out, though. you see, i’ve never really vibed with Rust: i have tried it multiple times, even building a handful of (unfinished, naturally) projects with it, but i always bounce off of it eventually. for a long time, i attributed this to Rust just not being what it’s hyped up to be, that it’s actually a lot worse than everyone says it is, but… it really isn’t. it is a good programming language. a great one, in fact! i want to dig a little deeper into why i, personally, don’t vibe with it. (not very deep, mind you, because self-reflection is difficult as hell)

-

it’s too low-level

-

starting off with the big one: Rust is a systems language. while it also works very well for web development, command line tools, and other software, it’s not what it was designed for. it was designed for scenarios where you can (and often need to!) squeeze as much performance as possible out of a system, where a garbage collector on its own would already not fit into the device’s memory, and where a string taking up any more space than its literal bytes is unacceptable.

-

meanwhile, when i used Rust, i just wrapped everything in an Arc<RwMutex<T>>3 and called it a day, because i don’t care about performance all that much. HTTP and database latency already destroy any optimization i could do to the business logic, so why even bother?

-

i was constantly fighting the compiler

-

i’ll admit it: i didn’t really go out of my way to learn Rust. like every other language i’ve used, i just jumped in headfirst and started trying to rewrite my silly little programs into the silly little crab language. this was a mistake.

-

Rust’s compiler is its strongest suit: it catches bugs that no C or C++ compilers can even imagine exist, and its borrow checker seems like dark magic at times. but what makes the compiler great for experienced Rust users makes it an absolute pain for people learning the language. other languages let you throw code at the wall and see what sticks; Rust won’t even let your code compile unless it works perfectly. this makes my learning process a lot more difficult, and as such, i never really learned more advanced Rust.

-

macros are magic, but not the good kind

-

macros are extremely powerful. many of the libraries i was using heavily relied on them–some, like sqlx (no relation to sqlx, the Go library4) are entirely built around them. they’re also a nightmare to reason with as an inexperienced rustacean.

-

i’m used to being able to ctrl-click on a function invocation to go directly to its implementation in other languages–Go, C#, and even Python all do this (well, as long as the Python package has type annotations, and you’re not relying on external ones). this just doesn’t work with macros, because the code is generated at compile time. it felt like i was feeding input into a black box and praying that whatever came out on the other side worked5.

-

types for days

-

somewhat related to macros: some libraries like axum generate ridiculously long type names, which, while funny, are impossible to actually parse. this didn’t make debugging my code any easier.

-

conclusion, i guess

-

i don’t really have any conclusion to draw from writing this. i guess my learning process just doesn’t mesh with how Rust works, and that’s why i bounced off of it.

-

i definitely think it’s worth thinking about this for any language–or any other tool in general, even–that you dislike. it’s honestly kind of depressing to be extremely negative about things without being able to articulate why. i’m sure i’ve annoyed plenty of friends by complaining about Rust or any other tool they like.

-

in fact, i should write a post like this for every language i dislike! Go, Elixir, maybe even PHP–well, maybe not that last one. it’s been so long since i last used it that i’m sure all my problems with it have been fixed at this point.

-
-
-
    -
  1. -

    please ignore that it’s been stable for over 9 years. ↩︎

    -
  2. -
  3. -

    everything seems to evolve into crabs these days. ↩︎

    -
  4. -
  5. -

    wait a second, does that mean i just used a reference-counting garbage collector? ↩︎

    -
  6. -
  7. -

    sqlx, the Rust library that converts database rows to strongly typed structs using reflection magic (macros), not to be confused with sqlx, the Go library that converts database rows to strongly typed structs using reflection magic (the reflection package). they are somehow completely unrelated. ↩︎

    -
  8. -
  9. -

    this is, coincidentally, why i don’t use LLMs. ↩︎

    -
  10. -
-
- -
-

- -

- -
- - - - - - diff --git a/public/favicon.png b/public/favicon.png deleted file mode 100644 index 6e39f66..0000000 Binary files a/public/favicon.png and /dev/null differ diff --git a/public/index.html b/public/index.html deleted file mode 100644 index 0155194..0000000 --- a/public/index.html +++ /dev/null @@ -1,252 +0,0 @@ - - - - - - - - - -Home | vulpine solutions - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

vulpine solutions

-
- -
-
-

heya, i’m sam! this is my attempt at a blog which i will definitely update often, trust me.

-

i deliberately don’t really have a public online presence, but you can find me here:

- -
vulpine problems require vulpine solutions
- - -
- - - - - - diff --git a/public/index.xml b/public/index.xml deleted file mode 100644 index 207d4cd..0000000 --- a/public/index.xml +++ /dev/null @@ -1,34 +0,0 @@ - - - - Home on vulpine solutions - https://blog.vulpine.solutions/ - Recent content in Home on vulpine solutions - Hugo - en-gb - sam, CC-BY-SA 4.0 - Mon, 02 Dec 2024 00:00:00 +0000 - - - rust is good, just not for me - https://blog.vulpine.solutions/blog/rust-is-good-just-not-for-me/ - Mon, 02 Dec 2024 00:00:00 +0000 - https://blog.vulpine.solutions/blog/rust-is-good-just-not-for-me/ - <p>Rust is the big new<sup id="fnref:1"><a href="#fn:1" class="footnote-ref" role="doc-noteref">1</a></sup> thing in just about every programming niche. web frameworks? of course there&rsquo;s a Rust one! in fact, there&rsquo;s dozens of them. command line tools? good luck finding one that <em>isn&rsquo;t</em> written in Rust these days. databases? oops, all Rust!</p> <p>all of this carcinisation<sup id="fnref:2"><a href="#fn:2" class="footnote-ref" role="doc-noteref">2</a></sup> has me feeling kind of left out, though. you see, i&rsquo;ve never really vibed with Rust: i have tried it multiple times, even building a handful of (unfinished, naturally) projects with it, but i always bounce off of it eventually. for a long time, i attributed this to Rust just not being what it&rsquo;s hyped up to be, that it&rsquo;s actually a lot worse than everyone says it is, but&hellip; it really isn&rsquo;t. it <em>is</em> a good programming language. a great one, in fact! i want to dig a little deeper into <em>why</em> i, personally, don&rsquo;t vibe with it. (not very deep, mind you, because self-reflection is difficult as <em>hell</em>)</p> - - - go's panics are fundamentally flawed - https://blog.vulpine.solutions/blog/go-panics-are-fundamentally-flawed/ - Tue, 05 Nov 2024 00:00:00 +0000 - https://blog.vulpine.solutions/blog/go-panics-are-fundamentally-flawed/ - <p><em>(alternative title: <code>panic()</code> considered harmful)</em></p> <h2 id="errors-how-do-they-work-anyway">errors, how do they work anyway?</h2> <p>errors in Go programs are represented by values. when calling a function that may return an error, it&rsquo;ll return <code>(T, error)</code>, and you can handle the error the same way you would any other value.</p> <p>(note: the <code>(T, error)</code> syntax doesn&rsquo;t imply Go has tuples, because it doesn&rsquo;t. functions can just return multiple values.)</p> <p>now, this approach does have some problems. Go lets you ignore the error very easily, by using the discard operator <code>_</code> rather than assigning it to a variable. it&rsquo;s also extremely verbose&ndash;anyone who has used Go a substantial amount has written <code>if err != nil { return err }</code> a thousand times. both of these issues are fixable, though: the compiler could emit a warning or an error (heh) when discarding an error value, and new syntax could be introduced to bubble errors up more easily.</p> - - - hello world! - https://blog.vulpine.solutions/blog/hello-world/ - Mon, 04 Nov 2024 00:00:00 +0000 - https://blog.vulpine.solutions/blog/hello-world/ - <p>oh hey, it&rsquo;s the stereotypical &ldquo;hello world&rdquo; post. look at me! i copy pasted a hugo tutorial!</p> <p>turns out making a blog is really difficult, and not for technical reasons. it&rsquo;s just really hard to actually write things consistently. i can&rsquo;t promise anything in that regard&ndash;expect this site to get about one post a year, and that&rsquo;s <em>if</em> i actually remember it exists.</p> <p>until then though, have fun reading the one rant i&rsquo;ve already written. hope you like go because if not, it probably isn&rsquo;t for you!</p> - - - diff --git a/public/robots.txt b/public/robots.txt deleted file mode 100644 index 8a3702f..0000000 --- a/public/robots.txt +++ /dev/null @@ -1,2 +0,0 @@ -User-Agent: * -Sitemap: https://blog.vulpine.solutions/sitemap.xml diff --git a/public/sitemap.xml b/public/sitemap.xml deleted file mode 100644 index bb8e55a..0000000 --- a/public/sitemap.xml +++ /dev/null @@ -1,20 +0,0 @@ - - - - https://blog.vulpine.solutions/blog/ - 2024-12-02T00:00:00+00:00 - - https://blog.vulpine.solutions/ - 2024-12-02T00:00:00+00:00 - - https://blog.vulpine.solutions/blog/rust-is-good-just-not-for-me/ - 2024-12-02T00:00:00+00:00 - - https://blog.vulpine.solutions/blog/go-panics-are-fundamentally-flawed/ - 2024-11-05T00:00:00+00:00 - - https://blog.vulpine.solutions/blog/hello-world/ - 2024-11-04T00:00:00+00:00 - -