Plurrrr

Wed 22 Feb 2023

My Own Python Web Framework

Jar is a toy Python web framework, implemented in about 200 lines of code (see cli.py). I built it to explore some ideas around framework APIs, and to explore frameworks from the author-side of things. Please don't actually use it. It's called Jar because it has almost no features and you need to fill it up yourself!

Source: My Own Python Web Framework, an article by Andrew Healey.

C++ Coroutines Part 1: co_yield, co_return and a Prime Sieve

C++ is late to the coroutine party, compared to other programming languages, but they are part of C++20. Prior to coroutines, a C++ programmer had two choices, roughly speaking:

  • Synchronous (straight line) code is easier to understand but less efficient.
  • Asynchronous code (e.g. callbacks) is more efficient (letting you do other work while waiting for things) but is also more complicated (manually saving and restoring state).

Coroutines, “functions whose execution you can pause”, aim to get the best of both worlds: programs that look like sync code but performs like async code.

Source: C++ Coroutines Part 1: co_yield, co_return and a Prime Sieve, an article by Nigel Tao.