RSSAmplifier

Blog

Esoterically Typed

Recent content on Esoterically Typed

leshow.github.ioRSS feed ↗12 posts

Latest posts

ARP Injection in Rust on Linux

Don’t ask why, but I had to learn about this a while ago and had been meaning to write it down. ARP is Address Resolution Protocol, it is a layer 2 protocol used in local IPv4 networks for discovering a MAC address for a given IP. Say you want to send a packet to an IP on your local network, 192.168.0.136. The ethernet frame requires a destination MAC address, but you don’t know what…

Rust superpowered DHCP cli with rhai scripts

I’ve been working on cli tool for a little while called dhcpm (“m” for “mock” - link). It started as a cli tool for constructing & sending arbitrary DHCP messages. I had been looking for a tool that could build various dhcp (mostly v4) messages with different parameters easily, then simply print the responses back so I could inspect its contents. I discovered that you…

Introducing: DHCProto

DHCProto is available now on crates.io. DHCProto implements a parser/encoder for DHCPv4 & DHCPv6. This crate was born out of a lack of DHCP offerings currently available in Rust. It has a comprehensive list of option types implemented, and a fallback variant for options not yet implemented. This library was written at my work (Bluecat), and they have graciously let us open source it, available on…

nailgun: DNS benchmarking tool

nailgun is a small hobby project I’ve been working on sparsely for a few months, it’s a cli DNS benchmarking tool heavily inspired by flamethrower but written in Rust with tokio. I’ve been working at the intersection of DNS & Rust for a little while and this is something I’ve been pushing along in my free time. Rest assured, it has no real reason for existing just yet other…

A look at tokio 1.0 API Changes

I’ve been working in the Rust space for about a year now using tokio & async/await with DNS. The result of this work is a sizeable from-scratch tokio server using 0.2 (that’s now in production– yay! hopefully I can share more about this later). As a result, I’ve gotten to know the UDP API of tokio quite well, and have even got to submit a few PRs (double yay). I’d…

Cheating Higher Ranks with Traits

I ran into this a little while ago and thought it would be helpful to share a possible solution. Imagine you have an enum that describes a set of possible branches, for each branch there is a type associated with it that you want to run through a function, for this example&ndash; serialize. enum Var{One,Two,}#[derive(Serialize)]struct Foo;#[derive(Serialize)]struct Bar;fn write<W>(var:…

Rust for Java Devs

I&rsquo;d like to take a change for this blog and leave the more bleeding edge topics to focus on perhaps one of the most important things one can do in the Rust community: teaching new Rust developers. I&rsquo;ve been thinking about how best to approach teaching Rust to those used to working with Java, in order to bring a group of developers up to speed with the language for a new project.

Rotary Encoders in Embedded Rust

Recently, I&rsquo;ve been trying to learn more about electronics and embedded development. Maybe I&rsquo;m just tired of operating purely in the virtual, but there&rsquo;s something cool about being able to physically put together a circuit and push a button to make something happen. I went through the usual Arduino resources before seeing what Rust had to offer. I&rsquo;m happy to report…

Updating to Async/Await

Unless you&rsquo;ve been living under a rock; you know async/await is coming to rust stable. My last post was about implementing a simple protocol using manual futures, and interacting with tokio. It&rsquo;s only fitting, then, that I update the lib that post was inspired by to async/await and report back on my findings. If you&rsquo;re curious about my library or you use the window manager i3,…

Protocols in Tokio (i3 IPC)

There&rsquo;s a dearth of blog posts online that cover the details of implementing a custom protocol in tokio, at least that I&rsquo;ve found. I&rsquo;m going to cover some of the steps I went through in implementing an async version i3wm&rsquo;s IPC. Granted, I&rsquo;ve not finished my library to a point I&rsquo;m comfortable releasing it, but I hope I can provide some examples for the aspiring…

Unit Type Params

Updated: The cs140e hosted on Stanford&rsquo;s servers is down, but Sergio has helpfully put up an archived copy here. I&rsquo;ve changed the links in this post to reflect that. I always enjoy reading blogs about patterns or tricks people have picked up writing Rust. I&rsquo;ve seen this a few times but not read about it anywhere. I&rsquo;ve been doing class assignments from Operating Systems…

About me

Hi! My name is Evan Cameron. I&rsquo;m leshow on github, you can also find me on twitter. I like languages with cool type systems. Rust/Haskell weekend warrior.