SlideShare a Scribd company logo
Mateusz Pusz
September 21, 2019
Free lunch is over
WHY C++ IS SO IMPORTANT IN THE MODERN WORLD?
This presentation has been prepared by EPAM Systems, Inc. solely for use by EPAM at its EPAM So ware
Engineering Conference. This presentation or the information contained herein may not be reproduced
or used for any other purpose. This presentation includes highly confidential and proprietary
information and is delivered on the express condition that such information will not be disclosed to
anyone except persons in the recipient organization who have a need to know solely for the purpose
described above. No copies of this presentation will be made, and no other distribution will be made,
without the consent of EPAM. Any distribution of this presentation to any other person, in whole or in
part, or the reproduction of this presentation, or the divulgence of any of its contents is unauthorized.
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Con dential Information
2
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
WHY C++?
3
• No matter how fast processors get, so ware
consistently finds new ways to eat up the
extra speed
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Herb Sutter 2005: Free Lunch is Over
4
• No matter how fast processors get, so ware
consistently finds new ways to eat up the
extra speed
• Applications have enjoyed free and regular
performance gains for several decades
– even without releasing new versions
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Herb Sutter 2005: Free Lunch is Over
4
• No matter how fast processors get, so ware
consistently finds new ways to eat up the
extra speed
• Applications have enjoyed free and regular
performance gains for several decades
– even without releasing new versions
• Around 2003 we run out of room with
approaches to boost CPU clocks
– heat (too much and hard to dissipate)
– power consumption (too high)
– leakage problems
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Herb Sutter 2005: Free Lunch is Over
4
LANGUAGE EFFICIENCY FLEXIBILITY ABSTRACTION PRODUCTIVITY
C YES! YES! non-goal non-goal
C++ YES! YES! YES! WIP
JAVA, C# at the expense of at the expense of YES! YES!
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Where the Focus Is?
5
LANGUAGE EFFICIENCY FLEXIBILITY ABSTRACTION PRODUCTIVITY
C YES! YES! non-goal non-goal
C++ YES! YES! YES! WIP
JAVA, C# at the expense of at the expense of YES! YES!
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Where the Focus Is?
C++ motto:
You don't pay for what you don't use
5
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Why C++?
6
• Hardware costs
• Limited resources on mobiles
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Why C++?
PERFORMANCE PER TRANSISTOR
6
• Hardware costs
• Limited resources on mobiles
• Get the most from every CPU core
• Bigger experiences on a smaller hardware
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Why C++?
PERFORMANCE PER TRANSISTOR
PERFORMANCE PER CLOCK
6
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Why C++?
PERFORMANCE PER WAT
7
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Why C++?
PERFORMANCE PER WAT
7
https://perspectives.mvdirona.com/2010/09/overall-data-center-costs
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Data center costs
8
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
How C++ Combats Global Warming
9
I guess in some way of saying here's my contribution to dealing
with global warming because if you can double the e iciency of
those systems you don't need yet another server farm that use as
much energy as a small town.
-- Bjarne Stroustrup
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
How C++ Combats Global Warming
10
People costs shi from top to nearly irrelevant.
James Hamilton
VP & Distinguished Engineer, Amazon Web Services
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Focus shift
11
E iciency is not just running fast or running bigger programs, it’s
also running using less resources.
-- Bjarne Stroustrup
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
E ciency
12
E iciency is not just running fast or running bigger programs, it’s
also running using less resources.
-- Bjarne Stroustrup
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
E ciency
Performance-oriented corporations are willing to pay more for so ware
development if due to its better e iciency it will save lots of money during
product lifetimes
12
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Renaissance
13
http://google-engtools.blogspot.com/2011/05/c-at-google-here-be-dragons.html
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Renaissance: Google
14
http://10rem.net/blog/2011/02/22/creating-an-internet-explorer-add-in-toolbar-button-using-
cplusplus-and-atl
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Renaissance: Microsoft
15
Facebook consumes very little Wats per user. Actually fractions of Wat. ...
Everything that is backend, high-performance is C++ because it must be responsive and well done. ...
Facebook is literally running on C++. We also have JIT for PHP that is obviously written in C++
and generates machine code during runtime. ...
Using the native language such as C++ means more features for the same power and less power for the
given set of features. It is a very simple equation.
-- Andrei Alexandrescu, Research Scientist at Facebook, Lang.Next 2012
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Renaissance: Facebook (2012)
16
https://www.phoronix.com/scan.php?page=news_item&px=Facebook-JIT-Cpp-Scripting
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Renaissance: Facebook (Today)
17
https://www.bloomberg.com/professional/blog/bloomberg-advancing-c-scale
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Renaissance: Bloomberg
18
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
WHAT IS C++?
19
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
What is C++?
20
• C++ is no longer C with classes
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
What is C++?
20
• C++ is no longer C with classes
• C++ is a general-purpose programming language
– imperative, object-based, object-oriented, generic, and functional programming features
– developer is not tied to any specific programming paradigm by the language
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
What is C++?
20
• C++ is no longer C with classes
• C++ is a general-purpose programming language
– imperative, object-based, object-oriented, generic, and functional programming features
– developer is not tied to any specific programming paradigm by the language
• High-level abstractions at low cost
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
What is C++?
20
• C++ is no longer C with classes
• C++ is a general-purpose programming language
– imperative, object-based, object-oriented, generic, and functional programming features
– developer is not tied to any specific programming paradigm by the language
• High-level abstractions at low cost
• Low-level access when needed
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
What is C++?
20
• C++ is no longer C with classes
• C++ is a general-purpose programming language
– imperative, object-based, object-oriented, generic, and functional programming features
– developer is not tied to any specific programming paradigm by the language
• High-level abstractions at low cost
• Low-level access when needed
• If used correctly, provides hard to beat performance
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
What is C++?
20
• C++ is no longer C with classes
• C++ is a general-purpose programming language
– imperative, object-based, object-oriented, generic, and functional programming features
– developer is not tied to any specific programming paradigm by the language
• High-level abstractions at low cost
• Low-level access when needed
• If used correctly, provides hard to beat performance
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
What is C++?
C++ language evolves now faster than ever
20
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Timeline
21
• ISO/IEC JTC1/SC22/WG21 (Joint Technical Committee 1/Subcommittee 22/Working Group 21)
• Formed in 1990-91
• Consists of accredited experts from member nations of ISO/IEC JTC1/SC22 who are interested in the
C++ work
• Includes 13 member countries: Bulgaria, Canada, Czech Republic, Finland, France, Germany,
Netherlands, Poland, Russia, Spain, Switzerland, United Kingdom, and the United States
– Bulgaria, Czech Republic, and Poland joined during last year
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
ISO C++ Committee (WG21)
22
• ISO/IEC JTC1/SC22/WG21 (Joint Technical Committee 1/Subcommittee 22/Working Group 21)
• Formed in 1990-91
• Consists of accredited experts from member nations of ISO/IEC JTC1/SC22 who are interested in the
C++ work
• Includes 13 member countries: Bulgaria, Canada, Czech Republic, Finland, France, Germany,
Netherlands, Poland, Russia, Spain, Switzerland, United Kingdom, and the United States
– Bulgaria, Czech Republic, and Poland joined during last year
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
ISO C++ Committee (WG21)
EPAM joined "The Committee" in February 2017!
22
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ Momentum
23
SC 22
SUBGROUP
NAME
RECENT FACE-TO-FACE
ATTENDANCE
NOTES
WG 4 COBOL 15
WG 5 Fortran 26
WG 9 Ada 0
WG 14 C 24
WG 17 Prolog 3
WG 21 C++ 224
WG 23
Programming Language
Vulnerabilities
3
+ ~10 WG21 experts when meeting co-located
with WG21
WG 24 Linux Standard Base (none yet)
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Not just yet another ISO committee
24
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
ISO C++ Committee structure
25
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Performance vs type safety and usability
26
class Price { /* ... */ };
Price buy = new Price(10);
Price threashold = new Price(11);
if(buy.less(threashold))
execute();
buy.incr(1);
In most "modern" languages (i.e. Java, C#)
user-defined types
• have to be allocated on the heap
• do not have value semantics
• do not work with built-in operators
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Performance vs type safety and usability
JAVA
26
class Price { /* ... */ };
Price buy = new Price(10);
Price threashold = new Price(11);
if(buy.less(threashold))
execute();
buy.incr(1);
In most "modern" languages (i.e. Java, C#)
user-defined types
• have to be allocated on the heap
• do not have value semantics
• do not work with built-in operators
class price { /* ... */ };
price buy(10);
price threashold(11);
if(buy < threashold)
execute();
buy += 1;
Modern C++
• type safety without sacrificing performance
• power and expressiveness of built-in types
• prefers value semantics
• limits dynamic allocations
• discourages dynamic polymorphism
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Performance vs type safety and usability
JAVA C++
26
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Because type matters
27
void qsort(void* base, size_t el_count, size_t el_size,
int (*compare)(const void*, const void*));
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Because type matters
C
27
void qsort(void* base, size_t el_count, size_t el_size,
int (*compare)(const void*, const void*));
template<class RandomIt, class Compare>
constexpr void sort(RandomIt first, RandomIt last, Compare comp);
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Because type matters
C
C++
27
void qsort(void* base, size_t el_count, size_t el_size,
int (*compare)(const void*, const void*));
template<class RandomIt, class Compare>
constexpr void sort(RandomIt first, RandomIt last, Compare comp);
template<class ExecutionPolicy, class RandomIt, class Compare>
void sort(ExecutionPolicy&& policy, RandomIt first, RandomIt last, Compare comp);
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Because type matters
C
C++
27
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Because type matters
28
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Because type matters
29
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Uni ed approach to resource handling
30
{
auto smart_ptr = std::make_unique<BigData>();
// use ptr
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Uni ed approach to resource handling
MEMORY
30
{
auto smart_ptr = std::make_unique<BigData>();
// use ptr
}
{
auto lock = std::scoped_lock(mtx);
// critical section
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Uni ed approach to resource handling
MEMORY
THREAD SYNCHRONIZATION
30
{
auto smart_ptr = std::make_unique<BigData>();
// use ptr
}
{
auto lock = std::scoped_lock(mtx);
// critical section
}
{
auto file = fhandle(fopen("demo.txt", "r"));
// use the file
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Uni ed approach to resource handling
MEMORY
THREAD SYNCHRONIZATION
FILE HANDLES
30
{
auto smart_ptr = std::make_unique<BigData>();
// use ptr
}
{
auto lock = std::scoped_lock(mtx);
// critical section
}
{
auto file = fhandle(fopen("demo.txt", "r"));
// use the file
}
{
auto socket = connect("www.epam.com");
// use the socket
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Uni ed approach to resource handling
MEMORY
THREAD SYNCHRONIZATION
FILE HANDLES
NETWORK SOCKET
30
{
auto smart_ptr = std::make_unique<BigData>();
// use ptr
}
{
auto lock = std::scoped_lock(mtx);
// critical section
}
{
auto file = fhandle(fopen("demo.txt", "r"));
// use the file
}
{
auto socket = connect("www.epam.com");
// use the socket
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Uni ed approach to resource handling
MEMORY
THREAD SYNCHRONIZATION
FILE HANDLES
NETWORK SOCKET
No need for a garbage collector as memory is not the only resource to handle
30
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
31
constexpr double avg_speed(double length,
double time)
{
return length / time;
}
/// l - distance in kilometers
/// t - time in hours
void foo(double l, double t)
{
auto speed = avg_speed(l, t);
int mps = int(speed * 1000 / 3600);
printf("Average speed in mps is: %un",
mps);
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
31
constexpr double avg_speed(double length,
double time)
{
return length / time;
}
/// l - distance in kilometers
/// t - time in hours
void foo(double l, double t)
{
auto speed = avg_speed(l, t);
int mps = int(speed * 1000 / 3600);
printf("Average speed in mps is: %un",
mps);
}
constexpr Velocity auto avg_speed(Length auto d,
Time auto t)
{
return d / t;
}
void foo(Length auto l, Time auto t)
{
auto speed = avg_speed(l, t);
auto mps = quantity_cast<metre_per_second,
int>(speed);
printf("Average speed in mps is: %un",
mps.count());
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
31
constexpr double avg_speed(double length,
double time)
{
return length / time;
}
/// l - distance in kilometers
/// t - time in hours
void foo(double l, double t)
{
auto speed = avg_speed(l, t);
int mps = int(speed * 1000 / 3600);
printf("Average speed in mps is: %un",
mps);
}
constexpr Velocity auto avg_speed(Length auto d,
Time auto t)
{
return d / t;
}
void foo(Length auto l, Time auto t)
{
auto speed = avg_speed(l, t);
auto mps = quantity_cast<metre_per_second,
int>(speed);
printf("Average speed in mps is: %un",
mps.count());
}
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
How much do we pay for such advanced and safe abstractions?
31
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <cstdio>
constexpr double avg_speed(double length, double time)
{
return length / time;
}
void foo(double l, double t)
{
auto speed = avg_speed(l, t);
printf("Average speed in mps is: %un",
int(speed * 1000 / 3600));
}
int main()
{
foo(144., 2.);
}
 -std=c++2a -fconcepts -O2 -DNDEBUG
  11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries
 Add new...  Add tool...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
.LC2:
.string "Average speed in mps is: %un"
foo(double, double):
divsd xmm0, xmm1
mov edi, OFFSET FLAT:.LC2
xor eax, eax
mulsd xmm0, QWORD PTR .LC0[rip]
divsd xmm0, QWORD PTR .LC1[rip]
cvttsd2si esi, xmm0
jmp printf
main:
sub rsp, 8
mov esi, 20
mov edi, OFFSET FLAT:.LC2
ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 0
Average speed in mps is: 20
  Wrap lines
x86-64 gcc 9.2
Edit on Compiler Explorer
32
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <units/dimensions/velocity.h>
using namespace units;
template<Length L, Time T>
constexpr Velocity avg_speed(L length, T time)
{
return length / time;
}
void foo(double l, double t)
{
auto speed = avg_speed(quantity<kilometre>(l), quantity<hour>(t)
printf("Average speed in mps is: %un",
quantity_cast<metre_per_second, int>(speed).count());
}
int main()
{
foo(144., 2.);
}
 -std=c++2a -fconcepts -O2 -DNDEBUG
  11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries
 Add new...  Add tool...
1
2
3
4
5
6
7
8
9
10
11
12
13
14
.LC2:
.string "Average speed in mps is: %un"
foo(double, double):
divsd xmm0, xmm1
mov edi, OFFSET FLAT:.LC2
xor eax, eax
mulsd xmm0, QWORD PTR .LC0[rip]
divsd xmm0, QWORD PTR .LC1[rip]
cvttsd2si esi, xmm0
jmp printf
main:
sub rsp, 8
mov esi, 20
mov edi, OFFSET FLAT:.LC2
ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 0
Average speed in mps is: 20
  Wrap lines
x86-64 gcc 9.2
Edit on Compiler Explorer
33
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <units/dimensions/velocity.h>
using namespace units;
template<Length L, Time T>
constexpr Velocity avg_speed(L length, T time)
{
return length / time;
}
void foo(Length l, Time t)
{
auto speed = avg_speed(l, t);
printf("Average speed in mps is: %un",
quantity_cast<metre_per_second, int>(speed).count());
}
int main()
{
using namespace units::literals;
foo(144.km, 2.h);
}
 -std=c++2a -fconcepts -O2 -DNDEBUG
  11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries
 Add new...  Add tool...
1
2
3
4
5
6
7
8
9
10
11
.LC0:
.string "Average speed in mps is: %un"
main:
sub rsp, 8
mov esi, 20
mov edi, OFFSET FLAT:.LC0
xor eax, eax
call printf
xor eax, eax
add rsp, 8
ret
ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 0
Average speed in mps is: 20
  Wrap lines
x86-64 gcc 9.2
Edit on Compiler Explorer
34
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Compile time safety without sacri cing performance
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#include <cstdio>
int main()
{
printf("Average speed in mps is: %un", 20);
}
 -std=c++2a -fconcepts -O2 -DNDEBUG
  11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries
 Add new...  Add tool...
1
2
3
4
5
6
7
8
9
10
11
.LC0:
.string "Average speed in mps is: %un"
main:
sub rsp, 8
mov esi, 20
mov edi, OFFSET FLAT:.LC0
xor eax, eax
call printf
xor eax, eax
add rsp, 8
ret
ASM generation compiler returned: 0
Execution build compiler returned: 0
Program returned: 0
Average speed in mps is: 20
  Wrap lines
x86-64 gcc 9.2
Edit on Compiler Explorer
35
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Omnipresence of compile-time usage
36
constexpr auto d = 2019_y/September/21;
static_assert(weekday{d} == Saturday);
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Omnipresence of compile-time usage
DATE HANDLING
36
constexpr auto d = 2019_y/September/21;
static_assert(weekday{d} == Saturday);
std::cout << "'SEC 2019' starts" <<
" on " << weekday{d} <<
" at " << d + 9h << "n";
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Omnipresence of compile-time usage
DATE HANDLING
36
constexpr auto d = 2019_y/September/21;
static_assert(weekday{d} == Saturday);
std::cout << "'SEC 2019' starts" <<
" on " << weekday{d} <<
" at " << d + 9h << "n";
static_assert(d == September/21/2019);
static_assert(d == 21_d/September/2019);
static_assert(d == Saturday[3]/September/2019);
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Omnipresence of compile-time usage
DATE HANDLING
36
constexpr auto d = 2019_y/September/21;
static_assert(weekday{d} == Saturday);
std::cout << "'SEC 2019' starts" <<
" on " << weekday{d} <<
" at " << d + 9h << "n";
static_assert(d == September/21/2019);
static_assert(d == 21_d/September/2019);
static_assert(d == Saturday[3]/September/2019);
// simple numeric operations
static_assert(10km / 2 == 5km);
// unit conversions
static_assert(1h == 3600s);
static_assert(1km + 1m == 1001m);
// dimension conversions
static_assert(1km / 1s == 1000mps);
static_assert(2kmph * 2h == 4km);
static_assert(2km / 2kmph == 1h);
static_assert(1000 / 1s == 1kHz);
static_assert(10km / 5km == 2);
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Omnipresence of compile-time usage
DATE HANDLING UNITS AND DIMENSIONAL ANALYSIS
36
constexpr auto d = 2019_y/September/21;
static_assert(weekday{d} == Saturday);
std::cout << "'SEC 2019' starts" <<
" on " << weekday{d} <<
" at " << d + 9h << "n";
static_assert(d == September/21/2019);
static_assert(d == 21_d/September/2019);
static_assert(d == Saturday[3]/September/2019);
// simple numeric operations
static_assert(10km / 2 == 5km);
// unit conversions
static_assert(1h == 3600s);
static_assert(1km + 1m == 1001m);
// dimension conversions
static_assert(1km / 1s == 1000mps);
static_assert(2kmph * 2h == 4km);
static_assert(2km / 2kmph == 1h);
static_assert(1000 / 1s == 1kHz);
static_assert(10km / 5km == 2);
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Omnipresence of compile-time usage
DATE HANDLING UNITS AND DIMENSIONAL ANALYSIS
The fastest programs are those that do nothing
36
Disconnected Connecting
Connected
connect / establish
established timeout / establish
ping [is_valid] / reset_timeout
disconnect / close
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Finite State Machine (FSM)
37
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: A classical approach
38
class fsm {
enum class state : char { disconnected, connecting, connected } state_;
public:
constexpr void on_event(const connect&)
{
if(state_ == state::disconnected) {
establish();
state_ = state::connecting;
}
}
constexpr void on_event(const disconnect&) { /* ... */ }
constexpr void on_event(const established&) { /* ... */ }
constexpr void on_event(const ping& event) { /* ... */ }
constexpr void on_event(const timeout&) { /* ... */ }
};
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: A naive approach
39
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: Alternative syntax
40
struct connection {
auto operator()() const
{
using namespace boost::sml;
return make_transition_table(
* "Disconnected"_s + event<connect> / establish = "Connecting"_s,
"Connecting"_s + event<established> = "Connected"_s,
"Connected"_s + event<ping> [ is_valid ] / reset_timeout,
"Connected"_s + event<timeout> / establish = "Connecting"_s,
"Connected"_s + event<disconnect> / close = "Disconnected"_s
);
}
};
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: Domain Speci c Language
41
struct connection {
auto operator()() const
{
using namespace boost::sml;
return make_transition_table(
* "Disconnected"_s + event<connect> / establish = "Connecting"_s,
"Connecting"_s + event<established> = "Connected"_s,
"Connected"_s + event<ping> [ is_valid ] / reset_timeout,
"Connected"_s + event<timeout> / establish = "Connecting"_s,
"Connected"_s + event<disconnect> / close = "Disconnected"_s
);
}
};
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: Domain Speci c Language
Program that says WHAT rather than HOW is more likely to be correct
41
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: A classical approach
42
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: A naive approach
43
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: Domain Speci c Language
44
CLASSICAL NAIVE DSL
HEAP USAGE Lots None None
DYNAMIC POLYMORPHISM Yes No No
INLINING No Yes Yes
CPU CACHE FRIENDLY No Yes Yes
ERROR PRONE Yes Yes No
REUSE Moderate Hard Easy
ASSEMBLY LINES 350 21 21
MEMORY FOOTPRINT High 1B 1B
PERFORMANCE SLOW FAST FAST
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
FSM: Summary
45
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The best language for Data Oriented Design (DOD)
46
1 Keep data that is not used together apart, on separate cache lines
• avoids the invisible convoying of false sharing (ping-pong)
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The best language for Data Oriented Design (DOD)
46
1 Keep data that is not used together apart, on separate cache lines
• avoids the invisible convoying of false sharing (ping-pong)
2 Keep data that is frequently used together close together
• if a thread that uses A frequently also needs B, try to put them in one cache line
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The best language for Data Oriented Design (DOD)
46
1 Keep data that is not used together apart, on separate cache lines
• avoids the invisible convoying of false sharing (ping-pong)
2 Keep data that is frequently used together close together
• if a thread that uses A frequently also needs B, try to put them in one cache line
3 Keep “hot” and “cold” data that is not used with the same frequency apart
• fit “hot” data in the fewest possible cache lines and memory pages
• reduces the cache footprint and cache misses, the memory footprint, and virtual memory
paging
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The best language for Data Oriented Design (DOD)
46
1 Keep data that is not used together apart, on separate cache lines
• avoids the invisible convoying of false sharing (ping-pong)
2 Keep data that is frequently used together close together
• if a thread that uses A frequently also needs B, try to put them in one cache line
3 Keep “hot” and “cold” data that is not used with the same frequency apart
• fit “hot” data in the fewest possible cache lines and memory pages
• reduces the cache footprint and cache misses, the memory footprint, and virtual memory
paging
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The best language for Data Oriented Design (DOD)
CPU instructions to execute is also data sitting in L1 cache
46
Modern C++ is not the language we used to learn 20 years ago!
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
• constexpr to move execution of the code from run-time to compile-time
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
• constexpr to move execution of the code from run-time to compile-time
• Deterministic destruction
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
• constexpr to move execution of the code from run-time to compile-time
• Deterministic destruction
• Better resource handling
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
• constexpr to move execution of the code from run-time to compile-time
• Deterministic destruction
• Better resource handling
• Value semantics to improve performance and development experience
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
• constexpr to move execution of the code from run-time to compile-time
• Deterministic destruction
• Better resource handling
• Value semantics to improve performance and development experience
• Full control over concurrency and parallelism (task-based, parallel, vectorized, lock-free, ...)
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
• constexpr to move execution of the code from run-time to compile-time
• Deterministic destruction
• Better resource handling
• Value semantics to improve performance and development experience
• Full control over concurrency and parallelism (task-based, parallel, vectorized, lock-free, ...)
• Many productivity-related improvements (i.e. lambdas, range-for loops, auto, variadic templates, ...)
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
Modern C++ is not the language we used to learn 20 years ago!
• Move Semantics to e iciently handle resources and improve performance
• constexpr to move execution of the code from run-time to compile-time
• Deterministic destruction
• Better resource handling
• Value semantics to improve performance and development experience
• Full control over concurrency and parallelism (task-based, parallel, vectorized, lock-free, ...)
• Many productivity-related improvements (i.e. lambdas, range-for loops, auto, variadic templates, ...)
• Lots of new toys in the C++ Standard Library
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Modern C++
47
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
48
• Concepts to provide even better compile-time safety
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
48
• Concepts to provide even better compile-time safety
• Coroutines to enhance asynchronous operations
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
48
• Concepts to provide even better compile-time safety
• Coroutines to enhance asynchronous operations
• Ranges to build better algorithms with higher level abstractions
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
48
• Concepts to provide even better compile-time safety
• Coroutines to enhance asynchronous operations
• Ranges to build better algorithms with higher level abstractions
• Modules to fix C build system and improve large-scale architecture
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
48
• Concepts to provide even better compile-time safety
• Coroutines to enhance asynchronous operations
• Ranges to build better algorithms with higher level abstractions
• Modules to fix C build system and improve large-scale architecture
• <=> to simplify implementation of value types
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
48
• Concepts to provide even better compile-time safety
• Coroutines to enhance asynchronous operations
• Ranges to build better algorithms with higher level abstractions
• Modules to fix C build system and improve large-scale architecture
• <=> to simplify implementation of value types
• New tools in the C++ Standard Library
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
48
• Concepts to provide even better compile-time safety
• Coroutines to enhance asynchronous operations
• Ranges to build better algorithms with higher level abstractions
• Modules to fix C build system and improve large-scale architecture
• <=> to simplify implementation of value types
• New tools in the C++ Standard Library
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++20 is going to be a game-changer
EPAM is an active participant of the C++ standardization process and
contributed some performance-related features to C++20 :-)
48
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ ON THE MARKET
49
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Tiobe Index: August 2019
50
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
IEEE Spectrum: The 2018 Top Programming Languages
51
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
IEEE Spectrum: The 2018 Top Programming Languages
WEB
MOBILE
ENTERPRISE
EMBEDDED
52
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Top 10 GitHub languages (# of pushes)
53
https://blog.jetbrains.com/clion/2015/07/infographics-cpp-facts-before-clion
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Facts about C++
54
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Facts about C++
55
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Facts about C++
55
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Facts about C++
56
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Facts about C++
56
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The Modern IT world is built on C++
57
• Low-Level
– Operating systems and drivers
– Embedded devices (from tiny to huge scale)
– Autonomous cars
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The Modern IT world is built on C++
57
• Low-Level
– Operating systems and drivers
– Embedded devices (from tiny to huge scale)
– Autonomous cars
• High performance libraries
– Scientific (NASA, CERN, ...)
– Hardware accelerated calculations
– AI, machine learning
– Image recognition and mapping
– Graphics
– Maps and navigation
– All kinds of frameworks (Electron, ...)
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The Modern IT world is built on C++
57
• Low-Level
– Operating systems and drivers
– Embedded devices (from tiny to huge scale)
– Autonomous cars
• High performance libraries
– Scientific (NASA, CERN, ...)
– Hardware accelerated calculations
– AI, machine learning
– Image recognition and mapping
– Graphics
– Maps and navigation
– All kinds of frameworks (Electron, ...)
• High performance servers
– Stock Exchanges
– High Frequency Trading
– Data centers (Google, Facebook, Amazon, ...)
– Databases (MySQL, ...)
– Telecom
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The Modern IT world is built on C++
57
• Low-Level
– Operating systems and drivers
– Embedded devices (from tiny to huge scale)
– Autonomous cars
• High performance libraries
– Scientific (NASA, CERN, ...)
– Hardware accelerated calculations
– AI, machine learning
– Image recognition and mapping
– Graphics
– Maps and navigation
– All kinds of frameworks (Electron, ...)
• High performance servers
– Stock Exchanges
– High Frequency Trading
– Data centers (Google, Facebook, Amazon, ...)
– Databases (MySQL, ...)
– Telecom
• End-user applications
– Games
– Powerful modeling and simulation so ware
(Adobe, Maya, Autodesk, Pixar, ...)
– Compilers
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
The Modern IT world is built on C++
57
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Windows
58
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
3D Computer Animation
59
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Movies
60
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Raster graphics editors
61
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Light Projections
62
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
Games
63
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ is the most e cient programming language in the world
64
1 Learn Modern C++ and stay current with a fast evolving language
• follow and learn C++ releases
• follow C++ conferences and blogs
• hire C++ trainers
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ is the most e cient programming language in the world
64
1 Learn Modern C++ and stay current with a fast evolving language
• follow and learn C++ releases
• follow C++ conferences and blogs
• hire C++ trainers
2 Use C++ in your projects to
• decrease money expenditure on computational resources
• boost performance
• limit jitter (improve response time)
• limit power usage
• limit memory footprint
• have more control over hardware
SEC 2019 | Free lunch is over: Why C++ is so important in the modern world?
C++ is the most e cient programming language in the world
64
Free Lunch is Over: Why is C++ so Important in the Modern World?

More Related Content

Similar to Free Lunch is Over: Why is C++ so Important in the Modern World?

Introduction to Software Engineering Lecture 0
Introduction to Software Engineering  Lecture 0Introduction to Software Engineering  Lecture 0
Introduction to Software Engineering Lecture 0
Mohamed Essam
 
What Open Compute Project has in store for us all in 2020! webinar
What Open Compute Project has in store for us all in 2020! webinarWhat Open Compute Project has in store for us all in 2020! webinar
What Open Compute Project has in store for us all in 2020! webinar
Submer Immersion Cooling
 
C++ for programmers edukite
C++ for programmers   edukiteC++ for programmers   edukite
C++ for programmers edukite
EduKite
 
JHipster & blueprint 02-07-2019 - casablanca jug
JHipster & blueprint 02-07-2019 - casablanca jugJHipster & blueprint 02-07-2019 - casablanca jug
JHipster & blueprint 02-07-2019 - casablanca jug
Anthony Viard
 
All You Need To Know About C Program Assignment Help.pdf
All You Need To Know About C Program Assignment Help.pdfAll You Need To Know About C Program Assignment Help.pdf
All You Need To Know About C Program Assignment Help.pdf
Brad Smith
 
Technology and Digital Platform | 2019 partner summit
Technology and Digital Platform | 2019 partner summitTechnology and Digital Platform | 2019 partner summit
Technology and Digital Platform | 2019 partner summit
Andrew Kumar
 
Cloud native past, present and future
Cloud native past, present and futureCloud native past, present and future
Cloud native past, present and future
Cheryl Hung
 
Alles offen = gut(ai)
Alles offen = gut(ai)Alles offen = gut(ai)
Alles offen = gut(ai)
Comsysto Reply GmbH
 
Fifth Edition Architecture Week @Gothenburg 141009
Fifth Edition Architecture Week @Gothenburg 141009Fifth Edition Architecture Week @Gothenburg 141009
Fifth Edition Architecture Week @Gothenburg 141009Capgemini
 
Comparison between python and c++
Comparison between python and c++Comparison between python and c++
Comparison between python and c++
ssusera7faf41
 
"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo
"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo
"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo
teyamagu
 
Microsoft365 developer opportunity welcome keynote
Microsoft365 developer opportunity welcome keynoteMicrosoft365 developer opportunity welcome keynote
Microsoft365 developer opportunity welcome keynote
Dipti Chhatrapati
 
DevOps – Don’t Be Left Behind
DevOps – Don’t Be Left BehindDevOps – Don’t Be Left Behind
DevOps – Don’t Be Left Behind
Capgemini
 
Guiding a Product Roadmap in a Chaotic World
Guiding a Product Roadmap in a Chaotic WorldGuiding a Product Roadmap in a Chaotic World
Guiding a Product Roadmap in a Chaotic World
Eric de Jager
 
Adopting BIM - An Architect's Perspective (07 May 2014)
Adopting BIM - An Architect's Perspective (07 May 2014)Adopting BIM - An Architect's Perspective (07 May 2014)
Adopting BIM - An Architect's Perspective (07 May 2014)
Elrond Burrell
 
Do UX designers have a role in reducing digital waste?
Do UX designers have a role in reducing digital waste?Do UX designers have a role in reducing digital waste?
Do UX designers have a role in reducing digital waste?
User Vision
 
Building a scalable app factory with Appcelerator Platform
Building a scalable app factory with Appcelerator PlatformBuilding a scalable app factory with Appcelerator Platform
Building a scalable app factory with Appcelerator Platform
Angus Fox
 
Hicss52 20190108 v2
Hicss52 20190108 v2Hicss52 20190108 v2
Hicss52 20190108 v2
ISSIP
 
What Are The Best Practices When Building a Back-end App With Kotlin And Spri...
What Are The Best Practices When Building a Back-end App With Kotlin And Spri...What Are The Best Practices When Building a Back-end App With Kotlin And Spri...
What Are The Best Practices When Building a Back-end App With Kotlin And Spri...
Alex Fedorov
 
OSDC 2019 | DevOps in a containerized world by Martin Alfke
OSDC 2019 | DevOps in a containerized world by Martin AlfkeOSDC 2019 | DevOps in a containerized world by Martin Alfke
OSDC 2019 | DevOps in a containerized world by Martin Alfke
NETWAYS
 

Similar to Free Lunch is Over: Why is C++ so Important in the Modern World? (20)

Introduction to Software Engineering Lecture 0
Introduction to Software Engineering  Lecture 0Introduction to Software Engineering  Lecture 0
Introduction to Software Engineering Lecture 0
 
What Open Compute Project has in store for us all in 2020! webinar
What Open Compute Project has in store for us all in 2020! webinarWhat Open Compute Project has in store for us all in 2020! webinar
What Open Compute Project has in store for us all in 2020! webinar
 
C++ for programmers edukite
C++ for programmers   edukiteC++ for programmers   edukite
C++ for programmers edukite
 
JHipster & blueprint 02-07-2019 - casablanca jug
JHipster & blueprint 02-07-2019 - casablanca jugJHipster & blueprint 02-07-2019 - casablanca jug
JHipster & blueprint 02-07-2019 - casablanca jug
 
All You Need To Know About C Program Assignment Help.pdf
All You Need To Know About C Program Assignment Help.pdfAll You Need To Know About C Program Assignment Help.pdf
All You Need To Know About C Program Assignment Help.pdf
 
Technology and Digital Platform | 2019 partner summit
Technology and Digital Platform | 2019 partner summitTechnology and Digital Platform | 2019 partner summit
Technology and Digital Platform | 2019 partner summit
 
Cloud native past, present and future
Cloud native past, present and futureCloud native past, present and future
Cloud native past, present and future
 
Alles offen = gut(ai)
Alles offen = gut(ai)Alles offen = gut(ai)
Alles offen = gut(ai)
 
Fifth Edition Architecture Week @Gothenburg 141009
Fifth Edition Architecture Week @Gothenburg 141009Fifth Edition Architecture Week @Gothenburg 141009
Fifth Edition Architecture Week @Gothenburg 141009
 
Comparison between python and c++
Comparison between python and c++Comparison between python and c++
Comparison between python and c++
 
"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo
"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo
"Journey of CI/CD Pipeline Improvement in Yahoo! JAPAN" @ #SeConfTokyo
 
Microsoft365 developer opportunity welcome keynote
Microsoft365 developer opportunity welcome keynoteMicrosoft365 developer opportunity welcome keynote
Microsoft365 developer opportunity welcome keynote
 
DevOps – Don’t Be Left Behind
DevOps – Don’t Be Left BehindDevOps – Don’t Be Left Behind
DevOps – Don’t Be Left Behind
 
Guiding a Product Roadmap in a Chaotic World
Guiding a Product Roadmap in a Chaotic WorldGuiding a Product Roadmap in a Chaotic World
Guiding a Product Roadmap in a Chaotic World
 
Adopting BIM - An Architect's Perspective (07 May 2014)
Adopting BIM - An Architect's Perspective (07 May 2014)Adopting BIM - An Architect's Perspective (07 May 2014)
Adopting BIM - An Architect's Perspective (07 May 2014)
 
Do UX designers have a role in reducing digital waste?
Do UX designers have a role in reducing digital waste?Do UX designers have a role in reducing digital waste?
Do UX designers have a role in reducing digital waste?
 
Building a scalable app factory with Appcelerator Platform
Building a scalable app factory with Appcelerator PlatformBuilding a scalable app factory with Appcelerator Platform
Building a scalable app factory with Appcelerator Platform
 
Hicss52 20190108 v2
Hicss52 20190108 v2Hicss52 20190108 v2
Hicss52 20190108 v2
 
What Are The Best Practices When Building a Back-end App With Kotlin And Spri...
What Are The Best Practices When Building a Back-end App With Kotlin And Spri...What Are The Best Practices When Building a Back-end App With Kotlin And Spri...
What Are The Best Practices When Building a Back-end App With Kotlin And Spri...
 
OSDC 2019 | DevOps in a containerized world by Martin Alfke
OSDC 2019 | DevOps in a containerized world by Martin AlfkeOSDC 2019 | DevOps in a containerized world by Martin Alfke
OSDC 2019 | DevOps in a containerized world by Martin Alfke
 

More from Mateusz Pusz

Striving for ultimate Low Latency
Striving for ultimate Low LatencyStriving for ultimate Low Latency
Striving for ultimate Low Latency
Mateusz Pusz
 
Rethinking the Way We do Templates in C++
Rethinking the Way We do Templates in C++Rethinking the Way We do Templates in C++
Rethinking the Way We do Templates in C++
Mateusz Pusz
 
C++11 Was Only the Beginning
C++11 Was Only the BeginningC++11 Was Only the Beginning
C++11 Was Only the Beginning
Mateusz Pusz
 
Implementing a Physical Units Library for C++
Implementing a Physical Units Library for C++Implementing a Physical Units Library for C++
Implementing a Physical Units Library for C++
Mateusz Pusz
 
Effective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variantEffective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variant
Mateusz Pusz
 
C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?
Mateusz Pusz
 
Effective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variantEffective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variant
Mateusz Pusz
 
Git, CMake, Conan - How to ship and reuse our C++ projects?
Git, CMake, Conan - How to ship and reuse our C++ projects?Git, CMake, Conan - How to ship and reuse our C++ projects?
Git, CMake, Conan - How to ship and reuse our C++ projects?
Mateusz Pusz
 
Beyond C++17
Beyond C++17Beyond C++17
Beyond C++17
Mateusz Pusz
 
Pointless Pointers - How to make our interfaces efficient?
Pointless Pointers - How to make our interfaces efficient?Pointless Pointers - How to make our interfaces efficient?
Pointless Pointers - How to make our interfaces efficient?
Mateusz Pusz
 
Striving for ultimate Low Latency
Striving for ultimate Low LatencyStriving for ultimate Low Latency
Striving for ultimate Low Latency
Mateusz Pusz
 
Small Lie in Big O
Small Lie in Big OSmall Lie in Big O
Small Lie in Big O
Mateusz Pusz
 
std::shared_ptr<T> - (not so) Smart hammer for every pointy nail
std::shared_ptr<T> - (not so) Smart hammer for every pointy nailstd::shared_ptr<T> - (not so) Smart hammer for every pointy nail
std::shared_ptr<T> - (not so) Smart hammer for every pointy nail
Mateusz Pusz
 

More from Mateusz Pusz (13)

Striving for ultimate Low Latency
Striving for ultimate Low LatencyStriving for ultimate Low Latency
Striving for ultimate Low Latency
 
Rethinking the Way We do Templates in C++
Rethinking the Way We do Templates in C++Rethinking the Way We do Templates in C++
Rethinking the Way We do Templates in C++
 
C++11 Was Only the Beginning
C++11 Was Only the BeginningC++11 Was Only the Beginning
C++11 Was Only the Beginning
 
Implementing a Physical Units Library for C++
Implementing a Physical Units Library for C++Implementing a Physical Units Library for C++
Implementing a Physical Units Library for C++
 
Effective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variantEffective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variant
 
C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?C++ Concepts and Ranges - How to use them?
C++ Concepts and Ranges - How to use them?
 
Effective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variantEffective replacement of dynamic polymorphism with std::variant
Effective replacement of dynamic polymorphism with std::variant
 
Git, CMake, Conan - How to ship and reuse our C++ projects?
Git, CMake, Conan - How to ship and reuse our C++ projects?Git, CMake, Conan - How to ship and reuse our C++ projects?
Git, CMake, Conan - How to ship and reuse our C++ projects?
 
Beyond C++17
Beyond C++17Beyond C++17
Beyond C++17
 
Pointless Pointers - How to make our interfaces efficient?
Pointless Pointers - How to make our interfaces efficient?Pointless Pointers - How to make our interfaces efficient?
Pointless Pointers - How to make our interfaces efficient?
 
Striving for ultimate Low Latency
Striving for ultimate Low LatencyStriving for ultimate Low Latency
Striving for ultimate Low Latency
 
Small Lie in Big O
Small Lie in Big OSmall Lie in Big O
Small Lie in Big O
 
std::shared_ptr<T> - (not so) Smart hammer for every pointy nail
std::shared_ptr<T> - (not so) Smart hammer for every pointy nailstd::shared_ptr<T> - (not so) Smart hammer for every pointy nail
std::shared_ptr<T> - (not so) Smart hammer for every pointy nail
 

Recently uploaded

AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
Google
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Natan Silnitsky
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
Max Andersen
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
NYGGS Automation Suite
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
Cyanic lab
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
Adele Miller
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
abdulrafaychaudhry
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
XfilesPro
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
QuickwayInfoSystems3
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
Neo4j
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 

Recently uploaded (20)

AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing SuiteAI Pilot Review: The World’s First Virtual Assistant Marketing Suite
AI Pilot Review: The World’s First Virtual Assistant Marketing Suite
 
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.ILBeyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
Beyond Event Sourcing - Embracing CRUD for Wix Platform - Java.IL
 
Quarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden ExtensionsQuarkus Hidden and Forbidden Extensions
Quarkus Hidden and Forbidden Extensions
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
Enterprise Resource Planning System in Telangana
Enterprise Resource Planning System in TelanganaEnterprise Resource Planning System in Telangana
Enterprise Resource Planning System in Telangana
 
Cyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdfCyaniclab : Software Development Agency Portfolio.pdf
Cyaniclab : Software Development Agency Portfolio.pdf
 
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
May Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdfMay Marketo Masterclass, London MUG May 22 2024.pdf
May Marketo Masterclass, London MUG May 22 2024.pdf
 
Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)Introduction to Pygame (Lecture 7 Python Game Development)
Introduction to Pygame (Lecture 7 Python Game Development)
 
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, BetterWebinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
Webinar: Salesforce Document Management 2.0 - Smarter, Faster, Better
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
Enterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptxEnterprise Software Development with No Code Solutions.pptx
Enterprise Software Development with No Code Solutions.pptx
 
GraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph TechnologyGraphSummit Paris - The art of the possible with Graph Technology
GraphSummit Paris - The art of the possible with Graph Technology
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 

Free Lunch is Over: Why is C++ so Important in the Modern World?

  • 1. Mateusz Pusz September 21, 2019 Free lunch is over WHY C++ IS SO IMPORTANT IN THE MODERN WORLD?
  • 2. This presentation has been prepared by EPAM Systems, Inc. solely for use by EPAM at its EPAM So ware Engineering Conference. This presentation or the information contained herein may not be reproduced or used for any other purpose. This presentation includes highly confidential and proprietary information and is delivered on the express condition that such information will not be disclosed to anyone except persons in the recipient organization who have a need to know solely for the purpose described above. No copies of this presentation will be made, and no other distribution will be made, without the consent of EPAM. Any distribution of this presentation to any other person, in whole or in part, or the reproduction of this presentation, or the divulgence of any of its contents is unauthorized. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Con dential Information 2
  • 3. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? WHY C++? 3
  • 4. • No matter how fast processors get, so ware consistently finds new ways to eat up the extra speed SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Herb Sutter 2005: Free Lunch is Over 4
  • 5. • No matter how fast processors get, so ware consistently finds new ways to eat up the extra speed • Applications have enjoyed free and regular performance gains for several decades – even without releasing new versions SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Herb Sutter 2005: Free Lunch is Over 4
  • 6. • No matter how fast processors get, so ware consistently finds new ways to eat up the extra speed • Applications have enjoyed free and regular performance gains for several decades – even without releasing new versions • Around 2003 we run out of room with approaches to boost CPU clocks – heat (too much and hard to dissipate) – power consumption (too high) – leakage problems SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Herb Sutter 2005: Free Lunch is Over 4
  • 7. LANGUAGE EFFICIENCY FLEXIBILITY ABSTRACTION PRODUCTIVITY C YES! YES! non-goal non-goal C++ YES! YES! YES! WIP JAVA, C# at the expense of at the expense of YES! YES! SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Where the Focus Is? 5
  • 8. LANGUAGE EFFICIENCY FLEXIBILITY ABSTRACTION PRODUCTIVITY C YES! YES! non-goal non-goal C++ YES! YES! YES! WIP JAVA, C# at the expense of at the expense of YES! YES! SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Where the Focus Is? C++ motto: You don't pay for what you don't use 5
  • 9. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Why C++? 6
  • 10. • Hardware costs • Limited resources on mobiles SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Why C++? PERFORMANCE PER TRANSISTOR 6
  • 11. • Hardware costs • Limited resources on mobiles • Get the most from every CPU core • Bigger experiences on a smaller hardware SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Why C++? PERFORMANCE PER TRANSISTOR PERFORMANCE PER CLOCK 6
  • 12. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Why C++? PERFORMANCE PER WAT 7
  • 13. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Why C++? PERFORMANCE PER WAT 7
  • 14. https://perspectives.mvdirona.com/2010/09/overall-data-center-costs SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Data center costs 8
  • 15. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? How C++ Combats Global Warming 9
  • 16. I guess in some way of saying here's my contribution to dealing with global warming because if you can double the e iciency of those systems you don't need yet another server farm that use as much energy as a small town. -- Bjarne Stroustrup SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? How C++ Combats Global Warming 10
  • 17. People costs shi from top to nearly irrelevant. James Hamilton VP & Distinguished Engineer, Amazon Web Services SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Focus shift 11
  • 18. E iciency is not just running fast or running bigger programs, it’s also running using less resources. -- Bjarne Stroustrup SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? E ciency 12
  • 19. E iciency is not just running fast or running bigger programs, it’s also running using less resources. -- Bjarne Stroustrup SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? E ciency Performance-oriented corporations are willing to pay more for so ware development if due to its better e iciency it will save lots of money during product lifetimes 12
  • 20. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Renaissance 13
  • 21. http://google-engtools.blogspot.com/2011/05/c-at-google-here-be-dragons.html SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Renaissance: Google 14
  • 22. http://10rem.net/blog/2011/02/22/creating-an-internet-explorer-add-in-toolbar-button-using- cplusplus-and-atl SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Renaissance: Microsoft 15
  • 23. Facebook consumes very little Wats per user. Actually fractions of Wat. ... Everything that is backend, high-performance is C++ because it must be responsive and well done. ... Facebook is literally running on C++. We also have JIT for PHP that is obviously written in C++ and generates machine code during runtime. ... Using the native language such as C++ means more features for the same power and less power for the given set of features. It is a very simple equation. -- Andrei Alexandrescu, Research Scientist at Facebook, Lang.Next 2012 SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Renaissance: Facebook (2012) 16
  • 24. https://www.phoronix.com/scan.php?page=news_item&px=Facebook-JIT-Cpp-Scripting SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Renaissance: Facebook (Today) 17
  • 25. https://www.bloomberg.com/professional/blog/bloomberg-advancing-c-scale SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Renaissance: Bloomberg 18
  • 26. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? WHAT IS C++? 19
  • 27. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? What is C++? 20
  • 28. • C++ is no longer C with classes SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? What is C++? 20
  • 29. • C++ is no longer C with classes • C++ is a general-purpose programming language – imperative, object-based, object-oriented, generic, and functional programming features – developer is not tied to any specific programming paradigm by the language SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? What is C++? 20
  • 30. • C++ is no longer C with classes • C++ is a general-purpose programming language – imperative, object-based, object-oriented, generic, and functional programming features – developer is not tied to any specific programming paradigm by the language • High-level abstractions at low cost SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? What is C++? 20
  • 31. • C++ is no longer C with classes • C++ is a general-purpose programming language – imperative, object-based, object-oriented, generic, and functional programming features – developer is not tied to any specific programming paradigm by the language • High-level abstractions at low cost • Low-level access when needed SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? What is C++? 20
  • 32. • C++ is no longer C with classes • C++ is a general-purpose programming language – imperative, object-based, object-oriented, generic, and functional programming features – developer is not tied to any specific programming paradigm by the language • High-level abstractions at low cost • Low-level access when needed • If used correctly, provides hard to beat performance SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? What is C++? 20
  • 33. • C++ is no longer C with classes • C++ is a general-purpose programming language – imperative, object-based, object-oriented, generic, and functional programming features – developer is not tied to any specific programming paradigm by the language • High-level abstractions at low cost • Low-level access when needed • If used correctly, provides hard to beat performance SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? What is C++? C++ language evolves now faster than ever 20
  • 34. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Timeline 21
  • 35. • ISO/IEC JTC1/SC22/WG21 (Joint Technical Committee 1/Subcommittee 22/Working Group 21) • Formed in 1990-91 • Consists of accredited experts from member nations of ISO/IEC JTC1/SC22 who are interested in the C++ work • Includes 13 member countries: Bulgaria, Canada, Czech Republic, Finland, France, Germany, Netherlands, Poland, Russia, Spain, Switzerland, United Kingdom, and the United States – Bulgaria, Czech Republic, and Poland joined during last year SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? ISO C++ Committee (WG21) 22
  • 36. • ISO/IEC JTC1/SC22/WG21 (Joint Technical Committee 1/Subcommittee 22/Working Group 21) • Formed in 1990-91 • Consists of accredited experts from member nations of ISO/IEC JTC1/SC22 who are interested in the C++ work • Includes 13 member countries: Bulgaria, Canada, Czech Republic, Finland, France, Germany, Netherlands, Poland, Russia, Spain, Switzerland, United Kingdom, and the United States – Bulgaria, Czech Republic, and Poland joined during last year SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? ISO C++ Committee (WG21) EPAM joined "The Committee" in February 2017! 22
  • 37. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ Momentum 23
  • 38. SC 22 SUBGROUP NAME RECENT FACE-TO-FACE ATTENDANCE NOTES WG 4 COBOL 15 WG 5 Fortran 26 WG 9 Ada 0 WG 14 C 24 WG 17 Prolog 3 WG 21 C++ 224 WG 23 Programming Language Vulnerabilities 3 + ~10 WG21 experts when meeting co-located with WG21 WG 24 Linux Standard Base (none yet) SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Not just yet another ISO committee 24
  • 39. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? ISO C++ Committee structure 25
  • 40. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Performance vs type safety and usability 26
  • 41. class Price { /* ... */ }; Price buy = new Price(10); Price threashold = new Price(11); if(buy.less(threashold)) execute(); buy.incr(1); In most "modern" languages (i.e. Java, C#) user-defined types • have to be allocated on the heap • do not have value semantics • do not work with built-in operators SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Performance vs type safety and usability JAVA 26
  • 42. class Price { /* ... */ }; Price buy = new Price(10); Price threashold = new Price(11); if(buy.less(threashold)) execute(); buy.incr(1); In most "modern" languages (i.e. Java, C#) user-defined types • have to be allocated on the heap • do not have value semantics • do not work with built-in operators class price { /* ... */ }; price buy(10); price threashold(11); if(buy < threashold) execute(); buy += 1; Modern C++ • type safety without sacrificing performance • power and expressiveness of built-in types • prefers value semantics • limits dynamic allocations • discourages dynamic polymorphism SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Performance vs type safety and usability JAVA C++ 26
  • 43. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Because type matters 27
  • 44. void qsort(void* base, size_t el_count, size_t el_size, int (*compare)(const void*, const void*)); SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Because type matters C 27
  • 45. void qsort(void* base, size_t el_count, size_t el_size, int (*compare)(const void*, const void*)); template<class RandomIt, class Compare> constexpr void sort(RandomIt first, RandomIt last, Compare comp); SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Because type matters C C++ 27
  • 46. void qsort(void* base, size_t el_count, size_t el_size, int (*compare)(const void*, const void*)); template<class RandomIt, class Compare> constexpr void sort(RandomIt first, RandomIt last, Compare comp); template<class ExecutionPolicy, class RandomIt, class Compare> void sort(ExecutionPolicy&& policy, RandomIt first, RandomIt last, Compare comp); SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Because type matters C C++ 27
  • 47. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Because type matters 28
  • 48. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Because type matters 29
  • 49. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Uni ed approach to resource handling 30
  • 50. { auto smart_ptr = std::make_unique<BigData>(); // use ptr } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Uni ed approach to resource handling MEMORY 30
  • 51. { auto smart_ptr = std::make_unique<BigData>(); // use ptr } { auto lock = std::scoped_lock(mtx); // critical section } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Uni ed approach to resource handling MEMORY THREAD SYNCHRONIZATION 30
  • 52. { auto smart_ptr = std::make_unique<BigData>(); // use ptr } { auto lock = std::scoped_lock(mtx); // critical section } { auto file = fhandle(fopen("demo.txt", "r")); // use the file } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Uni ed approach to resource handling MEMORY THREAD SYNCHRONIZATION FILE HANDLES 30
  • 53. { auto smart_ptr = std::make_unique<BigData>(); // use ptr } { auto lock = std::scoped_lock(mtx); // critical section } { auto file = fhandle(fopen("demo.txt", "r")); // use the file } { auto socket = connect("www.epam.com"); // use the socket } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Uni ed approach to resource handling MEMORY THREAD SYNCHRONIZATION FILE HANDLES NETWORK SOCKET 30
  • 54. { auto smart_ptr = std::make_unique<BigData>(); // use ptr } { auto lock = std::scoped_lock(mtx); // critical section } { auto file = fhandle(fopen("demo.txt", "r")); // use the file } { auto socket = connect("www.epam.com"); // use the socket } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Uni ed approach to resource handling MEMORY THREAD SYNCHRONIZATION FILE HANDLES NETWORK SOCKET No need for a garbage collector as memory is not the only resource to handle 30
  • 55. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance 31
  • 56. constexpr double avg_speed(double length, double time) { return length / time; } /// l - distance in kilometers /// t - time in hours void foo(double l, double t) { auto speed = avg_speed(l, t); int mps = int(speed * 1000 / 3600); printf("Average speed in mps is: %un", mps); } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance 31
  • 57. constexpr double avg_speed(double length, double time) { return length / time; } /// l - distance in kilometers /// t - time in hours void foo(double l, double t) { auto speed = avg_speed(l, t); int mps = int(speed * 1000 / 3600); printf("Average speed in mps is: %un", mps); } constexpr Velocity auto avg_speed(Length auto d, Time auto t) { return d / t; } void foo(Length auto l, Time auto t) { auto speed = avg_speed(l, t); auto mps = quantity_cast<metre_per_second, int>(speed); printf("Average speed in mps is: %un", mps.count()); } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance 31
  • 58. constexpr double avg_speed(double length, double time) { return length / time; } /// l - distance in kilometers /// t - time in hours void foo(double l, double t) { auto speed = avg_speed(l, t); int mps = int(speed * 1000 / 3600); printf("Average speed in mps is: %un", mps); } constexpr Velocity auto avg_speed(Length auto d, Time auto t) { return d / t; } void foo(Length auto l, Time auto t) { auto speed = avg_speed(l, t); auto mps = quantity_cast<metre_per_second, int>(speed); printf("Average speed in mps is: %un", mps.count()); } SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance How much do we pay for such advanced and safe abstractions? 31
  • 59. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include <cstdio> constexpr double avg_speed(double length, double time) { return length / time; } void foo(double l, double t) { auto speed = avg_speed(l, t); printf("Average speed in mps is: %un", int(speed * 1000 / 3600)); } int main() { foo(144., 2.); }  -std=c++2a -fconcepts -O2 -DNDEBUG   11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries  Add new...  Add tool... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .LC2: .string "Average speed in mps is: %un" foo(double, double): divsd xmm0, xmm1 mov edi, OFFSET FLAT:.LC2 xor eax, eax mulsd xmm0, QWORD PTR .LC0[rip] divsd xmm0, QWORD PTR .LC1[rip] cvttsd2si esi, xmm0 jmp printf main: sub rsp, 8 mov esi, 20 mov edi, OFFSET FLAT:.LC2 ASM generation compiler returned: 0 Execution build compiler returned: 0 Program returned: 0 Average speed in mps is: 20   Wrap lines x86-64 gcc 9.2 Edit on Compiler Explorer 32
  • 60. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include <units/dimensions/velocity.h> using namespace units; template<Length L, Time T> constexpr Velocity avg_speed(L length, T time) { return length / time; } void foo(double l, double t) { auto speed = avg_speed(quantity<kilometre>(l), quantity<hour>(t) printf("Average speed in mps is: %un", quantity_cast<metre_per_second, int>(speed).count()); } int main() { foo(144., 2.); }  -std=c++2a -fconcepts -O2 -DNDEBUG   11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries  Add new...  Add tool... 1 2 3 4 5 6 7 8 9 10 11 12 13 14 .LC2: .string "Average speed in mps is: %un" foo(double, double): divsd xmm0, xmm1 mov edi, OFFSET FLAT:.LC2 xor eax, eax mulsd xmm0, QWORD PTR .LC0[rip] divsd xmm0, QWORD PTR .LC1[rip] cvttsd2si esi, xmm0 jmp printf main: sub rsp, 8 mov esi, 20 mov edi, OFFSET FLAT:.LC2 ASM generation compiler returned: 0 Execution build compiler returned: 0 Program returned: 0 Average speed in mps is: 20   Wrap lines x86-64 gcc 9.2 Edit on Compiler Explorer 33
  • 61. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include <units/dimensions/velocity.h> using namespace units; template<Length L, Time T> constexpr Velocity avg_speed(L length, T time) { return length / time; } void foo(Length l, Time t) { auto speed = avg_speed(l, t); printf("Average speed in mps is: %un", quantity_cast<metre_per_second, int>(speed).count()); } int main() { using namespace units::literals; foo(144.km, 2.h); }  -std=c++2a -fconcepts -O2 -DNDEBUG   11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries  Add new...  Add tool... 1 2 3 4 5 6 7 8 9 10 11 .LC0: .string "Average speed in mps is: %un" main: sub rsp, 8 mov esi, 20 mov edi, OFFSET FLAT:.LC0 xor eax, eax call printf xor eax, eax add rsp, 8 ret ASM generation compiler returned: 0 Execution build compiler returned: 0 Program returned: 0 Average speed in mps is: 20   Wrap lines x86-64 gcc 9.2 Edit on Compiler Explorer 34
  • 62. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Compile time safety without sacri cing performance 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 #include <cstdio> int main() { printf("Average speed in mps is: %un", 20); }  -std=c++2a -fconcepts -O2 -DNDEBUG   11010  ./a.out  .LX0:  lib.f:  .text  //  s+  Intel  Demangle  Libraries  Add new...  Add tool... 1 2 3 4 5 6 7 8 9 10 11 .LC0: .string "Average speed in mps is: %un" main: sub rsp, 8 mov esi, 20 mov edi, OFFSET FLAT:.LC0 xor eax, eax call printf xor eax, eax add rsp, 8 ret ASM generation compiler returned: 0 Execution build compiler returned: 0 Program returned: 0 Average speed in mps is: 20   Wrap lines x86-64 gcc 9.2 Edit on Compiler Explorer 35
  • 63. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Omnipresence of compile-time usage 36
  • 64. constexpr auto d = 2019_y/September/21; static_assert(weekday{d} == Saturday); SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Omnipresence of compile-time usage DATE HANDLING 36
  • 65. constexpr auto d = 2019_y/September/21; static_assert(weekday{d} == Saturday); std::cout << "'SEC 2019' starts" << " on " << weekday{d} << " at " << d + 9h << "n"; SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Omnipresence of compile-time usage DATE HANDLING 36
  • 66. constexpr auto d = 2019_y/September/21; static_assert(weekday{d} == Saturday); std::cout << "'SEC 2019' starts" << " on " << weekday{d} << " at " << d + 9h << "n"; static_assert(d == September/21/2019); static_assert(d == 21_d/September/2019); static_assert(d == Saturday[3]/September/2019); SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Omnipresence of compile-time usage DATE HANDLING 36
  • 67. constexpr auto d = 2019_y/September/21; static_assert(weekday{d} == Saturday); std::cout << "'SEC 2019' starts" << " on " << weekday{d} << " at " << d + 9h << "n"; static_assert(d == September/21/2019); static_assert(d == 21_d/September/2019); static_assert(d == Saturday[3]/September/2019); // simple numeric operations static_assert(10km / 2 == 5km); // unit conversions static_assert(1h == 3600s); static_assert(1km + 1m == 1001m); // dimension conversions static_assert(1km / 1s == 1000mps); static_assert(2kmph * 2h == 4km); static_assert(2km / 2kmph == 1h); static_assert(1000 / 1s == 1kHz); static_assert(10km / 5km == 2); SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Omnipresence of compile-time usage DATE HANDLING UNITS AND DIMENSIONAL ANALYSIS 36
  • 68. constexpr auto d = 2019_y/September/21; static_assert(weekday{d} == Saturday); std::cout << "'SEC 2019' starts" << " on " << weekday{d} << " at " << d + 9h << "n"; static_assert(d == September/21/2019); static_assert(d == 21_d/September/2019); static_assert(d == Saturday[3]/September/2019); // simple numeric operations static_assert(10km / 2 == 5km); // unit conversions static_assert(1h == 3600s); static_assert(1km + 1m == 1001m); // dimension conversions static_assert(1km / 1s == 1000mps); static_assert(2kmph * 2h == 4km); static_assert(2km / 2kmph == 1h); static_assert(1000 / 1s == 1kHz); static_assert(10km / 5km == 2); SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Omnipresence of compile-time usage DATE HANDLING UNITS AND DIMENSIONAL ANALYSIS The fastest programs are those that do nothing 36
  • 69. Disconnected Connecting Connected connect / establish established timeout / establish ping [is_valid] / reset_timeout disconnect / close SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Finite State Machine (FSM) 37
  • 70. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: A classical approach 38
  • 71. class fsm { enum class state : char { disconnected, connecting, connected } state_; public: constexpr void on_event(const connect&) { if(state_ == state::disconnected) { establish(); state_ = state::connecting; } } constexpr void on_event(const disconnect&) { /* ... */ } constexpr void on_event(const established&) { /* ... */ } constexpr void on_event(const ping& event) { /* ... */ } constexpr void on_event(const timeout&) { /* ... */ } }; SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: A naive approach 39
  • 72. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: Alternative syntax 40
  • 73. struct connection { auto operator()() const { using namespace boost::sml; return make_transition_table( * "Disconnected"_s + event<connect> / establish = "Connecting"_s, "Connecting"_s + event<established> = "Connected"_s, "Connected"_s + event<ping> [ is_valid ] / reset_timeout, "Connected"_s + event<timeout> / establish = "Connecting"_s, "Connected"_s + event<disconnect> / close = "Disconnected"_s ); } }; SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: Domain Speci c Language 41
  • 74. struct connection { auto operator()() const { using namespace boost::sml; return make_transition_table( * "Disconnected"_s + event<connect> / establish = "Connecting"_s, "Connecting"_s + event<established> = "Connected"_s, "Connected"_s + event<ping> [ is_valid ] / reset_timeout, "Connected"_s + event<timeout> / establish = "Connecting"_s, "Connected"_s + event<disconnect> / close = "Disconnected"_s ); } }; SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: Domain Speci c Language Program that says WHAT rather than HOW is more likely to be correct 41
  • 75. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: A classical approach 42
  • 76. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: A naive approach 43
  • 77. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: Domain Speci c Language 44
  • 78. CLASSICAL NAIVE DSL HEAP USAGE Lots None None DYNAMIC POLYMORPHISM Yes No No INLINING No Yes Yes CPU CACHE FRIENDLY No Yes Yes ERROR PRONE Yes Yes No REUSE Moderate Hard Easy ASSEMBLY LINES 350 21 21 MEMORY FOOTPRINT High 1B 1B PERFORMANCE SLOW FAST FAST SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? FSM: Summary 45
  • 79. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The best language for Data Oriented Design (DOD) 46
  • 80. 1 Keep data that is not used together apart, on separate cache lines • avoids the invisible convoying of false sharing (ping-pong) SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The best language for Data Oriented Design (DOD) 46
  • 81. 1 Keep data that is not used together apart, on separate cache lines • avoids the invisible convoying of false sharing (ping-pong) 2 Keep data that is frequently used together close together • if a thread that uses A frequently also needs B, try to put them in one cache line SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The best language for Data Oriented Design (DOD) 46
  • 82. 1 Keep data that is not used together apart, on separate cache lines • avoids the invisible convoying of false sharing (ping-pong) 2 Keep data that is frequently used together close together • if a thread that uses A frequently also needs B, try to put them in one cache line 3 Keep “hot” and “cold” data that is not used with the same frequency apart • fit “hot” data in the fewest possible cache lines and memory pages • reduces the cache footprint and cache misses, the memory footprint, and virtual memory paging SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The best language for Data Oriented Design (DOD) 46
  • 83. 1 Keep data that is not used together apart, on separate cache lines • avoids the invisible convoying of false sharing (ping-pong) 2 Keep data that is frequently used together close together • if a thread that uses A frequently also needs B, try to put them in one cache line 3 Keep “hot” and “cold” data that is not used with the same frequency apart • fit “hot” data in the fewest possible cache lines and memory pages • reduces the cache footprint and cache misses, the memory footprint, and virtual memory paging SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The best language for Data Oriented Design (DOD) CPU instructions to execute is also data sitting in L1 cache 46
  • 84. Modern C++ is not the language we used to learn 20 years ago! SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 85. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 86. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance • constexpr to move execution of the code from run-time to compile-time SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 87. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance • constexpr to move execution of the code from run-time to compile-time • Deterministic destruction SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 88. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance • constexpr to move execution of the code from run-time to compile-time • Deterministic destruction • Better resource handling SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 89. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance • constexpr to move execution of the code from run-time to compile-time • Deterministic destruction • Better resource handling • Value semantics to improve performance and development experience SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 90. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance • constexpr to move execution of the code from run-time to compile-time • Deterministic destruction • Better resource handling • Value semantics to improve performance and development experience • Full control over concurrency and parallelism (task-based, parallel, vectorized, lock-free, ...) SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 91. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance • constexpr to move execution of the code from run-time to compile-time • Deterministic destruction • Better resource handling • Value semantics to improve performance and development experience • Full control over concurrency and parallelism (task-based, parallel, vectorized, lock-free, ...) • Many productivity-related improvements (i.e. lambdas, range-for loops, auto, variadic templates, ...) SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 92. Modern C++ is not the language we used to learn 20 years ago! • Move Semantics to e iciently handle resources and improve performance • constexpr to move execution of the code from run-time to compile-time • Deterministic destruction • Better resource handling • Value semantics to improve performance and development experience • Full control over concurrency and parallelism (task-based, parallel, vectorized, lock-free, ...) • Many productivity-related improvements (i.e. lambdas, range-for loops, auto, variadic templates, ...) • Lots of new toys in the C++ Standard Library SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Modern C++ 47
  • 93. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer 48
  • 94. • Concepts to provide even better compile-time safety SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer 48
  • 95. • Concepts to provide even better compile-time safety • Coroutines to enhance asynchronous operations SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer 48
  • 96. • Concepts to provide even better compile-time safety • Coroutines to enhance asynchronous operations • Ranges to build better algorithms with higher level abstractions SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer 48
  • 97. • Concepts to provide even better compile-time safety • Coroutines to enhance asynchronous operations • Ranges to build better algorithms with higher level abstractions • Modules to fix C build system and improve large-scale architecture SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer 48
  • 98. • Concepts to provide even better compile-time safety • Coroutines to enhance asynchronous operations • Ranges to build better algorithms with higher level abstractions • Modules to fix C build system and improve large-scale architecture • <=> to simplify implementation of value types SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer 48
  • 99. • Concepts to provide even better compile-time safety • Coroutines to enhance asynchronous operations • Ranges to build better algorithms with higher level abstractions • Modules to fix C build system and improve large-scale architecture • <=> to simplify implementation of value types • New tools in the C++ Standard Library SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer 48
  • 100. • Concepts to provide even better compile-time safety • Coroutines to enhance asynchronous operations • Ranges to build better algorithms with higher level abstractions • Modules to fix C build system and improve large-scale architecture • <=> to simplify implementation of value types • New tools in the C++ Standard Library SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++20 is going to be a game-changer EPAM is an active participant of the C++ standardization process and contributed some performance-related features to C++20 :-) 48
  • 101. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ ON THE MARKET 49
  • 102. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Tiobe Index: August 2019 50
  • 103. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? IEEE Spectrum: The 2018 Top Programming Languages 51
  • 104. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? IEEE Spectrum: The 2018 Top Programming Languages WEB MOBILE ENTERPRISE EMBEDDED 52
  • 105. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Top 10 GitHub languages (# of pushes) 53
  • 106. https://blog.jetbrains.com/clion/2015/07/infographics-cpp-facts-before-clion SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Facts about C++ 54
  • 107. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Facts about C++ 55
  • 108. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Facts about C++ 55
  • 109. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Facts about C++ 56
  • 110. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Facts about C++ 56
  • 111. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The Modern IT world is built on C++ 57
  • 112. • Low-Level – Operating systems and drivers – Embedded devices (from tiny to huge scale) – Autonomous cars SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The Modern IT world is built on C++ 57
  • 113. • Low-Level – Operating systems and drivers – Embedded devices (from tiny to huge scale) – Autonomous cars • High performance libraries – Scientific (NASA, CERN, ...) – Hardware accelerated calculations – AI, machine learning – Image recognition and mapping – Graphics – Maps and navigation – All kinds of frameworks (Electron, ...) SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The Modern IT world is built on C++ 57
  • 114. • Low-Level – Operating systems and drivers – Embedded devices (from tiny to huge scale) – Autonomous cars • High performance libraries – Scientific (NASA, CERN, ...) – Hardware accelerated calculations – AI, machine learning – Image recognition and mapping – Graphics – Maps and navigation – All kinds of frameworks (Electron, ...) • High performance servers – Stock Exchanges – High Frequency Trading – Data centers (Google, Facebook, Amazon, ...) – Databases (MySQL, ...) – Telecom SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The Modern IT world is built on C++ 57
  • 115. • Low-Level – Operating systems and drivers – Embedded devices (from tiny to huge scale) – Autonomous cars • High performance libraries – Scientific (NASA, CERN, ...) – Hardware accelerated calculations – AI, machine learning – Image recognition and mapping – Graphics – Maps and navigation – All kinds of frameworks (Electron, ...) • High performance servers – Stock Exchanges – High Frequency Trading – Data centers (Google, Facebook, Amazon, ...) – Databases (MySQL, ...) – Telecom • End-user applications – Games – Powerful modeling and simulation so ware (Adobe, Maya, Autodesk, Pixar, ...) – Compilers SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? The Modern IT world is built on C++ 57
  • 116. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Windows 58
  • 117. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? 3D Computer Animation 59
  • 118. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Movies 60
  • 119. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Raster graphics editors 61
  • 120. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Light Projections 62
  • 121. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? Games 63
  • 122. SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ is the most e cient programming language in the world 64
  • 123. 1 Learn Modern C++ and stay current with a fast evolving language • follow and learn C++ releases • follow C++ conferences and blogs • hire C++ trainers SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ is the most e cient programming language in the world 64
  • 124. 1 Learn Modern C++ and stay current with a fast evolving language • follow and learn C++ releases • follow C++ conferences and blogs • hire C++ trainers 2 Use C++ in your projects to • decrease money expenditure on computational resources • boost performance • limit jitter (improve response time) • limit power usage • limit memory footprint • have more control over hardware SEC 2019 | Free lunch is over: Why C++ is so important in the modern world? C++ is the most e cient programming language in the world 64