<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:content="http://purl.org/rss/1.0/modules/content/"><channel><title>Golang on Besterry — Linux &amp; DevOps Notes</title><link>https://besterry.com/tags/golang/</link><description>Recent content in Golang on Besterry — Linux &amp; DevOps Notes</description><generator>Hugo</generator><language>en-us</language><lastBuildDate>Mon, 25 Nov 2024 00:00:00 +0000</lastBuildDate><atom:link href="https://besterry.com/tags/golang/index.xml" rel="self" type="application/rss+xml"/><item><title>Rust vs Go for CLI Tools: A Practical Comparison</title><link>https://besterry.com/posts/rust-vs-go-for-cli-tools/</link><pubDate>Mon, 25 Nov 2024 00:00:00 +0000</pubDate><guid>https://besterry.com/posts/rust-vs-go-for-cli-tools/</guid><description>&lt;p&gt;After writing CLI tools in both Rust and Go over the last few years, here are the things that actually matter when choosing between them.&lt;/p&gt;
&lt;h2 id="startup-time"&gt;Startup time&lt;/h2&gt;
&lt;p&gt;Go wins. A trivial Go program starts in ~1-5ms. A trivial Rust program also starts in ~1-5ms. Both are negligible for CLI tools. (The old argument about Go&amp;rsquo;s startup was mostly about JVM-vs-Go, not Go-vs-Rust.)&lt;/p&gt;
&lt;h2 id="binary-size"&gt;Binary size&lt;/h2&gt;
&lt;p&gt;Out of the box:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Go: 5-15 MB for a small program&lt;/li&gt;
&lt;li&gt;Rust: 2-8 MB for a small program (with LTO and strip)&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;After aggressive optimization:&lt;/p&gt;</description></item></channel></rss>