July 2014

CppCon Program Highlights, 3 of N: C++ and the Modern Game

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.

 

No C++ conference (or 'Con) would be complete without covering a perennial stronghold for tight C++ code: games. What can be said that hasn't been said before? Some interesting answers will be found in the following talks, which cover the gamut from casual homebrew games to the world's top "AAA" titles... and a little bird tells us there may be some additional leading-edge game-related content still to be announced for CppCon. As always, these talks are by the right people -- Those Who Know and Those Who Do in some of the leading efforts in our industry.

In this post:

  • How Ubisoft Montreal Develops Games for Multicore -- Before and After C++11
  • C++ in Huge AAA Games
  • Quick game development with C++11/C++14

 

How Ubisoft Montreal Develops Games for Multicore -- Before and After C++11

Multicore hit the video game industry in a big way. Every platform we develop for now comes in a multicore configuration, and we're always under pressure to exploit the hardware to its fullest. This talk will share our experience learning to develop C++ software for multicore processors over the last decade. It will also explore the new concurrency support in C++11, and examine the way C++11 has influenced the way we develop multicore software so far.

Speaker: Jeff Preshing, Technical Architect, Ubisoft. Jeff Preshing is a Technical Architect at Ubisoft Montreal, where he's worked on games such as Rainbow Six Vegas, Child of Light and Assassin's Creed Unity. He also maintains a blog where he writes frequently about lock-free programming and the C++11 atomic library.

 

C++ in Huge AAA Games

Video games like Assassin's Creed or Rainbow Six are among the biggest code bases with a single static linking. Iteration-time is critical to develop a great game and keeping a complete compilation-time of a few minutes is a constant challenge. This talk will explain the C++ usage reality at Ubisoft Montreal for huge projects. Ideas will be shared regarding performance, debugging and iteration time.

Speaker: Nicolas Fleury, Technical Architect, Ubisoft. Nicolas Fleury has been in video game industry for over 10 years, working as a Technical Architect on projects like Prince of Persia and currently on Rainbow Six: Siege. Before working in the game industry, he worked in computer assisted surgery, speech recognition and telecoms.

 

Finally, to underscore that C++ is not just for "big AAA" titles, CppCon is very pleased to include this fresh talk by a superb young up-and-coming open source gaming guru -- if you haven't heard his name yet, don't worry, you will:

Quick Game Development with C++11/C++14 

Modern C++ has made game development a much more pleasurable experience. Features such as smart pointers and variadic templates are invaluable in speeding up the development process and in making the code cleaner and more robust. New easy-to-use multimedia libraries such as SFML, SDL and Cinder make dealing with graphics, sounds and input very easy, and work well with modern code principles. This talk guides the audience through the creation of an Arkanoid/Breakout clone in under 200 lines of code, using C++11/C++14 features and idioms. Chronologically sequential code segments, compiled and executed one by one, will show the attendees how a game is created from scratch, slowly becoming a playable product, step by step. The end result will be a small game, completely written in modern C++ code. Topics covered will range from basic graphics programming to entity management and collision detection/response.

Speaker: Vittorio Romeo. Vittorio is an Italian 19 year old Computer Science student at the University of Messina. He started programming at a very young age and soon became an enthusiast of the C++ language. While following the evolution of the C++ standard and embracing the newest features, he worked on many open-source project, such as general-purpose libraries and free multiplatform independent games, which are still being maintained and expanded today. Vittorio also participated as a speaker at Messina's 2013 Linux Day event and he is currently creating an online game-development C++11 video tutorial series for beginners.

Erasing the Concrete -- K-ballo

Have you heard of "type erasure"?

Erasing the Concrete

by K-ballo

From the article:

Type erasure is any technique in which a single type can be used to represent a wide variety of types that share a common interface. In the C++ lands, the term type-erasure is strongly associated with the particular technique that uses templates in the interface and dynamic polymorphism in the implementation.

A union is the simplest form of type erasure.

  • It is bounded, and all participating types have to be mentioned at the point of declaration.

A void pointer is a low-level form of type erasure. Functionality is provided by pointers to functions that operate on void* after casting it back to the appropriate type.

  • It is unbounded, but type unsafe.

Virtual functions offer a type safe form of type erasure. The underlying void and function pointers are generated by the compiler.

  • It is unbounded, but intrusive.
  • Has reference semantics.

A template based form of type erasure provides a natural C++ interface. The implementation is built on top of dynamic polymorphism.

  • It is unbounded and unintrusive.
  • Has value semantics.

CppCon Program Highlights, 2 of N: C++ and the Modern Web

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.

Note: Early Bird registration ends in about 24 hours from the time of this post.

 

Some people seem to think that "web" and "C++" don't belong in the same sentence, but part of what you need to know about modern C++ is how essential it is for web services, how to use web services from C++ code, and the new tools available to compile C++ code to run in the browser -- any browser. In these talks, the CppCon program covers development in this exciting modern area, and we think you'll see that the speakers include the creators of the key technologies -- Those Who Know and Those Who Do in some of the leading efforts in our industry.

In this post:

  • Emscripten and asm.js: C++'s Role in the Modern Web 
  • Embind and Emscripten: Blending C++11, JavaScript, and the Web Browser
  • Using C++ to Connect to Web Services

 

Emscripten and asm.js: C++'s Role in the Modern Web

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.

Speaker: Alon Zakai, Mozilla. Alan works on Emscripten, an LLVM-based compiler from C++ to JavaScript, as well as other projects related to porting existing content to the web. Twitter handle: @kripken

 

Embind and Emscripten: Blending C++11, JavaScript, and the Web Browser

Emscripten compiles C or C++ source code into JavaScript so it can run in a web browser. Emscripten is commonly used to port games to the web with no download or plugin required.

Embind is a C++11 binding library that makes it easy to expose libraries written in C++ to JavaScript. This allows JavaScript applications to take advantage of existing bodies of C++ code. In addition, C++ compiled into the asm.js subset of JavaScript is often faster than hand-written JavaScript, so Embind makes it convenient to accelerate JavaScript applications by writing high-performance functionality in C++.

With several motivating examples, this lecture will cover the design of embind, how variadic templates and constexpr facilitate interesting optimizations, and how embind minimizes its impact on the size of the generated JavaScript.

Speaker: Chad Austin, Technical Director, IMVU. Chad is a Senior Technical Director at IMVU, where he works on highly scalable backend systems, front-end web architectures, and optimizing the bits and bytes of 3D graphics pipelines. C++ was Chad's first love, and he once mowed "C++" into his back yard before a rainstorm, where it stayed for weeks. Website: http://chadaustin.me Twitter: @chadaustin

 

Using C++ to Connect to Web Services

Many languages have great support for connecting to web services. Trying to connect C++ applications to the cloud is difficult. The C++ standard library doesn't contain anything for networking (yet), and with the proliferation of devices, being able to do so in a cross platform manner is even more appealing. Often requiring use of multiple different styled, and potentially low level, libraries where asynchrony wasn't designed from the start. Or by building your own abstract layers over platform and operating system APIs, all of which distract from focusing on the core logic of your application.

The C++ REST SDK makes connecting to services easier by creating APIs focused on simplicity and asynchrony, built using tasks from the Parallel Patterns Library. This is done by putting together a series of cross platform libraries for working with HTTP, WebSockets, JSON, URIs, and OAuth. In many cases building on top of other popular open source libraries like Boost, OpenSSL, and WebSocket++. This talk will take a practical approach looking at what is involved in connecting to some of the common popular services from C++, using the C++ REST SDK and other libraries. Several tutorial style example and demos will be done using C++ code that runs on all the major platforms.

Speaker: Steve Gates, Microsoft. Steve Gates is a senior engineer on the Visual C++ team at Microsoft. Joining Microsoft in 2007, he's worked on various runtimes and libraries for parallel and asynchronous programming, including the Parallel Patterns Library. For the past couple of years he's been focusing on improving the experience in C++ for connecting to services. Specifically working on the C++ Rest SDK (Casablanca) open source project. Outside of work Steve's interests include growing vegetables, food preservation, and eating great food.

Two years of Meeting C++! -- Jens Weller

A lot has changed in just two years. Check this out for some visibility into the European C++ scene.

Two years of Meeting C++!

by Jens Weller

Note: Jens will be giving two talks at two talks at CppCon, including "Founding User Groups." He knows what he's talking about... from the article:

While I only know of 3 active User Groups around 2011/early 2012 (Oslo, Belgium & Düsseldorf), the active user Groups in Europe are a huge success, showing the popularity of C++: ... Also note, that I haven't listed active ACCU Groups, there exist a few in Great Britain, but I'm not sure when they started and how active they are. In total there currently 17 User Groups being active in 2014 or 2013.

C++11 Final Override -- 741MHz

A good article posted last year and making the rounds again this week:

C++11 Final Override

by 741MHz

From the article:

C++11 introduces two important keywords in relation to polymorphism and inheritance — the override and final. Using those keywords should become a habit of any C++ developer. It is worth using every time except when writing a base class. This will make the code clear, maintainable, and potentially save hours that would have been otherwise wasted chasing an error in debugger.

Introducing the CppCon House Band: Jim Basnight

cppcon-basnight.pngAs already announced, CppCon is recording all sessions and panels, including on-mic Q&A. However, note that only the sessions will be recorded, not all of CppCon -- things that you can experience only by attending including lightning talks, BoFs, hackathons, extended Q&A with the 70+ speakers (when you follow them around after their mics turn off or enjoy extended ad-hoc hallway chats), live house band performances, other extra technical and social events in breaks and evening, and...

... wait. Did we say "live house band performances"?

We did indeed.

As part of presenting CppCon, the Foundation is proud to sponsor live music by a great local Seattle area act, The Jim Basnight Band. Jim and the boys  will be playing CppCon all five days and serving up all kinds of original music and covers, from rock and pop to funk and soul and a few surprises. Be sure to get to each day's plenary session early to rock out, and enjoy their Pacific Northwest musical vibe at other times throughout the week. The band has a deep song catalog, so get your requests ready.

We hope you'll join us in September to enjoy not only the deep technical breadth and depth of 2014's premier C++ conference program, but also the round-the-clock "unconference" and musical parts of the fun and refreshing spirit of CppCon.

Hundreds of attendees have already registered for C++'s "Woodstock 2014." Early Bird registration ends tomorrow.

 

(If you're reading this via a newsreader and don't get the embedded audio, visit this post on isocpp.org and enjoy.)

 

N4109: A proposal to add a utility class to represent expected monad -- R1 -- V Escriba, P Talbot

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4109

Date: 2014-06-29

A proposal to add a utility class to represent expected monad -- Revision 1

by Vicente J. Botet Escriba and Pierre Talbot

Excerpt:

1 History

R1- Revision of N4015 [9] after Rapperswil feedback:

  • Switch the expected class template parameter order from expected<E,T> to expected<T,E>.
  • Make the unexpected value a salient attribute of the expected class concerning the relational operators.
  • Removed open point about making expected<T,E> and expected<T> different classes.

2 Introduction

Class template expected<T,E> proposed here is a type that may contain a value of type T or a value of type E in its storage space. T represents the expected value, E represents the reason explaining why it doesn’t contains a value of type T, that is the unexpected value. Its interface allows to query if the underlying value is either the expected value (of type T) or an unexpected value (of type E). The original idea comes from Andrei Alexandrescu C++ and Beyond 2012: Systematic Error Handling in C++ talk [2]. The interface and the rational are based on std::optional N3793 [5] and Haskell monads. We can consider that expected<T,E> is a generalization of optional<T> providing in addition a monad interface and some specific functions associated to the unexpected type E. It requires no changes to core language, and breaks no existing code.

CppCon 2014 Video Recording -- Boris Kolpackov

A very welcome announcement, hot off the press at cppcon.org:

CppCon 2014 Video Recording

by Boris Kolpackov

Every time we post an update on CppCon 2014 someone asks if there will be a recording of the conference. From the beginning we ruled out going the C++Now way by having student volunteers record sessions using consumer camcoders. It is a huge headache for those organizing it just for C++Now’s 3 tracks. It simply won’t scale to CppCon’s 6. So the decision was made to either record professionally or not to record at all. And professional recording of a week-long conference with 6 tracks is not cheap. This is why we couldn’t give a concrete answer until we knew for sure. And now we know for sure: we found a sponsor (can’t yet announce who it is), the contract has been signed, and the entire 6 tracks will be professionally recorded!

Now if you think there is no longer a good reason to attend CppCon in person, let me give you several. There will be recording but no live streaming (live streaming is on a whole new level, expense-wise). Because of the number of sessions involved, we will only be able to publish them about a month later. There will also be no recording of the “unconference” material: lightning talks, hackathons, BoF sessions, extended Q&A, etc.

But the main difference between being there and watching things a month later is missing out on what happens after the talks. Organizers of C++Now like to joke that half of the conference happens between the presentations, in personal interactions.

From personal experience, I spent 1.5 hours after my C++Now presentation chatting to a bunch of attendees who were particularly interested in the topic of my talk. I am not kidding: it was the same length as my presentation! You can’t participate in stuff like this if you are not there.

The bottom line: yes, you will eventually be able to view all the sessions but you will miss out on a lot of fun, personal interactions, and insight that comes with that.

Video recording is also great news for those planning to come. Remember, you can only attend one talk out of every six. But now you will be able to catch up with the video recordings.

If you have never attended a C++ conference and you are not sure whether CppCon is worth it, I hope I managed to convey some of the atmosphere that you can expect. If C++Now is anything to go by, this will be a week where you will learn more about C++ than in the rest of the year all while having a lot of fun.

And remember, the Early Bird registration deadline is tomorrow.

CppCon Program Highlights, 1 of N

The CppCon 2014 conference program has been posted for the upcoming September conference. We previously posted part of the CppCon program in six program preview blog posts, each containing a few session titles and abstracts. Several people have expressed that they prefer being able to absorb the program in this way as "bite-sized" blog posts, so we're going to continue posting a few additional sessions at a time this way, sometimes with commentary, until the entire conference program has been posted also via this blog series.

Note: Early Bird registration ends tomorrow.

 

Multi-device development across iOS, Android, Mac, Windows, and other platforms is increasingly in demand, and C++ is the only modern language supported on all of those platforms. We find many developers are still unaware of how C++ is being quietly adopted across major companies as the language of choice for sharing code to develop their cross-platform apps -- even in apps originally written in other platform-specific languages. In these talks, the CppCon program covers development in this exciting modern area, and we think you'll see that the speakers are Those Who Know and Those Who Do in some of the leading efforts in our industry.

In this post:

  • Practical Cross-Platform Mobile C++ Development at Dropbox
  • From the Dropbox Trenches: A Deep Dive into Two Cross-Platform Mobile Apps Written in C++
  • UI Prototyping and Development for Multiple Devices in C++
  • Multiplatform C++

Practical Cross-Platform Mobile C++ Development at Dropbox

The conventional wisdom of multi-platform mobile development comes down to two choices: write all your complex logic at least twice or settle for a slow, non-native experience for your users. Come learn how Dropbox has embraced a third option, where fast, cross-platform code in C++ is married to a smooth, native UI for the best of both worlds.

In Dropbox’s new generation of iOS and Android apps, we leverage the strengths of the platform frameworks while only writing and maintaining one version of complex logic like data syncing. We’ll explain the benefits and pitfalls of interfacing C++ to platform-specific code via Objective-C++ and JNI and how code generation has freed us from much of the effort involved. We’ll share the benefits we’ve gained from C++11/14, as well as the drawbacks, and how we’ve overcome each platform’s quirks. Finally, we’ll share tools that let you try this out yourselves.

Speakers:

  • Alex Allain, Platforms and Libraries Lead, Dropbox. Alex has been writing about C++ since 1998, when he started Cprogramming.com. In 2012, he published Jumping into C++ to teach new programmers how to think like a professional C++ programmer. At Dropbox, Alex leads the Platforms and Libraries team, helping make the dream of cross-platform C++11 a reality. Prior to Dropbox, Alex led a team at Liquid Machines focused on injecting code into applications to perform binary hooking.
  • Andrew Twyman, Software Engineer, Dropbox. Andrew Twyman has been developing products and libraries in C++ for almost 10 years. He loves building robust systems and solving tricky low-level problems. Starting in 2012, Andrew helped spearhead Dropbox’s new approach to cross-platform mobile development. Now on the Platforms and Libraries team, Andrew is helping bring cross-platform goodness to Dropbox’s new generation of mobile and desktop apps. Prior to Dropbox, Andrew was an architect at Liquid Machines, where shared libraries supported parallel development of more products than there were developers.

 

From the Dropbox Trenches: A Deep Dive into Two Cross-Platform Mobile Apps Written in C++

At Dropbox we’ve spent the last year and a half building two cross platform mobile apps: the email client, Mailbox, and the photo gallery, Carousel. We started with the goal of a native look and feel with seamless performance but also needed to leverage a small team to build these apps on multiple platforms. We ultimately accomplished this by using C++ to share significant amounts of code in each app.

We’ll cover what portions of our apps we built in C++ and why we left some portions in the platform languages of Java and Objective-C, deep diving into some of the most important components. We’ll also discuss some unexpected benefits, areas we faced technical and human challenges, and some tips and tricks that you can use to leverage C++ to build very high performance apps.

Speakers:

  • Tony Grue, Engineering Manager, Dropbox. Tony has been building mobile applications, mostly in C++, for the last 8 years.  He worked on Dropbox for Android as it grew from a few million to more than 100 million installs. Now he leads the Carousel for Android and lib-carousel teams at Dropbox. Before Dropbox, Tony was at Microsoft where he contributed to the email, SMS, and visual search clients on Windows Phone.
  • Steven Kabbes, Mobile Engineer, Dropbox. Steven was a member of the founding team of Mailbox and designed many of the core email sync algorithms that power it. Since then he has been working on cross platform mobile building the C++ layer of Mailbox which powers clients on iOS, Android and Mac. Steven is especially passionate about developer libraries, specifically ones that enable fast iteration on the next generation of products. https://avatars3.githubusercontent.com/u/592178

 

UI Prototyping and Development for Multiple Devices in C++

Using C++ for multi-device user interface and app development should be pretty straightforward. However, since the Standard C++ Language and Library specification does not specify a user interface library, it’s actually quite challenging given that the two leading mobile platforms provide non-C++ User Interface APIs. Even more challenging is the new world of mobile devices and the myriad form factors, layouts, resolutions, sensors, and services that an application developer has to deal with. Plus, the deployment model for remote devices makes testing UI changes slower due to the increased build and turnaround time. This session will describe how C++ can be used effectively for multi-device UI development and also deliver a rapid prototyping experience to minimize the deployment time to the device for testing.

Speaker: John "JT" Thomas, Director of Product Management at Embarcadero Technologies. JT has more than 15 years of product management and product development experience including hands-on experience with the early versions of Delphi and C++Builder at Borland Software. Previously, JT held product management positions at mobile Linux vendor MontaVista Software and at Research in Motion. He earned his Computer Science degree from University of California, Santa Cruz and his MBA and MSE from San Jose State University.Website: http://www.embarcadero.comTwitter handle: @FireMonkeyPM

 

Multiplatform C++

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?

Speaker: Edouard Alligand, Chairman & CTO, Bureau 14. Edouard has more than thirteen years of professional experience in software engineering. After years hacking the kernel of various operating systems, Edouard founded Bureau 14, the home of the hyperscalable database quasardb. Combining an excellent knowledge of low level programming with a perverse love for template meta-programming, Edouard likes to come up with uncompromising solutions to seemingly impossible problems. He lives in Paris, France. Website: https://blogea.bureau14.fr/ http://twitter.com/edouarda14

 

N4110: Exploring the design space of contract specifications for C++ -- J. Daniel Garcia

A new WG21 paper is available. If you are not a committee member, please use the comments section below or the std-proposals forum for public discussion.

Document number: N4110

Date: 2014-07-06

Exploring the design space of contract specifications for C++

by J. Daniel Garcia

Excerpt:

This paper explores the design space for introducing contracts as part of the interface of functions and types. The goal is to address the problem of specifying an interface (with special attention to standard library interfaces) making a clear distinction between a contract violation and an explicitly thrown exception. Preconditions and postconditions are attached to function declarations (i.e. to interfaces) rather than to de nitions, and are, in principle, checked before and after a function's de nition is entered. No macros are needed.