Events

C++ User Group Meetings in August

Again, the overview about the upcoming user group meetings for the new month. As it is August, there are not as much meetings due to summer.

C++ User Group Meetings in August 2014

by Jens Weller

From the article:

6.8. C++ UG Austin - Pragmatic Type Erasure
13.8 C++ UG Bay area/San Francisco
14.8 C++ UG Dresden - Compile Time Sort"
14.8 C++ UG NRW/Aachen - Various talks
19.8 C++ UG Berlin - Experience with C++11 in ArangoDB
20.8 C++ UG NRW/Düsseldorf - Wartungtechniken
28.8 C++ UG Amsterdam - Event Driven Design in C++11

CppCon Program Highlights, 10 of N: Migrating Code to Modern C++

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

There is lots -- lots -- of existing C++ code. How can you effectively bring existing C++ code forward to C++11/14? How can you upgrade your coding styles and conventions? The following CppCon 2014 talks tackle these issues and more.

In this post:

  • Adventures in Updating a Legacy Codebase
  • Elevate Your Code to Modern C++11 with Automated Tooling
  • An Overview of C++11/14

 

Adventures in Updating a Legacy Codebase

Still maintaining a legacy application? Do you have strdup()'s crying to be replaced with std::string? Do pre-standard headers such as iostream.h litter your code? Do boost libraries no longer compile with your favorite C++98 compiler? From GUIs to kernel drivers, this talk will look at some of the adventures taken while updating a codebase with more than 20 years of history to C++11.

Speaker: Billy Baker, Senior Staff Engineer, FlightSafety International. Billy Baker has developed deterministic real-time flight simulation software using C++ for FlightSafety International, Evans and Sutherland and Boeing since 1997. At C++ committee meetings, he can most likely be found in LWG. He received his B.S. and M.S in Applied Mathematics from the University of Tulsa and is currently working on a Ph.D. in Computer Science. If asked, he will tell stories from his research semester at NCSA when web browsers did not yet have forms support.

 

Elevate Your Code to Modern C++11 with Automated Tooling

This talk will motivate and demonstrate how to transform your existing C++ code into more modern style and better quality. A key to that is refactoring the code into better shape. While manual refactoring can be tedious and error prone the author demonstrates automated refactoring that was created by his students and assistants and himself over the last nine years on the basis of Eclipse CDT. The tooling works with all compilers, because it is independent of one.

For example, we will show how to eliminate unnecessary macros or replace them by type-safe C++11/14 alternative code automatically. Or, to replace pointers, plain arrays and manual memory management by references, smart pointers, std::string, std::array, or std::vector automatically. Also other transformations, such as introducing a template parameter to reduce a coupling to a single concrete type are demonstrated. All with the goal to modernize and hopefully simplify your C++ code. Even if you are not deeply interested in modernizing your code base, some helpful tooling, such as toggling function definitions into a single place, to change their signature, can be of great help. On the other hand, many of the proposed improvements can also be applied with your favorite code editor only more tediously.

Speaker: Peter Sommerlad, Professor, Director IFS, FHO HSR Rapperswil -- IFS Institute for Software. Prof. Peter Sommerlad is head of IFS Institute for Software at FHO HSR Rapperswil. Peter is co-author of the books POSA Vol.1 and Security Patterns. His goal is to make software simpler by Decremental Development: Refactoring software down to 10% its size with better architecture, testability and quality and functionality. Peter is a member of the C++ standardization committee, ACCU, ACM, SI and president of SWEN.Website: http://wiki.hsr.ch/PeterSommerladTwitter handle: @PeterSommerlad

 

An Overview of C++11/14

This accelerated introduction to C++11/C++14 surveys most of the key additions to the C++ language, including support for 1) increased code clarity (lambdas, uniform initialization, auto, new OOD control), 2) improved performance (rvalue references and move constructors), 3) multithreading (concurrency and atomic types).

The presentation is designed for those who truly need a quick overview of the new C++, so the focus is on breadth rather than depth. Whenever feasible, new language features are presented in a style showcasing how they improve over their "Old C++" counterparts.

Speaker: Leor Zolman, BD Software. Leor Zolman has been involved in system software/compiler development, system administration, application development, and education for 40 years, spanning the CP/M, UNIX, and Windows operating systems. Leor is the author of The BD Software C Compiler (“BDS C”, 1979), the first native-code C compiler targeted exclusively for personal computers. In the early 90’s, Leor was a member of the technical staff of R&D Publications, where he wrote columns for R&D’s magazines: The C/C++ Users Journal, Windows Developer’s Journal, and SysAdmin, and he also authored the first book ever published by R&D Books: Illustrated C. More recently, in addition to designing and delivering on-site training courses on C, C++, Java, Perl, and Unix, Leor wrote STLFilt: An STL Error Message Decryptor for C++, a Freeware tool for simplification of complex (i.e., unreadable) template-related C++ error diagnostics. When not engaged in learning or teaching C++, you may find Leor administering and participating in several financial discussions boards, riding his BMW R1200RT, playing tennis or showing people the Ring Nebula through his LX200GPS telescope at star parties around the North Shore Boston area.

CppCon Program Highlights, 9 of N: Safety

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

Safety and C++ are complementary, and C++ is regularly used in safety-critical systems including with strong static analysis support across multiple popular compilers. From the latest jet fighter avionics systems to the most modern Clang sanitizers, CppCon has a number of talks in this area including the following four. As always, the talks are by Those Who Know and Those Who Do -- including in some of the world's most famous codebases.

In this post:

  • The Joint Strike Fighter Coding Standard: Using C++ on Mission and Safety Critical Platforms
  • Sanitize your C++ code
  • Exception-Safe Code
  • 0xBADC0DE

 

The Joint Strike Fighter Coding Standard: Using C++ on Mission and Safety Critical Platforms

The Joint Strike Fighter (JSF) is the first major DOD aircraft program to use C++. Much of this software is either safety critical or mission critical and so must be written in such a way as to be clear, readable, unambiguous, testable, and maintainable. We discuss the driving requirements behind the standard and its evolution. We give a quick overview of our standard and discuss how it differs from later standards such as MISRA C++. We discuss lessons learned over our nine year history of applying the standard to a large embedded software program. We also address ambiguities in rules and difficulties with automated checking of conformance with the standard.

Speaker: Bill Emshoff, Senior Staff Software Engineer, Lockheed Martin. Bill Emshoff has been programming in C++ for over 12 years. He is currently a Senior Staff Software Engineer working on the Joint Strike Fighter program at Lockheed Martin, where he has evolved to become an informal interpreter of the JSF coding standard and champion of static analysis as a means to catch and prevent coding errors prior to formal test.

 

Sanitize your C++ code

"Sanitizers" is a family of dynamic testing tools built into C++ compilers (Clang and GCC):•AddressSanitizer finds memory errors, such as use-after-free, buffer overflows, and leaks;

  • ThreadSanitizer finds data races, deadlocks, and other threading bugs;
  • MemorySanitizer finds uses of uninitialized memory;
  • UndefinedBehaviorSanitizer finds other kinds of undefined behavior, such as use of incorrect dynamic type, shift by illegal amount and many others.

You will learn how these tools work, how to use them on small programs and how we deploy them in large projects.

Speaker: Kostya Serebryany, Software Engineer, Google. Konstantin (Kostya) Serebryany is a Software Engineer at Google. His team develops and deploys dynamic testing tools, such as AddressSanitizer and ThreadSanitizer. Prior to joining Google in 2007, Konstantin spent 4 years at Elbrus/MCST working for Sun compiler lab and then 3 years at Intel Compiler Lab. Konstantin holds a PhD from mesi.ru and a Master from msu.ru.Twitter handle: @kayseesee

 

Exception-Safe Code

Are you 100% confident that your code is exception-safe?

Safe usage of exceptions is a non-trivial problem that the industry has struggled with for the better part of two decades. If you have fear, uncertainty, or doubt about exception safety or just want to see the best practices for using exceptions in C++ and/or C++11/14, this session is for you. We'll start with "What is the problem we are trying to solve?" and discuss alternatives, acknowledge the challenges associated with exception usage, and cover some well-meaning but misguided attempts at safety. I will then present a set of guidelines that are the basis for safe exception usage and solid implementation techniques, including how to transition from an exception-unsafe legacy code base.

When we are finished you will know how to produce code that is easier to write, easier to understand, faster, and 100% robust in the face of exceptions.

Speaker: Jon Kalb Jon has been programming in C++ for over twenty years. During the last two decades he has written C++ for Apple, Dow Chemical, Intuit, Lotus, Microsoft, Netscape, Sun, Yahoo! and some less well­‐known companies. He taught C++ in the graduate school at Golden Gate University for three years and is a founding moderator of the Boost‐User and Boost‐Interest mailing lists.

Jon is active in the Silicon Valley chapter of the ACCU and programs the C++ track at the Silicon Valley Code Camp.

 

0xBADC0DE

My motivation for this talk is my own experience as a freelancer and trainer. I have seen a lot of good and bad code in different places. As a freelancer I often had to deal with different, unknown and often large codebases. This talk tries not only to show examples of bad code, but also to analyze why it exists in the first place, and how to deal with it or fix it. I'll visit anti-patterns, but this talk is not about anti-patterns, as that would only spotlight one of the many problems.

Speaker: Jens Weller Jens is a longtime C++ expert and the organizer of the European C++ conference Meeting C++.

CppCon Program Highlights, 8 of N: C++ Tools

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

Tool support is essential to modern software engineering techniques, including notably refactoring and the unit testing heavily popularized by TDD. Here are some of the CppCon talks related to such tooling. As always, the talks are by the people in the trenches, who are heavily using the tools or actively involved in developing them -- in some of the world's largest code bases and code repositories with O(10 billion) lines of preprocessed code.

In this post:

  • Large-Scale Refactoring @ Google
  • C++ Test-driven Development: Unit Testing, Code Assistance and Refactoring
  • Pragmatic Unit Testing in C++
  • A CTO's guide to Modern C++

 

Large-Scale Refactoring @ Google

Many organizations have significant investments in a large existing C++ codebase, and Google is no exception. Our code is intended to survive for decades, but continue to track new language standards as they emerge. To do so, we have developed tools and techniques which provide the ability to automatically refactor code to use new APIs as they become available.

In this talk, I'll discuss some of the reasons for doing migrations that impact hundreds of thousands of files, and how we do them at Google, using tools such as ClangMR. I'll give examples, such as our recent migration to the standardized std::unique_ptr and std::shared_ptr types and lessons we've learned from these experiences. Finally, I'll point out pitfalls others may face in doing similar work, and suggest ways that they can be avoided.

Speaker: Hyrum Wright, Software Engineer, Google. Hyrum Wright is a software engineer at Google, working on C++ library infrastructure. He is a member of the Apache Software Foundation, and a contributor to Apache Subversion. In a previous life, he was a grad student. He enjoys cycling. Twitter handle: @hyrumwright

 

C++ Test-driven Development: Unit Testing, Code Assistance and Refactoring

Unit Testing and TDD, if applied correctly, lead to high quality and simple code. If done by hand, both often require writing some boiler-plate code and can be slow and cumbersome. Especially refactoring without good tool support can be a burden. Java and C# developers are used to have good tool support for these tasks to be effective. Many C++ developers often aren't even aware of the need for the practices, because without tool support and training of the goals, they are hard to discover.

This talk introduces C++ Unit Testing, Test-driven Development, and Refactoring and demonstrates the tooling available for Eclipse CDT for free on www.cevelop.com that was inspired and implemented by the author and his team.

For example, when phrasing a unit test to use a to-be-defined class, the class is generated automatically from its name used as a type. Another tool feature is simplifying a function, by extracting a sub-function and placing a call in its place.

Speaker: Peter Sommerlad, Professor, Director IFS, FHO HSR Rapperswil - IFS Institute for Software. Prof. Peter Sommerlad is head of IFS Institute for Software at FHO HSR Rapperswil. Peter is co-author of the books POSA Vol.1 and Security Patterns. His goal is to make software simpler by Decremental Development: Refactoring software down to 10% its size with better architecture, testability and quality and functionality. Peter is a member of the C++ standardization committee, ACCU, ACM, SI and president of SWEN.Website: http://wiki.hsr.ch/PeterSommerladTwitter handle: @PeterSommerlad

 

Pragmatic Unit Testing in C++

Successful adoption of unit testing goes beyond picking a framework: The effectiveness of unit testing is dependent on run-time analysis, static analysis, and other tools to make up the "iron triangle" necessary to get profitable increases in feature velocity and MTBF in the field. We'll cover where to start in a legacy codebase get the most ROI on unit testing effort, the top 5 legacy design knots and refactoring steps to loosen those knots, and how to write tests that are easy to read *and* maintain. Intermediate knowledge of linkers and preprocessors are highly recommended.

A CTO's guide to Modern C++

It's a very exciting time for C++ programmers: multiple competitive, capable toolchains to choose from, a re-invigorated standard body, and great IDEs that even die-hard emacs/edlin users are flocking toward. On the flipside, there are practical aspects that are extremely frustrating: what vendor can I pay for support of my toolchain/debugger/IDE? how can I fund open source development to move the needle in areas I care about? what static analysis tools are available that actually work? These questions, and other operational aspects of maintaining a C++ engineering organization, are covered in detail so you can immediately start covering your bases without learning the hard way.

Speaker: Matt Hargett Matt Hargett is Chief Technology Officer at PacerPro, and lives in San Francisco with his husband of 14 years. His first programming was on a TI 99/4a with his mother, and his first reverse engineering was on an 8086 to make shareware games easier to finish. Matt co-authored Pragmatic Unit Testing in C#, and has spoken at conferences around the world on network security, reverse engineering, unit testing, and static analysis. His hobbies include world travel, playing video games, and writing/publishing indie pop songs under the moniker "the making of the making of".

CppCon Program Highlights, 8 of N: C++ Tools

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

Tool support is essential to modern software engineering techniques, including notably refactoring and the unit testing heavily popularized by TDD. Here are some of the CppCon talks related to such tooling. As always, the talks are by the people in the trenches, who are heavily using the tools or actively involved in developing them -- in some of the world's largest code bases and code repositories with O(10 billion) lines of preprocessed code.

In this post:

  • Large-Scale Refactoring @ Google
  • C++ Test-driven Development: Unit Testing, Code Assistance and Refactoring
  • Pragmatic Unit Testing in C++
  • A CTO's guide to Modern C++

 

Large-Scale Refactoring @ Google

Many organizations have significant investments in a large existing C++ codebase, and Google is no exception. Our code is intended to survive for decades, but continue to track new language standards as they emerge. To do so, we have developed tools and techniques which provide the ability to automatically refactor code to use new APIs as they become available.

In this talk, I'll discuss some of the reasons for doing migrations that impact hundreds of thousands of files, and how we do them at Google, using tools such as ClangMR. I'll give examples, such as our recent migration to the standardized std::unique_ptr and std::shared_ptr types and lessons we've learned from these experiences. Finally, I'll point out pitfalls others may face in doing similar work, and suggest ways that they can be avoided.

Speaker: Hyrum Wright, Software Engineer, Google. Hyrum Wright is a software engineer at Google, working on C++ library infrastructure. He is a member of the Apache Software Foundation, and a contributor to Apache Subversion. In a previous life, he was a grad student. He enjoys cycling. Twitter handle: @hyrumwright

 

C++ Test-driven Development: Unit Testing, Code Assistance and Refactoring

Unit Testing and TDD, if applied correctly, lead to high quality and simple code. If done by hand, both often require writing some boiler-plate code and can be slow and cumbersome. Especially refactoring without good tool support can be a burden. Java and C# developers are used to have good tool support for these tasks to be effective. Many C++ developers often aren't even aware of the need for the practices, because without tool support and training of the goals, they are hard to discover.

This talk introduces C++ Unit Testing, Test-driven Development, and Refactoring and demonstrates the tooling available for Eclipse CDT for free on www.cevelop.com that was inspired and implemented by the author and his team.

For example, when phrasing a unit test to use a to-be-defined class, the class is generated automatically from its name used as a type. Another tool feature is simplifying a function, by extracting a sub-function and placing a call in its place.

Speaker: Peter Sommerlad, Professor, Director IFS, FHO HSR Rapperswil - IFS Institute for Software. Prof. Peter Sommerlad is head of IFS Institute for Software at FHO HSR Rapperswil. Peter is co-author of the books POSA Vol.1 and Security Patterns. His goal is to make software simpler by Decremental Development: Refactoring software down to 10% its size with better architecture, testability and quality and functionality. Peter is a member of the C++ standardization committee, ACCU, ACM, SI and president of SWEN.Website: http://wiki.hsr.ch/PeterSommerladTwitter handle: @PeterSommerlad

 

Pragmatic Unit Testing in C++

Successful adoption of unit testing goes beyond picking a framework: The effectiveness of unit testing is dependent on run-time analysis, static analysis, and other tools to make up the "iron triangle" necessary to get profitable increases in feature velocity and MTBF in the field. We'll cover where to start in a legacy codebase get the most ROI on unit testing effort, the top 5 legacy design knots and refactoring steps to loosen those knots, and how to write tests that are easy to read *and* maintain. Intermediate knowledge of linkers and preprocessors are highly recommended.

A CTO's guide to Modern C++

It's a very exciting time for C++ programmers: multiple competitive, capable toolchains to choose from, a re-invigorated standard body, and great IDEs that even die-hard emacs/edlin users are flocking toward. On the flipside, there are practical aspects that are extremely frustrating: what vendor can I pay for support of my toolchain/debugger/IDE? how can I fund open source development to move the needle in areas I care about? what static analysis tools are available that actually work? These questions, and other operational aspects of maintaining a C++ engineering organization, are covered in detail so you can immediately start covering your bases without learning the hard way.

Speaker: Matt Hargett Matt Hargett is Chief Technology Officer at PacerPro, and lives in San Francisco with his husband of 14 years. His first programming was on a TI 99/4a with his mother, and his first reverse engineering was on an 8086 to make shareware games easier to finish. Matt co-authored Pragmatic Unit Testing in C#, and has spoken at conferences around the world on network security, reverse engineering, unit testing, and static analysis. His hobbies include world travel, playing video games, and writing/publishing indie pop songs under the moniker "the making of the making of".

CppCon Program Highlights, 7 of N: (More) Boost

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

The Boost.org libraries are central to Modern C++, and so CppCon includes thorough coverage of the "what's new and/or important" in Boost. Several Boost talks have already been mentioned in this blog post series about using Boost in particular domains -- here are additional Boost talks not yet posted here.

Breaking news: We start this post with a talk on Boost.ASIO because if you haven't learned ASIO yet, you'll certainly want to -- as of June 2014 it is (finally) on the fast track for ISO standardization, so a September CppCon talk on ASIO is quite timely.

In this post:

  • Boost.Asio and Boost.Serialization: Designs for Object Transmission
  • Implementing Wire Protocols with Boost Fusion
  • Metaprogramming with Boost.Hana: Unifying Boost.Fusion and Boost.MPL
  • How You Can Make a Boost C++ Library

 

Boost.Asio and Boost.Serialization: Designs for Object Transmission

Network programming in C++ frequently requires programmers to find a way to express C++ objects as a sequence of bytes which can be transmitted and reconstructed on another network endpoint. In the case of simpler objects (such as most PODs), object serialization is trivial to perform.

For more complex C++ constructs (polymorphic objects, etc), the approach to serialization is more challenging. This talk will discuss how two powerful Boost libraries, Asio and Serialization, can be used to craft C++ networking code that can handle a vast array of uses cases. A prototype for a message passing framework will be developed throughout the talk.

Programmers familiar with or interested in network programming (but perhaps unfamiliar with Boost.Asio, Boost.Serialization or both) are the intended audience. No prior knowledge of Boost.Asio and Boost.Serialization will be assumed, and alternatives to both libraries will be discussed.

Speaker: Bryce Adelstein-Lelbach Bryce Adelstein-Lelbach is a researcher at the Center of Computation and Technology (CCT) at Louisiana State University. He works on the HPX runtime system and his research interests include parallel and distributed programming frameworks for scientific applications. He has been working on HPX for over a year now.

 

Implementing Wire Protocols with Boost Fusion

There are a number of common serialization formats available which work well for marshaling C++ types into messaging protocols, e.g. ProtoBufs, Thrift, JSON, XML, FIX, etc. Unfortunately, not every protocol uses one of these popular encodings and instead implements a unique binary protocol. The classical "C" way of handling binary protocols is to use packed structs, unfortunately there are many binary protocols which are not particularly friendly to using this approach due to things like nested variable length data structures, etc.. The packed struct approach is also fairly limited in that it only generally supports primitive POD types.

This talk will explore an approach that uses Boost's Fusion library to implement an easily extensible serialization mechanism for on a non-trivial binary financial exchange protocol which exposes the underlying data in terms of "modern" C++ types. The talk will also cover aspects of general use of Boost Fusion and Boost MPL, type traits, enable_if, SFINAE, and other members of the C++ type system bestiary.

Speaker: Thomas Rodgers, Senior Software Engineer, DRW Trading Group. Thomas has been programming in C++ since 1989 and a member of the C++ Standards Committee since 2013. Thomas has worked in the financial industry since 1996 and currently works for DRW Trading Group in Chicago.

 

Metaprogramming with Boost.Hana: Unifying Boost.Fusion and Boost.MPL

Template metaprogramming sucks. No, seriously; you might like the imposed purely functional paradigm, but not the templates themselves. While C++11 has made our life easier, even simple metaprograms are often hard to write, impossible to maintain and slow to compile; we need better abstractions. In this talk, I will present Boost.Hana (https://github.com/ldionne/hana), an experimental C++14 library for heterogeneous computation. The library takes metaprogramming to a whole new level of expressiveness by unifying the well-known Boost.MPL and Boost.Fusion libraries under a single generic, purely functional interface. The library incorporates some of the most recent advances in C++ metaprogramming; I will give an overview of the most interesting implementation techniques used internally. Finally, I will show concrete ways to use the library so you, as a developer, can write less template black magic, increase your productivity and spend less time in coffee breaks waiting for the compiler (sorry).

Speaker: Louis Dionne Louis is a programming enthusiast and math student living in Quebec City, Canada. He focuses mainly on metaprogramming and functional programming in C++ or other languages. Recently, he has been looking at ways to make C++ metaprogramming more enjoyable by combining C++11/1y techniques with functional programming concepts. In particular, he is working on this very topic as a GSoC student with Boost for the summer of 2014.Website: http://ldionne.com

 

How You Can Make a Boost C++ Library

The purpose of this presentation is to encourage C++ programmers to create and submit new quality C++ libraries to Boost.

Premises: a) C++ needs more quality libraries b) There are many C++ programmers who would like to contribute libraries but they are discouraged by the amount of effort and associated heartache.

Methodology: Walk through the website www.blincubator.com from the point of view of a C++ library contributor. It will address issues related to requirements, suggested tools, user feedback, library promotion. It will assume that the attendee is an intermediate to advanced C++ programmer with his own idea for a library.

Speaker: Robert Ramey Robert Ramey is a freelance Software Developer living in Santa Barbara, California. (See www.rrsd.com.) His long and varied career spans various aspects of software development including business data processing, product, embedded systems, custom software, and C++ library development. Lately, he has been mostly interested in C++ library design and implementation related to Boost. He is the author and maintainer of the Boost Serialization library and a frequent contributor to the Boost developers list. Website: http://www.rrsd.com

 

CppCon Third Keynote -- Boris Kolpackov

CppCon has announced its third keynote, filling out the keynote slots for this year’s event. It’s by respected gaming industry veteran Mike Acton on data-oriented design, which is essential for high performance -- or even reasonable performance -- on modern systems from servers to smartphones.

If you're wondering why data-oriented design is so 'essential,' as a backgrounder check out slides 31-37 of Herb Sutter's April 2014 talk and the cited example of a 50x performance difference achieved by doing nothing but changing the order of objects in memory. That's just an appetizer for Acton's keynote, and it's applicable to way more than gaming.

You won't want to miss this or any of this year's other keynotes and over 100 sessions in the 2014 program. From the announcement:

Data-Oriented Design and C++

by Mike Acton

The transformation of data is the only purpose of any program. Common approaches in C++ which are antithetical to this goal will be presented in the context of a performance-critical domain (console game development). Additionally, limitations inherent in any C++ compiler and how that affects the practical use of the language when transforming that data will be demonstrated.

Speaker’s bio: Mike Acton is Engine Director at Insomniac Games. When he’s not searching for new ways to optimize Insomniac’s engine, he dreams up new ways to help the development community. Mike can often be found extolling the virtues of understanding the data and hardware first along with programming for performance.

CppCon Program Highlights, 6 of N -- The Rubber and the Road

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

C++ developers live where the rubber meets the road, and so CppCon features lots of solid real-world rubber-meets-the-road technical content. Here are specific topics that likely apply to your codebase today, presented by the people who solving these problems today in demanding environments ranging from working on the world's fastest databases to the world's leading financial systems.

In this post:

  • Common-Sense Acceleration of Your MLOC Build
  • C++11 in the Wild: Techniques from a Real Codebase
  • Making Allocators Work

 

Common-Sense Acceleration of Your MLOC Build

In this talk, I lay out detailed examples of steps I took to dramatically improve build times, and ultimately developer productivity, in very large, legacy C/C++ codebases. Is it worth the extra money for SSD or a 15K RPM SAS? How do I make ccache and distcc work together? How do I profile-optimize my toolchain? What network topology issues come into play? These questions, and more, are addressed in detail so you can immediately apply what you've learned to shorten the timeline between when you make a change to your code and when you see it in action.

Speaker: Matt Hargett, CTO, PacerPro. Matt Hargett is Chief Technology Officer at PacerPro, and lives in San Francisco with his husband of 14 years. His first programming was on a TI 99/4a with his mother, and his first reverse engineering was on an 8086 to make shareware games easier to finish. Matt co-authored Pragmatic Unit Testing in C#, and has spoken at conferences around the world on network security, reverse engineering, unit testing, and static analysis. His hobbies include world travel, playing video games, and writing/publishing indie pop songs under the moniker "the making of the making of."

 

C++11 in the Wild: Techniques from a Real Codebase

This talk presents several reusable constructs from a production C++11 codebase, each of which would not be possible without C++11's new features. Auto() is what Alexandrescu's ScopeGuard looks like after a dozen years of C++ evolution. make_iterable() constructs a container from a pair of iterators, enabling simple "foreach" iteration over legacy containers. spaceship() is an efficient "strcmp" for tuples. Time permitting, we'll look at some more arcane code samples.

Speaker: Arthur O'Dwyer, MemSQL. Arthur O'Dwyer worked for many years at Green Hills Software, making the world's most optimizing C and C++ compilers. Now he works at MemSQL, making the world's fastest distributed SQL database.

 

Making Allocators Work

Memory is an important property for every object, as whatever resources it manages, it must occupy some memory. THe ability to customize memory allocation is important for every C++ program that cares about performance, debug ability and support.

The original C++ standard supported an allocator parameter for every container, yet this feature was widely derided or ignored, as it was underspecified to the point it could not portably be used. C++11 makes significant changes to the allocator model, that simply its use while making it more powerful.

The Library Fundamentals TS goes further, allowing allocators' type to be supplied at runtime, rather than compile type, using classic object oriented polymorphism - yet building on the infrastructure laid down in C++11.

This material should be of interest to both library authors and consumers, although clearly there are more details for the implementers to absorb. It also includes an interesting case study in C++11 compile time reflection, as required to implement the new 'allocator_traits' facility.

Speaker: Alisdair Meredith, Bloomberg LP and ISO C++ Library Working Group Chair. Alisdair Meredith is a software developer at BloombergLP in New York, and the C++ Standard Committee Library Working Group chair. He has been an active member of the C++ committee for just over a decade, and by a lucky co-incidence his first meeting was the kick-off meeting for the project that would become C++11, and also fixed the contents of the original library TR. He is currently working on the BDE project, BloombergLP's open source libraries that offer a foundation for C++ development, including a standard library implementation supporting the polymorphic allocator model proposed for standardization.

 

CppCon Program Highlights, 5 of N: Modern C++ and Databases

The CppCon 2014 conference program has been posted for the upcoming September conference. We've received requests that the program continue to be posted in "bite-sized" posts, a few sessions at a time, to make the 100+ sessions easier to absorb, so here is another set of talks. This series of posts will conclude once the entire conference program has been posted in this way.

 

Whether you're using an in-memory flat database or a cloud-scale RDBMS, SQL and ODB databases continue to be a critical layer of modern software. But how do you use them well with modern C++? The following CppCon talks address this question, and as always are presented by the right people -- Those Who Know and Those Who Do, as usual with an international global perspective and including a two-part talk by CppCon's own Boris Kolpackov.

In this post:

  • sqlpp11, An SQL Library Worthy Of Modern C++
  • Persisting C++ Classes in Relational Databases with ODB
  • ODB, Advanced Weapons and Tactics

 

sqlpp11, An SQL Library Worthy Of Modern C++

SQL and C++ are both strongly typed languages. They should play well together. But most C/C++ interfaces to SQL databases are string based. They force the developer to effectively hide the SQL types, names and expression structures from the compiler. This defers the validation of SQL expressions until runtime, i.e. unit tests or even production. And the strings might even be vendor specific, because different databases expect different dialects of SQL in those strings.

That feels wrong. Modern C++ can do better.

This talk gives an introduction to sqlpp11, a templated embedded domain specific language for SQL in C++. It allows you to build type-safe SQL expressions with type-safe results, all of which can be verified at compile time, long before your code enters unit tests or even production.

In addition to its obvious use with relational databases, sqlpp11 can also serve as an SQL frontend for all kinds of data sources: Since sqlpp11 offers complete SQL expression trees even at compile time, it isn't hard to apply SQL expressions to std::vector or std::map for instance, or streams, or XML, or JSON, you name it. With your help, sqlpp11 could become for C++ what LINQ is for C#.

Speaker: Roland Bock, Head of Development, PPRO Financial Ltd., London/Munich.  Roland is Head of Development at PPRO Financial Ltd, an FCA regulated e-Money institute offering prepaid MasterCard card programs and comprehensive financial solutions for international electronic payment transactions. Since 2008 he has been using SQL in C++. Being unhappy with the string-based approach of most SQL libraries, he decided to do something about it and developed a type-safe EDSL for SQL in C++: sqlpp11, see https://github.com/rbock/sqlpp11. In his spare time Roland is preparing sqlpp11 to be proposed for boost and possibly also for the C++ standard. He lives and codes in Munich (Germany). C++ is his preferred language, especially since the arrival of C++11.

 

Persisting C++ Classes in Relational Databases with ODB

ODB is an open source, cross-platform and cross-database (SQLite, PostgreSQL, MySQL, MS SQL Server, Oracle) object-relational mapping (ORM) system for C++. It allows you to persist C++ objects to a relational database without having to deal with tables, columns, or SQL, and without manually writing any mapping code.

In the first part of this two-part talk we will cover the basics of transactionally persisting, loading, updating, and deleting simple C++ classes in a database as well as querying the database for objects. We will then look into persisting C++ classes that have more interesting data members, such as containers and pointers to objects, or that form a polymorphic hierarchy. Support for C++11, Qt, and Boost value types, containers, and smart pointers will also be covered.

Targeting 5 different database systems at the same time may sound like a daunting task but as we will see it is not that hard with ODB. Life would also be a lot easier if our C++ classes never changed. The next best thing is to have comprehensive tooling support. So we will conclude the first half with a discussion of database schema evolution and its support in ODB.

ODB, Advanced Weapons and Tactics

Hiding a relational database behind an ORM does not work. Did I just say that? Yes! Performance and scalability limitations always get in the way. Should we then throw away the whole ORM idea and go back to SQL? We don't have to. In fact, the bulk of ODB features were specifically designed to resolve these limitations without degenerating to JOINs and SQL. And that's what the second part of this talk is all about: bulk operations, object caches, lazy pointers, views, change-tracking containers, optimistic concurrency, object sections (partitions), and prepared and cached queries. By the end of the second half you will be ready for anything that real-world C++ object persistence and database access can throw at you.

Speaker: Boris Kolpackov Boris Kolpackov is a founder and chief software designer at Code Synthesis, a company focusing on the development of open-source tools and libraries for C++. For the past 10 years Boris has been working on solving interesting problems in the context of C++ using domain-specific languages (DSL), C++ parsing, source-to-source translation, and code generation. His notable projects to date include the ODB C++ ORM system as well as XSD and XSD/e XML Schema to C++ compilers.

CppCon Bonus Talk: C++ in MS Office -- Boris Kolpackov

cppcon-051.PNGThe CppCon organizers left a few slots in the CppCon 2014 program for "invited talks" on important but otherwise under-represented topics (such as game development, mobile and embedded systems, etc) or generally interesting and unusual uses of C++. On Tuesday, they announced the first two invited talks on Facebook’s heavy use of C++ in their server infrastructure.

Today, they announced another:

Bonus Talk: C++ in MS Office

by Boris Kolpackov

From the announcement:

Tony Antoun, Igor Zaika: "How Microsoft Uses C++ to Deliver Office (and More) Across iOS, Android, Windows, and Mac"

What does it take to target multiple major mobile devices (as well as traditional environments) with portable, efficient, single-source code? This talk demonstrates architectures, techniques, and lessons learned rooted in actual experience with using C++ to deliver several major cross-platform projects across iOS, Android, Windows, and Mac: Microsoft Office (Word, Excel, PowerPoint, OneNote) and the SQL Server PowerBI. Each presents a different case study: For example, Office already used C++, whereas PowerBI was originally written in Silverlight and then rewritten in C++; Office is a set of user-facing apps, whereas PowerBI is a system component. Although some of these are demanding first-tier “Cadillac” applications, we expect this experience to be a model for the future as more and more apps fall into this category and use C++ to target many popular platforms from (mostly) a single source base.

This talk covers the following key topics and tradeoffs: Rich vs. reach, including access to latest OS features (e.g., iOS 8 additions) and hardware features (e.g., vector units, GPUs). Consistency of functionality. Client code vs. server/service web code. Sharing vs. quality, including dialing appropriately between more shared code and high quality code. Drawing the line between the bulk of C++ code and interfacing with non-C++ for UX and PALs (platform adaptation/abstraction layers) for target-specific user interface and system services. Architecting PALs, including why “mini-PALs” rather than an “über-PAL.” Forcing “doing the right thing” and good architecture with composable components. How C++ enables things not feasible using other technologies. Velocity and enabling faster cross-platform development and deployment. Cost of maintenance, including time, size, and complexity (both breadth and depth). And, last but not least, developing in a single modern C++ source base built with different evolving C++ compilers, including VC++ and Clang/LLVM.

Speakers’ bio: Tony Antoun is Director of Development for APEX, focusing on delivering Office on all Apple platforms and form factors (iPhone, iPad, Mac), as well as aligning the Office experience on other major platforms (Win32, WinRT, Android). Before that, Dev Manager for SQL PowerBI – a cross-platform interactive client data visualization solution (iOS, WinRT, Web) connected to the SQL Reporting cloud service. Before that, Dev Manager for HD-DVD, cross-platform client solution for High Definition interactivity of media experiences (Win32, WinCE, Linux, Xbox).

Igor Zaika is the Development Manager for the Office Core Experience team at Microsoft, responsible for shared UX components and application framework used by Office applications. Before that, Igor worked in various areas related to Office client applications, ranging from building Word Object Model and integrating VBA (Visual Basic for Applications) with Office, to shipping first version of OneNote for the WinRT platform. Before joining Microsoft, Igor worked on 3D CAD application and contributed to the Kronos project.