295 lines
14 KiB
HTML
295 lines
14 KiB
HTML
<!DOCTYPE html>
|
||
<html lang="en-gb">
|
||
|
||
<head>
|
||
<meta http-equiv="X-Clacks-Overhead" content="GNU Terry Pratchett" />
|
||
<meta charset="utf-8">
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<link rel="shortcut icon" href="https://blog.vulpine.solutions/favicon.png" />
|
||
<title>rust is good, just not for me | vulpine solutions</title>
|
||
<meta name="title" content="rust is good, just not for me" />
|
||
<meta name="description" content="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)" />
|
||
<meta name="keywords" content="" />
|
||
|
||
|
||
<meta property="og:url" content="https://blog.vulpine.solutions/blog/rust-is-good-just-not-for-me/">
|
||
<meta property="og:site_name" content="vulpine solutions">
|
||
<meta property="og:title" content="rust is good, just not for me">
|
||
<meta property="og:description" content="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)">
|
||
<meta property="og:locale" content="en_gb">
|
||
<meta property="og:type" content="article">
|
||
<meta property="article:section" content="blog">
|
||
<meta property="article:published_time" content="2024-12-02T00:00:00+00:00">
|
||
<meta property="article:modified_time" content="2024-12-02T00:00:00+00:00">
|
||
|
||
|
||
|
||
|
||
<meta name="twitter:card" content="summary">
|
||
<meta name="twitter:title" content="rust is good, just not for me">
|
||
<meta name="twitter:description" content="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)">
|
||
|
||
|
||
|
||
|
||
<meta itemprop="name" content="rust is good, just not for me">
|
||
<meta itemprop="description" content="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)">
|
||
<meta itemprop="datePublished" content="2024-12-02T00:00:00+00:00">
|
||
<meta itemprop="dateModified" content="2024-12-02T00:00:00+00:00">
|
||
<meta itemprop="wordCount" content="810">
|
||
<meta name="referrer" content="no-referrer-when-downgrade" />
|
||
|
||
<style>
|
||
body {
|
||
font-family: Verdana, sans-serif;
|
||
margin: auto;
|
||
padding: 20px;
|
||
max-width: 720px;
|
||
text-align: left;
|
||
background-color: #fff;
|
||
word-wrap: break-word;
|
||
overflow-wrap: break-word;
|
||
line-height: 1.5;
|
||
color: #444;
|
||
}
|
||
|
||
h1,
|
||
h2,
|
||
h3,
|
||
h4,
|
||
h5,
|
||
h6,
|
||
strong,
|
||
b {
|
||
color: #222;
|
||
}
|
||
|
||
a {
|
||
color: #3273dc;
|
||
|
||
}
|
||
|
||
.title {
|
||
text-decoration: none;
|
||
border: 0;
|
||
}
|
||
|
||
.title span {
|
||
font-weight: 400;
|
||
}
|
||
|
||
nav a {
|
||
margin-right: 10px;
|
||
}
|
||
|
||
textarea {
|
||
width: 100%;
|
||
font-size: 16px;
|
||
}
|
||
|
||
input {
|
||
font-size: 16px;
|
||
}
|
||
|
||
content {
|
||
line-height: 1.6;
|
||
}
|
||
|
||
table {
|
||
width: 100%;
|
||
}
|
||
|
||
img {
|
||
max-width: 100%;
|
||
}
|
||
|
||
code {
|
||
padding: 2px 5px;
|
||
background-color: #f2f2f2;
|
||
}
|
||
|
||
pre code {
|
||
color: #222;
|
||
display: block;
|
||
padding: 20px;
|
||
white-space: pre-wrap;
|
||
font-size: 14px;
|
||
overflow-x: auto;
|
||
}
|
||
|
||
div.highlight pre {
|
||
background-color: initial;
|
||
color: initial;
|
||
}
|
||
|
||
div.highlight code {
|
||
background-color: unset;
|
||
color: unset;
|
||
}
|
||
|
||
blockquote {
|
||
border-left: 1px solid #999;
|
||
color: #222;
|
||
padding-left: 20px;
|
||
font-style: italic;
|
||
}
|
||
|
||
footer {
|
||
padding: 25px;
|
||
text-align: center;
|
||
}
|
||
|
||
.helptext {
|
||
color: #777;
|
||
font-size: small;
|
||
}
|
||
|
||
.errorlist {
|
||
color: #eba613;
|
||
font-size: small;
|
||
}
|
||
|
||
|
||
ul.blog-posts {
|
||
list-style-type: none;
|
||
padding: unset;
|
||
}
|
||
|
||
ul.blog-posts li {
|
||
display: flex;
|
||
}
|
||
|
||
ul.blog-posts li span {
|
||
flex: 0 0 130px;
|
||
}
|
||
|
||
ul.blog-posts li a:visited {
|
||
color: #8b6fcb;
|
||
}
|
||
|
||
@media (prefers-color-scheme: dark) {
|
||
body {
|
||
background-color: #333;
|
||
color: #ddd;
|
||
}
|
||
|
||
h1,
|
||
h2,
|
||
h3,
|
||
h4,
|
||
h5,
|
||
h6,
|
||
strong,
|
||
b {
|
||
color: #eee;
|
||
}
|
||
|
||
a {
|
||
color: #8cc2dd;
|
||
}
|
||
|
||
code {
|
||
background-color: #777;
|
||
}
|
||
|
||
pre code {
|
||
color: #ddd;
|
||
}
|
||
|
||
blockquote {
|
||
color: #ccc;
|
||
}
|
||
|
||
textarea,
|
||
input {
|
||
background-color: #252525;
|
||
color: #ddd;
|
||
}
|
||
|
||
.helptext {
|
||
color: #aaa;
|
||
}
|
||
}
|
||
|
||
</style>
|
||
|
||
</head>
|
||
|
||
<body>
|
||
<header><a href="/" class="title">
|
||
<h2>vulpine solutions</h2>
|
||
</a>
|
||
<nav><a href="/">Home</a>
|
||
|
||
|
||
<a href="/blog">Blog</a>
|
||
|
||
</nav>
|
||
</header>
|
||
<main>
|
||
|
||
<h1>rust is good, just not for me</h1>
|
||
<p>
|
||
<i>
|
||
<time datetime='2024-12-02' pubdate>
|
||
Dec 2, 2024
|
||
</time>
|
||
</i>
|
||
</p>
|
||
|
||
<content>
|
||
<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’s a Rust one! in fact, there’s dozens of them. command line tools? good luck finding one that <em>isn’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’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 <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’t vibe with it. (not very deep, mind you, because self-reflection is difficult as <em>hell</em>)</p>
|
||
<h2 id="its-too-low-level">it’s too low-level</h2>
|
||
<p>starting off with the big one: <strong>Rust is a systems language.</strong> while it <em>also</em> 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.</p>
|
||
<p>meanwhile, when <em>i</em> used Rust, i just wrapped everything in an <code>Arc<RwMutex<T>></code><sup id="fnref:3"><a href="#fn:3" class="footnote-ref" role="doc-noteref">3</a></sup> and called it a day, because i <em>don’t</em> 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?</p>
|
||
<h2 id="i-was-constantly-fighting-the-compiler">i was constantly fighting the compiler</h2>
|
||
<p>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. <strong>this was a mistake.</strong></p>
|
||
<p>Rust’s compiler is its strongest suit: it catches bugs that no C or C++ compilers can even <em>imagine</em> 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 <em>pain</em> 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.</p>
|
||
<h2 id="macros-are-magic-but-not-the-good-kind">macros are magic, but not the good kind</h2>
|
||
<p>macros are <em>extremely</em> powerful. many of the libraries i was using heavily relied on them–some, like <code>sqlx</code> (no relation to <code>sqlx</code>, the Go library<sup id="fnref:4"><a href="#fn:4" class="footnote-ref" role="doc-noteref">4</a></sup>) are entirely built around them. they’re also a nightmare to reason with as an inexperienced rustacean.</p>
|
||
<p>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 worked<sup id="fnref:5"><a href="#fn:5" class="footnote-ref" role="doc-noteref">5</a></sup>.</p>
|
||
<h3 id="types-for-days">types for days</h3>
|
||
<p>somewhat related to macros: some libraries like <a href="https://github.com/tokio-rs/axum">axum</a> generate <em>ridiculously</em> long type names, which, while funny, are impossible to actually parse. this didn’t make debugging my code any easier.</p>
|
||
<h2 id="conclusion-i-guess">conclusion, i guess</h2>
|
||
<p>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.</p>
|
||
<p>i definitely think it’s worth thinking about this for <em>any</em> language–or any other <em>tool</em> in general, even–that you dislike. it’s honestly kind of depressing to be extremely negative about things without being able to articulate <em>why</em>. i’m sure i’ve annoyed plenty of friends by complaining about Rust or any other tool they like.</p>
|
||
<p>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.</p>
|
||
<div class="footnotes" role="doc-endnotes">
|
||
<hr>
|
||
<ol>
|
||
<li id="fn:1">
|
||
<p>please ignore that it’s been stable for over 9 years. <a href="#fnref:1" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
<li id="fn:2">
|
||
<p><a href="https://en.wikipedia.org/wiki/Carcinisation">everything seems to evolve into crabs these days.</a> <a href="#fnref:2" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
<li id="fn:3">
|
||
<p>wait a second, does that mean i just used a reference-counting garbage collector? <a href="#fnref:3" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
<li id="fn:4">
|
||
<p><code>sqlx</code>, the Rust library that converts database rows to strongly typed structs using reflection magic (macros), not to be confused with <code>sqlx</code>, the Go library that converts database rows to strongly typed structs using reflection magic (the reflection package). they are somehow completely unrelated. <a href="#fnref:4" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
<li id="fn:5">
|
||
<p>this is, coincidentally, why i don’t use LLMs. <a href="#fnref:5" class="footnote-backref" role="doc-backlink">↩︎</a></p>
|
||
</li>
|
||
</ol>
|
||
</div>
|
||
|
||
</content>
|
||
<p>
|
||
|
||
</p>
|
||
|
||
</main>
|
||
<footer>Made with <a href="https://github.com/janraasch/hugo-bearblog/">Hugo ʕ•ᴥ•ʔ Bear</a>
|
||
</footer>
|
||
|
||
|
||
</body>
|
||
|
||
</html>
|