News for hackers. Stuff that matters.
Re:Mbeddr – engineering the future of embedded software by SixSigma on Saturday September 13, 2014 @09:42AM (#8312346)
The whole of Plan9 is written like that.

If you look here http://plan9.bell-labs.com/sources/plan9/sys/src/9/

You can see that port & boot are the portable code. Each architecture can fall back on that less optimised code should it need to.

Then each of the directories: bcm, kw, mtx, omap, pc, pcboot, ppc, rb, teg

have platform specific c files

This greatly eases porting to a new architecture and also means cross compilation is significantly easier.

#ifdefs are rare in the source code and other pragmas are few and far between.

Conditional compilation is the enemy of readable code.

Re:Mbeddr – engineering the future of embedded software by sitkack on Saturday September 13, 2014 @10:49AM (#8312504)
Moving and re-moving conditionals is our life. Is there a name for that structure? Polymorphic portability.