When I’m learning a new language, I’ll often start with a widely recognized guide (something like Learn You A Haskell) and then, almost always, my next step is to go full steam and build a clone of redis. My goal is to get a working datastore that speaks the redis protocol, saves to disk, and implements all of the basic data structures along with most of the operations you can perform on them.
I like this approach because it gives you a pretty cool end product (a fully functioning datastore) and also forces you to understand a great deal of concepts in a new language. To build redis, you need to be able to do a pretty wide number of things.
- Understand networking for accepting client connections.
- Understand file operations (reading configs, backing up your data to disk)
- Understand string parsing for interpreting the redis protocol.
- Understand builtin data structures in your new language (Lists, Sets, SortedSets, Hashes)
- Understand concurrency (multiple clients, one underlying datastore)
- Understand object serialization for writing objects to your backup file
- Understand how to structure a project in your new language