advanced

CppCon 2014 Emscripten and asm.js: C++'s role in the modern web--Alon Zakai

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:

Emscripten and asm.js: C++'s role in the modern web

by Alon Zakai

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

All major web browsers are written in C++, but C++ is starting to fill an important role in web *content* as well: while JavaScript is the only standards-compliant language available to websites, compiling other languages to JavaScript has been shown to be practical and effective. This talk will explain how Emscripten, an LLVM-based open source compiler from C++ to JavaScript, lets you run a C++ codebase on the web at near-native speed. To achieve that level of performance, Emscripten emits asm.js, a strict subset of JavaScript that is easy for JavaScript engines to optimize, and was designed specifically as a compilation target for languages like C and C++. We'll also discuss some of the more challenging aspects of compiling C++ to JavaScript, stemming from the C++ language itself, libraries and toolchains, and some thoughts on possible solutions.

CppCon 2014 The Implementation of Value Types--Lawrence Crowl

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:

The Implementation of Value Types

by Lawrence Crowl

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

Predefined value types are central to C++ efficiency and robustness. More importantly, C++ provides mechanisms that enable programmers to create high-quality value types, programmers are not limited to the small predefined value types. However, implementing a high-quality type requires attention to several problems, among them portability, representation, efficient copying, efficient parameters, aliasing, constant initialization, and constant expressions. We present the issues and several approaches to implementing high-quality value types.

CppCon 2014 Multiplatform C++--Edouard Alligand

Have you registered for CppCon 2015 in September? Don’t delay – Early Bird registration is open now.

While we wait for this year’s event, we’re featuring videos of some of the 100+ talks from CppCon 2014 for you to enjoy. Here is today’s feature:

Multiplatform C++

by Edouard Alligand

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

C++ is a multiplatform language, yet many difficulties arise when you want the same code to compile properly and function identically on different platforms. If you put aside the obvious system programming related obstacles, and the differences you might have between compilers (especially when it comes to supporting C++11 and C++14), you come to the surprising conclusion that what is truly hard is all the "little things" you didn't anticipate.

This talk will be about our experience with our own software, quasardb, that runs every day on three OS (FreeBSD, Linux and Windows), is built with three compilers (clang, gcc and msvc) and supports two architectures (IA32 and AMD64).

How to build natively the same software on Windows and Linux, provided that they have radically different tool chains? How to work around the subtle, but existing differences between Linux and FreeBSD? How do you solve cross-tools, cross-platform file editing problems? How to prevent your maintenance costs from increasing dramatically?

Safety: off - How not to shoot yourself in the foot with C++ atomics -- Anthony Williams

Guidelines for how to use C++ atomics safely in our code using worked examples.

Slides and code and for my ACCU 2015 presentation

by Anthony Williams

From the article:

It's now two months since the ACCU 2015 conference in Bristol, UK, so I thought it was about time I posted my slides.

This year my presentation was titled "Safety: off - How not to shoot yourself in the foot with C++ atomics". I gave a brief introduction to the C++ atomics facilities, some worked examples of usage, and guidelines for how to use atomics safely in your code.

The slides are available here, and the code examples here.

Standardizing Variant: Difficult Decisions -- Anthony Williams

Techincal discussion information while standardizing N4542.

Standardizing Variant: Difficult Decisions

by Anthony Williams

From the article:

One of the papers proposed for the next version of the C++ Standard is N4542: Variant: a type safe union (v4). As you might guess from the (v4) in the title, this paper has been discussed several times by the committee, and revised in the light of discussions.

Boost has had a variant type for a long time, so it only seems natural to standardize it. However, there are a couple of design decisions made for boost::variant which members of the committee were uncomfortable with, so the current paper has a couple of differences from boost::variant. The most notable of these is that boost::variant has a "never empty" guarantee, whereas N4542 proposes a variant that can be empty.

Simple C++11 metaprogramming--Peter Dimov

If you like to play with templates, read this article:

Simple C++11 metaprogramming

by Peter Dimov

From the article:

The wide acceptance of Boost.MPL made C++ metaprogramming seem a solved problem. Perhaps MPL wasn't ideal, but it was good enough to the point that there wasn't really a need to seek or produce alternatives.

C++11 changed the playing field. The addition of variadic templates with their associated parameter packs added a compile-time list of types structure directly into the language...

Holier Than Thou--Tony “Bulldozer00” (BD00) DaSilva

A rare but possible problem that can occur with long running programs:

Holier Than Thou

by Tony DaSilva

From the article:

Since C++ (by deliberate design) does not include a native garbage collector or memory compactor, programs that perform dynamic memory allocation and de-allocation (via explicit or implicit use of the “new” and “delete” operators) cause small “holes” to accumulate in the free store over time. I guess you can say that C++ is “holier than thou“. :( ...

How to implement a stateful meta-container in C++ -- Filip Roséen

Implementing stateful meta contianer in C++ Using Modern C++.

How to implement a stateful meta-container in C++

by Filip Roséen

From the article:

This post has explained the technical aspects related to an implementation of a stateful meta-container, allowing a developer to more easily work with, and modify, a given set of entities during the phase of translation.

Together with the previous posts in this series, the formerly unstateful world of translation has gone into a stateful universe — allowing for some crazy, but conforming, implementations.

CppCon 2014 Sanitize your C++ code--Kostya Serebryany

While we wait for CppCon 2015 in September, we’re featuring videos of some of the 100+ talks from CppCon 2014. Here is today’s feature:

Sanitize your C++ code

by Kostya Serebryany

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

"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.