A list of simple tasks to perform when learning or evaluating a new language. Each of these should be able to be completed in a few hours, and will help to get the feel of the language and its standard libraries. A well-rounded set of evaluation tasks will help ensure all parts of the language are exercised. You might also write some tests to demonstrate implementation correctness.
- Hello world
- Read lines from a text file and output them in sorted order
- Read numbers from a text file and output the mean and standard deviation
- Given an amount of money and a list of coin denominations provided on the command line, output all the possible ways to make change
- Port a random number generator such as Mersenne Twister
- Parse configuration files in a simple text format such as .ini and build a key-value store
- Simple regex matcher
- Port a compression lib such as LZ4
- Interactive tic-tac-toe game with minimax AI
- Recursive maze generation
- Maze solving
All these should be generic (compile-time parameterized by element type) and constructor/destructor-safe, if applicable.
- Dynamic array
- Intrusive linked list
- Open addressing hash table
- B-tree
- Slab allocator for fixed-sized items
- Chunk-linear allocator (not destructor-safe)
- Intrusive reference counting, with strong and weak references
- Parallel map
- Producer/consumer threads with semaphores
- Lock-free append buffer
- Work-stealing thread pool
- HTTP server with multithreaded request handling and caching
- Generate an image from a simple mathematical function and output it as a .bmp (bonus points for SIMD evaluation)
- Implement Bresenham's line-drawing algorithm
- Implement a simple vector/matrix math library
- Port Perlin's improved noise
- Port stb_image_resize.h
- Recursive raytracer with dynamic-dispatch shapes (e.g. spheres and boxes) and materials (e.g. diffuse, shiny, emissive)
- Realtime 2D particle system with a complex flow field, using SDL or similar (bonus points for SIMD evaluation)
- Simple realtime 3D renderer that loads an .obj mesh and draws it using DX/GL
- Simple realtime audio mixer that tracks one-shot and looping sounds, with different volume and pan settings
- Simple calculator, with buttons for digits and operations
- GUI version of the tic-tac-toe game above
- Simple file system explorer, with tree view for directories and list view for files, showing metadata such as file size and mod date
- Simple CRUD app for a text localization database, storing Unicode strings identified by an integer ID and a language code
- Simple image viewer that allows you to zoom in and out, and shows you the RGB color of a pixel when you mouse over it
- Parse and evaluate arithmetic expressions like
(1 + 2) * 3
using Dijkstra's shunting-yard algorithm - String interning dictionary
- Recursive-descent parser that builds an AST for a simple language, with good error messages
- Interpreter for a simple language
- Allocator that infers the correct size and alignment from the type to allocate
- Programmatically generate a compile-time-constant integer value with every _n_th bit set, parameterized by n.
- Programatically unroll a loop, given a compile-time-constant number of iterations
- Create a text formatting function that recognizes argument types, e.g.
print("Foo: {0}", foo)
does the right thing whetherfoo
is an int, float, string, etc. - Map strings to types, i.e. user inputs "Foo" and you create a Foo object
- Given a regular expression, programmatically generate (at compile time) code that searches that regular expression efficiently
- Given a set of command line parameters, programmatically generate (at compile time) code that parses the parameters into variables
- Programatically generate bindings for a scripting language (e.g. Python or Lua) for a given set of functions or methods