I'd like to introduce project called "Peripheral Template Library" (PTL), which is an (experimental) library to allow development of software/firmware portable across different boards and MCU types/architectures, without compromising efficiency. To achieve both, PTL heavily relies on compile-time metaprogramming techniques and compile-time optimizations targeting level of efficiency and performance higher than that of typical C lib, and closer towards Assembler.
People with solid software development background, when hearing about metaprogramming, definitely thought about LISP and its powerful macros. Indeed, in some parallel world an efficient MCU lib would be written in LISP (or Scheme). However, in our world LISP is niche language due to its syntax, and there're definitely no optimizing LISP compilers for simple MCUs. Fortunately, Alexandrescu et al. thought about giving metaprogramming into hands of C programmers, which is commonly known as "C++ Templates". So, that's it - PTL is C++ template library which depends on (usually simple) metaprogramming techniques to achieve desired efficiency. Note that C++ is still associated with Runtime Object-Oriented Programming (that's in particular how Arduino uses it), but that ~20-years old C++ usage. Modern C++ is actually multi-paradigm language, with metaprogramming being central feature of it.
PTL itself of course was inspired by (spirit of) Arduino. With Arduino, we essentially have def-facto standard API for programming microcontrollers. Unfortunately, it's well-known fact that standard implementation of Arduino API is far from being efficient, with pin access methods being dozen if not hundred times slower than allowed by hardware. Reuse of components is another problem - there're oftentimes problem using different libs accessing same bus/pins, and typical solution to that problem is also sacrifices efficiency. Finally, while Arduino API was ported to many popular architectures (MSP430 with Energia, STM32 with Maple, etc.), overall support and compatibility is rather sketchy and porting to new platform or chip variant is cumbersome, and - again - result usually inefficient.
So, target audience of PTL would be people who are "growing out" of Arduino and want to freely explore new chips and board, and write code, which can be directly turned into "production" and optimized. For example, if it fits within ATtiny13, you don't need to put entire Arduino to it. And if you have app which works well on Arduino, you can put your shiny new ARM Cortex-M board into use by running it there too, without it collecting dust on your shelf, while you try to find time to delve into that beautiful and frightening world of Cortex-M...
PTL is available here: GitHub - pfalcon/PeripheralTemplateLibrary: Cross-platform, cross-MCU C++ template library for microcontrollers and peripheral devices