June 2016

Overload 133 is now available

ACCU’s Overload journal of April 2016 is out. It contains the following C++ related articles.

Overload 132

From the journal:

Dogen: The Package Management Saga
How do you manage packages in C++? Marco Craveiro eventually discovered Conan after some frustrating experiences. by Marco Craveiro

QM Bites – Order Your Includes (Twice Over)
Header includes can be a shambles. Matthew Wilson encourages us to bring some order to the chaos. by Matthew Wilson

A Lifetime In Python
Resource management is important in any language. Steve Love demonstrates how to use context managers in Python. by Steve Love

Deterministic Components for Distributed Systems
Non-deterministic data leads to unstable tests. Sergey Ignatchenko considers when this happens and how to avoid it. by Sergey Ignatchenko

Programming Your Own Language in C++
Scripting languages allow dynamic features easily. Vassili Kaplan writes his own in C++ allowing keywords in any human language. by Vassili Kaplan

Concepts Lite in Practice
Concepts should make templates easier to use and write. Roger Orr gives a practical example to show this. by Roger Orr

Afterwood
Magazines sometimes use the back page for adverts or summaries. Chris Oldwood has decided to provide us with his afterwords, or ‘afterwood’. by Chris Oldwood

CppCon 2015 Haskell Design Patterns for Genericity & Asynchronous Behavior--Sherri Shulman

Have you registered for CppCon 2016 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 2015 for you to enjoy. Here is today’s feature:

Haskell Design Patterns for Genericity & Asynchronous Behavior

by Sherri Shulman

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

The paper explores some of Haskell's support for genericity through type classes, Functors, Monads, and Continuations and their impact on lanugages such as C++, Scala, and Rust. We explore these language features and consider alternatives that have been proposed to existing language features, including Object Algebras, GADTs, Open data types, open pattern matching, and extensions to Haskell's type system that impact the type inference algorithm and decidability. We use a number of case studies to demonstrate what proposed solutions look like in the target languages, considering how easy they are to use and how well the solutions integrate with existing linguistic features.

Building And Packaging C++ Modules In Vs2015--Conan's blog

Modules in Conan explained:

Building And Packaging C++ Modules In Vs2015

by Conan's blog

From the article:

This post makes a brief introduction to the C++ modules (we wished C++17, but we will have to wait). Modules have already been experimentally available in an early implementation in CLang, and now Microsoft is also providing them in Visual Studio 2015. We will see their syntax and how to build them, as introduced in the Visual Studio Blog, and at the same time, we will show how to create and consumes packages with C++ modules with conan C/C++ package manager.

Implementing Queues for Event-Driven Programs--“No Bugs” Hare

An interesting article:

Implementing Queues for Event-Driven Programs

by “No Bugs” Hare

From the article:

We’ve already discussed things related to sockets; now let’s discuss the stuff which is often needed (in particular, it is of Utmost Importance when implementing Reactors), but which is not that common to be universally available as a part of operating system.

I’m speaking about queues. And not only just about “some” queue, but about queues which have certain properties desirable for our Reactors a.k.a. ad-hoc Finite State Machines a.k.a. Event-Driven Programs.

GoingNative 50: New Visual C++ Code Optimizer--Eric Battalio, Steve Carroll and Augustin Popa

The new GoingNative is out!

GoingNative 50: New Visual C++ Code Optimizer

by Eric Battalio, Steve Carroll and Augustin Popa

From the video:

Happy 50th episode! This episode covers our new, more advanced code optimizer for the Visual C++ compiler back-end. It provides many improvements for both code size and performance, bringing the optimizer to a new standard of quality expected from a modern native compiler.

This is the first public release and we are encouraging people to try it and provide suggestions and feedback about potential bugs. The official release of the new optimizer is expected to be Visual Studio Update 3, while the release available today is unsupported and mostly for testing purposes.

Read our blog post to get the details!

CppCon 2015 constexpr: Introduction--Scott Schurr

Have you registered for CppCon 2016 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 2015 for you to enjoy. Here is today’s feature:

constexpr: Introduction

by Scott Schurr

(watch on YouTube) (watch on Channel 9)

Summary of the talk:

I'm excited about constexpr. It's probably my favorite C++11 feature and it's gotten even better with C++14. This talk will introduce constexpr to the uninitiated. We'll start with C++11 and continue into the improvements introduced with C++14. We'll look into useful ways to think about constexpr code. We'll also cover some tips and tricks with writing constexpr code.

CppCon 2015 Live Lock-Free or Deadlock (Practical Lock-free Programming)--Fedor Pikus

Have you registered for CppCon 2016 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 2015 for you to enjoy. Here is today’s feature:

Live Lock-Free or Deadlock (Practical Lock-free Programming)

by Fedor Pikus

Part 1: (watch on YouTube) (watch on Channel 9)

Part 2: (watch on YouTube) (watch on Channel 9)

Summary of the talk:

Part I:

Introduction to lock-free programming. We will cover the fundamentals of lock-free vs lock-based programming, explore the reasons to write lock-free programs as well as the reasons not to. We will learn, or be reminded, of the basic tools of lock-free programming and consider few simple examples. To make sure you stay on for part II, we will try something beyond the simple examples, for example, a lock-free list, just to see how insanely complex the problems can get.

Part II:

having been burned on the complexities of generic lock-free algorithms in part I, we take a more practical approach: assuming we are not all writing STL, what limitations can we really live with? Turns out that there are some inherent limitations imposed by the nature of the concurrent problem: is here really such a thing as “concurrent queue” (yes, sort of) and we can take advantages of these limitations (what an idea, concurrency actually makes something easier!) Then there are practical limitations that most application programmers can accept: is there really such a thing as a “lock-free queue” (may be, and you don’t need it). We will explore practical examples of (mostly) lock-free data structures, with actual implementations and performance measurements. Even if the specific limitations and simplifying assumptions used in this talk do not apply to your problem, the main idea to take away is how to find such assumptions and take advantage of them, because, chances are, you can use lock-free techniques and write code that works for you and is much simpler than what you learned before.