: Golang


Simple Networking Applications in Rust and Golang

The Premise

I wanted to be more comfortable and competent with the provided networking libraries in Rust and Golang. I figured implementing some simple client/server applications would be a great way to do this.

The Applications

Echo Server

I implemented a simple Echo Server and Client in both Rust and Go.

Here is the Rust source code

And here is the Go source code

Both implementations support the same functionality which is sending either TCP or UDP messages from a client to a server and having the server “echo” back whatever the client sent.

A Small Concurrency Example in Various Languages

The Premise

A common introduction to concurrency is the simple task of spawning two threads, then printing “ping” and “pong” in order N (N = 5 in the following examples) times.

This task is a light intoduction to synchronization primitives like mutexes and condition variables, or in more modern-concurrency models, channels / thread-safe queues.

I figured it’d be interesting to see what this task looks like in different programming languages, so I decided to code it in my four favorite programming languages (python, rust, golang, c++, in that order) to get a sense of their concurrency libraries.