Å·±¦ÓéÀÖ

Matt Butcher's Blog

August 7, 2019

Writing a Kubernetes CRD Controller in Rust

In this post, we'll define a Kubernetes Custom Resource Definition (CRD) and then write a controller (or operator) to manage it -- all in 60 lines of Rust code.

Over the last several months, I have been writing more and more Kubernetes-specific code in Rust. Even though Kubernetes itself was written in Go, I am finding that I can typically write more concise, readable, and stable Kubernetes code in Rust. For example, I recently wrote functionally equivalent CRD controllers in Rust and in...

 •  0 comments  •  flag
Published on August 07, 2019 06:58

August 19, 2018

The TRUE hardest programming problem is tight vs. weak coupling

A few months ago, I claimed that . I was wrong. The true hardest problem is one that impacts every developer at every skill level, across all programming languages, regardless of experience. It appears on multiple levels, from language details to large scale distributed computing. It is equally applicable across all programming disciplines. And its impacts are monetary, hedonic, and cognitive.

The hardest problem in programming is this:

Should X and Y...

 •  0 comments  •  flag
Published on August 19, 2018 15:16

July 24, 2018

From Go To Rust - Advanced Testing

For the fifth installment of this series, we'll take a look at benchmarking, documentation testing, and integration testing. As usual, we'll start with an example in Go and see how it translates to Rust. Along the way, we'll be learning about the Rust language.

If you want to catch up on the series:

We started with , and how that compared to Go. Then we for the second post. The third post focused on
 •  0 comments  •  flag
Published on July 24, 2018 18:08

July 21, 2018

Using Azure Static Websites

Over the years I've chronicled the technical changes to this blog and its hosting provider. Years ago, I moved it to cut down on the maintenance. Later I to get rid of RVM madness

For a fun weekend project, I moved from S3 to the brand new (still in preview) service from Azure.

Essentially, I moved the hosted portion of my blog, but didn't actually change the underlying blog software. I'm still using Middle...

 •  0 comments  •  flag
Published on July 21, 2018 13:06

July 7, 2018

From Go to Rust - Unit Testing

In this fourth installment of the series, we'll transform some Go tests into Rust tests.

In case you missed anything:

In the of this series, we looked at some fundamentals of Rust, and how they compare to Go. In the we took a Go web server and reimplemented it in Rust. The focused on JSON and serialization, as we compared Go's annotation-based encoding to Rust's Serde libraries.

Now in this part, we'll look at testing. Along the way, we'...

 •  0 comments  •  flag
Published on July 07, 2018 15:46

July 4, 2018

Be Nice And Write Stable Code

Stop rearchitecting your code! The professional developer values stability over "code purity." Instead of pursuing a Shangra-La vision of code perfection with each and every release, just be nice and write stable APIs. In this post, I talk about taking practical steps toward writing code that remains stable over time.

The Non-Goal

It is completely unhelpful to begin with a suggestion like this:

When you write code, make it future-proof.

If history teaches us anything, it's tha...

 •  0 comments  •  flag
Published on July 04, 2018 08:13

June 12, 2018

From Go to Rust - JSON and YAML

One of Go's big selling points for me was its novel approach to JSON encoding. Learning about Rust's encoding has made me even more excited. In this post, we'll start with Go's JSON encoder, and then see how Rust does encoding. And we'll even through in some YAML!

In the , we looked at a simple Go program, and then converted it to Rust.

In the , we created a simple REST server in Go, then re-implemented it in Rust.

This time, we'll focus...

 •  0 comments  •  flag
Published on June 12, 2018 16:58

June 4, 2018

From Go to Rust with an HTTP Server

One of the staples of the system developer's toolbox is building web applications. These days, we might even say it's building HTTP-based API servers.

In I showed how a Go developer can get a foothold in the Rust world. This time, I'll start with a Go HTTP app and show how to implement it in Rust.

Along the way, we're going to learn quite a bit more about Rust. We'll get the basics of error handling, JSON parsing, and memory...

 •  0 comments  •  flag
Published on June 04, 2018 07:35

May 27, 2018

The Go Developer's Quickstart Guide to Rust

You've been writing Go. But you're feeling an urge to test the waters with Rust. This is a guide to make this switch easy.

Most Loved Languages

As the co-author of , I have felt a certain obligation to Go. But I'm ready for a change. Rust in Stack Overflow's survey of languages (screenshot above). I've decided to give it a try. While Go and Rust are often compared, they are remarkably different languages.

Coming from a Go background, there are thin...

 •  0 comments  •  flag
Published on May 27, 2018 14:09

May 8, 2018

Don't Kill the Competition

Or, why competition is good, and how to keep it from going bad

We rarely work in a vacuum. Whether building things or providing services, there's another team out there that's doing something similar. And this team threatens to capture some of our territory or prevent us from achieving a goal. Naturally, a sense of opposition develops, an us vs. them attitude. Sometimes this is healthy, and sometimes it is not. Here are four mentalities of opposition, four different categories that de...

 •  0 comments  •  flag
Published on May 08, 2018 08:27