220 results for "":
My gift to the rustdoc team
About two weeks ago I entered a discussion with the docs.rs team about, basically, why we have to look at this:
When we could be looking at this:
And of course, as always, there are reasons why things are the way they are. In an effort to understand those reasons, I opened a GitHub issue which resulted in a short but productive discussion.
I walked away discouraged, and then decided to, reasons be damned, attack this problem from three different angles.
A half-hour to learn Rust
In order to increase fluency in a programming language, one has to read a lot of it.
But how can you read a lot of it if you don’t know what it means?
In this article, instead of focusing on one or two concepts, I’ll try to go through as many Rust snippets as I can, and explain what the keywords and symbols they contain mean.
Ready? Go!
Variable bindings
Running an executable without exec
In part 1, we’ve looked at three executables:
sample, an assembly program that prints “hi there” using thewritesystem call.entry_point, a C program that prints the address ofmainusingprintf- The
/bin/trueexecutable, probably also a C program (because it’s part of GNU coreutils), and which just exits with code 0.
We noticed that when running entry_point through GDB, it always printed the
same address. But when we ran it directly, it printed a different address on
every run.
Truly headless draw.io exports
I love diagrams. I love them so much!
In fact, I have fairly poor visualization skills, so making a diagram is extremely helpful to me: I’ll have some vague idea of how different things are connected, and then I’ll make a diagram, and suddenly there’s a tangible thing I can look at and talk about.
Of course the diagram only represents a fraction of what I had in mind in the first place, but that’s okay: the point is to be able to talk about some aspect of a concept, and so I have to make choices about what to include in the diagram. And maybe make several diagrams.
State of the fasterthanlime 2024
It’s time for some personal and professional news!
TL;DR: I started a podcast with James, I’m stable on antidepressants, I’m giving a P99 CONF about my Rust/io_uring/HTTP work, I’m trying on “they/them” as pronouns, I’m open-sourcing merde_json, rubicon and others, I got a divorce in 2023, I found a new business model.
Now that we’re on the same page: let’s unpack this a bit!
Migrating from warp to axum
Falling out of love with warp
Back when I wrote this codebase, warp was the best / only alternative for something relatively high-level on top of hyper.
I was never super fond of warp’s model — it’s a fine crate, just not for me.
The way routing works is essentially building a type that gets larger and larger. One route might look like:
bye = warp
warppath
| | name
Consuming Ethernet frames with the nom crate
Now that we’ve found the best way to find the “default network interface”… what can we do with that interface?
Well, listen for network traffic of course!
use rawsock:: open_best_library;
use std:: time:: Instant ;
fn main () -> Result <(), Error > {
let lib = open_best_library () ?;
let iface_name = format! ( r#"\Device\NPF_{}"# netinfo?
iface = libiface_name?
start =
iface |packet|
start
packet
?
Day 1 (Advent of Code 2022)
Two years ago, I did part of Advent of Code 2020 using the Rust language. It was a lot of fun, so let’s try it again!
The problem statement
Our input looks something like this:
1000
2000
3000
4000
5000
6000
7000
8000
9000
10000
Each group of lines separated by an empty line is a list of food items an elf is carrying: each line corresponds to the number of calories in that food.
2020 Retrospective
Against all odds, it looks like the year 2020 will actually come to an end - in less than a day now. I know! Hard to believe for me too.
A lot of things have happened for me personally, and professionally. It’s been a big year in many ways, and I feel like, to get some closure, I need to highlight some of them.
From “looking at graphs” to “driving to the hospital”
Reading files the hard way - Part 3 (ftrace, disk layouts, ext4)
So far, we’ve seen many ways to read a file from different programming languages, we’ve learned about syscalls, how to make those from assembly, then we’ve learned about memory mapping, virtual address spaces, and generally some of the mechanisms in which userland and the kernel interact.
But in our exploration, we’ve always considered the kernel more or less like a “black box”. It’s time to change that.