mastodon.sdf.org is part of the decentralized social network powered by Mastodon.
"I appreciate SDF but it's a general-purpose server and the name doesn't make it obvious that it's about art." - Eugen Rochko

Administered by:

Server stats:

2.3K
active users

Learn more

argv minus one

The crate `csv` has a very clever design.

It parses CSV one byte at a time using a state machine. It has only a few states, none of which have any associated data, so it uses its configuration (delimiter character, quote character, etc) to populate a big table of what to do in every possible combination of state and input byte.

In theory, that is very fast.

I wonder…would it be faster still, if the state machine was generated at compile time by a proc macro?