u/jcaberioin r/programming • Recommends
On “Choose C over C++ for writing simple libraries”
link to this video
this talk elaborates on that approach
189K subscribers • 123 videos on Hallway • Conference channel
Advanced. Deep dive for people who know the field.
13K views12 years ago2 recommendations
Systems programmingSoftware designC++CAPI design
Stefanus DuToit explains the hourglass pattern for structuring C++ libraries to achieve binary compatibility and easy language bindings using C interfaces.
cppcon.org — Presentation Slides, PDFs, Source Code and other presenter materials are available at: github.com/CppCon/CppCon2014 -- C++ provides a much richer set of abstractions than C. Classes, templates, overloading, and other core C++ features can be leveraged for more readable syntax, better compile time typechecking, more open ended genericity and improved modularity. On the flip side, C89 still boasts some advantages over C++, especially when viewed through a pragmatic lens. C ABIs on many platforms have been stable for decades, practically every language supports binding to C code through foreign function interfaces, and including nearly any C89 header has a negligible effect on compile time on modern computers. The Hourglass pattern provides the best of both worlds. It's a way to structure libraries that retains the pragmatic benefits of C89 while still providing C++'s richness both at an interface and implementation level. It makes providing bindings from other languages to C++ libraries easier, and insulates from ABI issues such as incompatibilities between debug and release variants of runtimes. This talk provides an overview of the pattern, teaches practical techniques for its implementation using C++98 and C++11, and shares experience from using the pattern in real world projects. -- Stefanus Du Toit is a Software Lead at Thalmic Labs, where he enables amazing gestural experiences using the Myo armband. Stefanus previously worked as a Software Architect and Software Development Manager at Intel Corporation, and co-founded RapidMind (acquired by Intel), a startup that targeted GPUs and other processors using standard C++. Stefanus served on the C++ standards committee as Project Editor for C++14 and as Committee Secretary. He lives in Kitchener-Waterloo, Ontario, Canada and holds a BMath CS from the University of Waterloo. -- Videos Filmed & Edited by Bash Films: BashFilms.com Work at Hudson River Trading (HRT): tinyurl.com/safxfctfWhat people say. Recommended for understanding how to design binary-compatible C++ libraries using C interfaces to avoid ABI issues across compilers.
u/jcaberioin r/programming • Recommends
On “Choose C over C++ for writing simple libraries”
u/MoR7qMin r/swift • Recommends
On “What do you think swift needs in order to get more adoption outside of apple platforms?”