The document discusses C++ and its evolution over time. Some key points include:
- C++ has been active for over 30 years and remains relevant due to its performance and use in applications like mobile.
- The new C++11 standard adds many new features that make the language more powerful yet easier to use, such as rvalue references, lambdas, and type inference.
- Examples are provided showing how new C++11 features like futures, lambdas and static assertions can be used concisely to solve common programming problems in a more modern style.
Gor Nishanov, C++ Coroutines – a negative overhead abstractionSergey Platonov
C++ coroutines are one of the few major features that may land in C++17. We will look at the current standardization status, available experimental implementations and develop a small coroutine adapter over raw C networking APIs that will beat hand-crafted state machine in performance.
Brief overview of the Rust system programming language. Provides a concise introduction of its basic features, with an emphasis on its memory safety features (ownership, moves, borrowing) and programming style with generic functions, structures, and traits.
Gor Nishanov, C++ Coroutines – a negative overhead abstractionSergey Platonov
C++ coroutines are one of the few major features that may land in C++17. We will look at the current standardization status, available experimental implementations and develop a small coroutine adapter over raw C networking APIs that will beat hand-crafted state machine in performance.
Brief overview of the Rust system programming language. Provides a concise introduction of its basic features, with an emphasis on its memory safety features (ownership, moves, borrowing) and programming style with generic functions, structures, and traits.
This presentation was held at the Stockholm Rust Meetup in September 2019.
This is a brief introduction to Rust and highlights some of the problems with C++ that it attempts to solve. It also contain a brief introduction to the ownership model and the borrow checker that Rust uses.
An introduction to Rust: the modern programming language to develop safe and ...Claudio Capobianco
Rust is a young programming language developed by Mozilla with the open source community support. According to a survey of StackOverflow, in 2016 was the most loved among developers language! The goal of Rust is to combine control and performances, that is, operate at low level with high-level constructs. The actual applications vary from operating system to web development. Rust natively includes tools for Agile development, such as dependency management, testing and much more. The gap with other popular languages is filling up quickly thanks to the community, very active and fantastic :)
In this introductory presentation we will discuss the characteristics that make Rust unique, including the concepts of Ownership, Borrowing, and Lifetimes.
These slide has be presented for a talk in BIC Lazio Casilina, that has been also the first meetup of Rust Rome!
Asynchronous single page applications without a line of HTML or Javascript, o...Robert Schadek
AngularJS, together with Node.js, is an extremely powerful combination for building single page applications. Unfortunately, its development requires writing HTML and Javascript, which is tedious and error prone. By using vibe.d, HTML is no longer necessary, and the developers can use the full power of a static-typed language for the development of the backend. Substituting Javascript with Typescript in addition to a little bit of CTFE D magic then removes the need for redundant data type declarations, and makes everything statically typed. At the end of the talk, the attendee will have witnessed the creation of a statically typed, asynchronous single page application that required little extra typing than its dynamically typed equivalent. Additionally, the attendees will be motivated to explore the presented combination of frameworks as a viable desktop application UI framework.
StxNext Lightning Talks - Feb 12, 2016
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice when it comes to Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and on the other - keeping short compile times.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up an Android-kotlin project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin usage is presented and the language is compared to SCALA and SWIFT.
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
Video: https://www.youtube.com/watch?v=SfrEThI_m7g
Source code: https://github.com/Alotor/2015-greach-groovy-dsls
Behind each good Groovy library or framework there is a good DSL (Domain Specific Language). And this is not by chance, one of the most exciting features of Groovy is its amazing syntax flexibility and metaprogramming capabilities that allow us do things in a highly expressive manner through DSLs.
In this talk I’ll explain the basics of doing DLS’s with Groovy. What you’ll need to start and what to investigate deeper. Also, we’ll check some of the most well known ones libraries like Spock, Gradle or Grails so you can use their techniques in your own Groovy projects.
HexRaysCodeXplorer: make object-oriented RE easierAlex Matrosov
HexRaysCodeXplorer - Hex-Rays Decompiler plugin for easier code navigation. Here are the main features of the plugin:
- Automatic type REconstruction for C++ objects.
- C-tree graph visualization – a special tree-like structure representing a decompiled routine in c_itemt terms. Useful feature for understanding how the decompiler works.
- Navigation through virtual function calls in HexRays Pseudocode window.
- Object Explorer – useful interface for navigation through virtual tables (VTBL) structures.
In this presentation authors of HexRaysCodeXplorer will be discussing main functionality of the plugin and its application for reverse engineering. The authors will be presenting the algorithm for C++ type REconstruction. Also a special version of HexRaysCodeXplorer (ZeroNigths edition) will be released with new features developed specially for ZeroNights conference. New features will be committed GitHub from the stage
HexRaysCodeXplorer: object oriented RE for fun and profitAlex Matrosov
HexRaysCodeXplorer - Hex-Rays Decompiler plugin for easier code navigation. Here are the main features of the plugin:
- Automatic type REconstruction for C++ objects.
- C-tree graph visualization - a special tree-like structure representing a decompiled routine in c_itemt terms. Useful feature for understanding how the decompiler works.
- Navigation through virtual function calls in HexRays Pseudocode window.
- Object Explorer - useful interface for navigation through virtual tables (VTBL) structures.
In this presentation, the authors of HexRaysCodeXplorer will be discussing main functionality of the plugin and its application for reverse engineering. The authors will be presenting the algorithm for C++ type REconstruction. Also a special version of HexRaysCodeXplorer (H2HC edition) will be released with new features developed specially for H2Cconference. New features will be committed to GitHub from the stage.
C++11 Idioms @ Silicon Valley Code Camp 2012 Sumant Tambe
C++11 feels like a new language. Compared to its previous standards, C++11 packs more language features and libraries designed to make C++ programs easier to understand and faster. As the community is building up experience with the new features, new stylistic ways of using them are emerging. These styles (a.k.a. idioms) give the new language its unique flavor. This talk will present emerging idioms of using rvalue references -- a marquee feature of C++11 as many renowned experts call it. You will see how C++11 opens new possibilities to design class interfaces. Finally, you will learn some advanced use-cases of rvalue references which will likely make you feel something amiss in this flagship feature of C++11.
Le slide deck de l'Université que nous avons donnée avec Rémi Forax à Devoxx France 2019.
Comme promis, Java sort sa version majeure tous les 6 mois. Le train passe et amène son lot de nouveautés. Parmi elles, certaines sont sorties : une nouvelle syntaxe pour les clauses switch et l'instruction de byte code CONSTANT_DYNAMIC. D'autres sont en chantier, plus ou moins avancé : une nouvelle façon d'écrire des méthodes de façon condensée, un instanceof 'intelligent', des constantes évaluées au moment où elles sont utilisées. Les projets progressent. Loom, et son nouveau modèle de programmation concurrente que l'ont peut tester avec Jetty. Amber, qui introduit les data types et des nouvelles syntaxes. Valhalla, dont les value types donnent leurs premiers résultats. S'il est difficile de prévoir une date de sortie pour ces nouveautés, on sait en revanche qu'une fois prêtes elles sortiront en moins de 6 mois. De tout ceci nous parlerons donc au futur et en public, avec des démonstrations de code, des slides, du code, de la joie et de la bonne humeur !
This presentation was held at the Stockholm Rust Meetup in September 2019.
This is a brief introduction to Rust and highlights some of the problems with C++ that it attempts to solve. It also contain a brief introduction to the ownership model and the borrow checker that Rust uses.
An introduction to Rust: the modern programming language to develop safe and ...Claudio Capobianco
Rust is a young programming language developed by Mozilla with the open source community support. According to a survey of StackOverflow, in 2016 was the most loved among developers language! The goal of Rust is to combine control and performances, that is, operate at low level with high-level constructs. The actual applications vary from operating system to web development. Rust natively includes tools for Agile development, such as dependency management, testing and much more. The gap with other popular languages is filling up quickly thanks to the community, very active and fantastic :)
In this introductory presentation we will discuss the characteristics that make Rust unique, including the concepts of Ownership, Borrowing, and Lifetimes.
These slide has be presented for a talk in BIC Lazio Casilina, that has been also the first meetup of Rust Rome!
Asynchronous single page applications without a line of HTML or Javascript, o...Robert Schadek
AngularJS, together with Node.js, is an extremely powerful combination for building single page applications. Unfortunately, its development requires writing HTML and Javascript, which is tedious and error prone. By using vibe.d, HTML is no longer necessary, and the developers can use the full power of a static-typed language for the development of the backend. Substituting Javascript with Typescript in addition to a little bit of CTFE D magic then removes the need for redundant data type declarations, and makes everything statically typed. At the end of the talk, the attendee will have witnessed the creation of a statically typed, asynchronous single page application that required little extra typing than its dynamically typed equivalent. Additionally, the attendees will be motivated to explore the presented combination of frameworks as a viable desktop application UI framework.
StxNext Lightning Talks - Feb 12, 2016
Kotlin - one of the popular programming languages built on top of Java that runs on JVM. Thanks to JetBrains support and excellent IDE integration, it’s an ideal choice when it comes to Android development. 100% Java compatibility, interoperability and no runtime overhead is just the beginning of a long list of strengths. Kotlin is supposed to be a subset of SCALA, on one hand covering major advantages for developers and on the other - keeping short compile times.
This presentation is a Developer Starter - a set of hand-picked information allowing a person with no knowledge of Kotlin to start writing basic Android activities and set up an Android-kotlin project. It starts with language background, reasons for its creation and advantages. Then presents basic use cases, syntax, structures and patterns. Later on Kotlin is presented in Android context. Simple project structure, imports and Kotlin usage with Android SDK is explained. In the end cost of Kotlin usage is presented and the language is compared to SCALA and SWIFT.
JVM Mechanics: When Does the JVM JIT & Deoptimize?Doug Hawkins
HotSpot promises to do the "right" thing for us by identifying our hot code and compiling "just-in-time", but how does HotSpot make those decisions?
This presentation aims to detail how HotSpot makes those decisions and how it corrects its mistakes through a series of demos that you run yourself.
Video: https://www.youtube.com/watch?v=SfrEThI_m7g
Source code: https://github.com/Alotor/2015-greach-groovy-dsls
Behind each good Groovy library or framework there is a good DSL (Domain Specific Language). And this is not by chance, one of the most exciting features of Groovy is its amazing syntax flexibility and metaprogramming capabilities that allow us do things in a highly expressive manner through DSLs.
In this talk I’ll explain the basics of doing DLS’s with Groovy. What you’ll need to start and what to investigate deeper. Also, we’ll check some of the most well known ones libraries like Spock, Gradle or Grails so you can use their techniques in your own Groovy projects.
HexRaysCodeXplorer: make object-oriented RE easierAlex Matrosov
HexRaysCodeXplorer - Hex-Rays Decompiler plugin for easier code navigation. Here are the main features of the plugin:
- Automatic type REconstruction for C++ objects.
- C-tree graph visualization – a special tree-like structure representing a decompiled routine in c_itemt terms. Useful feature for understanding how the decompiler works.
- Navigation through virtual function calls in HexRays Pseudocode window.
- Object Explorer – useful interface for navigation through virtual tables (VTBL) structures.
In this presentation authors of HexRaysCodeXplorer will be discussing main functionality of the plugin and its application for reverse engineering. The authors will be presenting the algorithm for C++ type REconstruction. Also a special version of HexRaysCodeXplorer (ZeroNigths edition) will be released with new features developed specially for ZeroNights conference. New features will be committed GitHub from the stage
HexRaysCodeXplorer: object oriented RE for fun and profitAlex Matrosov
HexRaysCodeXplorer - Hex-Rays Decompiler plugin for easier code navigation. Here are the main features of the plugin:
- Automatic type REconstruction for C++ objects.
- C-tree graph visualization - a special tree-like structure representing a decompiled routine in c_itemt terms. Useful feature for understanding how the decompiler works.
- Navigation through virtual function calls in HexRays Pseudocode window.
- Object Explorer - useful interface for navigation through virtual tables (VTBL) structures.
In this presentation, the authors of HexRaysCodeXplorer will be discussing main functionality of the plugin and its application for reverse engineering. The authors will be presenting the algorithm for C++ type REconstruction. Also a special version of HexRaysCodeXplorer (H2HC edition) will be released with new features developed specially for H2Cconference. New features will be committed to GitHub from the stage.
C++11 Idioms @ Silicon Valley Code Camp 2012 Sumant Tambe
C++11 feels like a new language. Compared to its previous standards, C++11 packs more language features and libraries designed to make C++ programs easier to understand and faster. As the community is building up experience with the new features, new stylistic ways of using them are emerging. These styles (a.k.a. idioms) give the new language its unique flavor. This talk will present emerging idioms of using rvalue references -- a marquee feature of C++11 as many renowned experts call it. You will see how C++11 opens new possibilities to design class interfaces. Finally, you will learn some advanced use-cases of rvalue references which will likely make you feel something amiss in this flagship feature of C++11.
Le slide deck de l'Université que nous avons donnée avec Rémi Forax à Devoxx France 2019.
Comme promis, Java sort sa version majeure tous les 6 mois. Le train passe et amène son lot de nouveautés. Parmi elles, certaines sont sorties : une nouvelle syntaxe pour les clauses switch et l'instruction de byte code CONSTANT_DYNAMIC. D'autres sont en chantier, plus ou moins avancé : une nouvelle façon d'écrire des méthodes de façon condensée, un instanceof 'intelligent', des constantes évaluées au moment où elles sont utilisées. Les projets progressent. Loom, et son nouveau modèle de programmation concurrente que l'ont peut tester avec Jetty. Amber, qui introduit les data types et des nouvelles syntaxes. Valhalla, dont les value types donnent leurs premiers résultats. S'il est difficile de prévoir une date de sortie pour ces nouveautés, on sait en revanche qu'une fois prêtes elles sortiront en moins de 6 mois. De tout ceci nous parlerons donc au futur et en public, avec des démonstrations de code, des slides, du code, de la joie et de la bonne humeur !
Diagramas de flujo - Estructuras de Control (For, While, Do Whille y Switch C...Marcelo Vilela Pardo
Después de la anterior presentación, que ha sido una pequeña introducción, llegamos a este tipo de estructuras en los diagramas de flujo, que nos ayudarán a crear algoritmos más efectivos.
Ahora presentaré la parte teórica, es decir que veremos como funcionan estas estructuras, luego en otra presentación realizaremos los suficientes ejercicios.
Presentation with a brief history of C, C++ and their ancestors along with an introduction to latest version C++11 and futures such as C++17. The presentation covers applications that use C++, C++11 compilers such as LLVM/Clang, some of the new language features in C++11 and C++17 and examples of modern idioms such as the new form compressions, initializer lists, lambdas, compile time type identification, improved memory management and improved standard library (threads, math, random, chrono, etc). (less == more) || (more == more)
What's new with C++ since, oh, before the dot-com bubble? Learn more in this Lunch and Learn, with a refresher of C++ basics, C++/CLI for C# developers, and the new features of C++11/14 and possibly C++17.
2. About Me
• Software architect in Intel since December 2005
• Focused on software design and network security before
joining Intel
• ~28 years since writing my first program
– Programming is fun!
• A casual open-source contributor
– Several projects, but small contributions
– Mostly on multi-lingual support (esp. Chinese)
• A happy father of twins
7. However, C++ is very much
active, having been active for
~30 years.
8. Aims of C++
• C++ makes programming more enjoyable for
serious programmers.
• C++ is a general-purpose programming
language that
– is a better C
– supports data abstraction
– supports object-oriented programming
– supports generic programming
9. Some C++ Design Rules
• C++’s evolution must be driven by real problems.
• C++ must be useful now.
• Don’t try to force people to use a specific programming
style.
• It is more important to allow a useful feature than to
prevent every misuse.
• Provide as good support for user-defined types as for built-
in types.
• What you don’t use, you don’t pay for (zero overhead rule).
10. C++ is biased towards
systems programming, why
is it popular also in
applications programming?
11. Reason for C++ in Applications
• Performance of a specialized language
• Multiple categories in a complex application
• Language mix issue
• C++ library capabilities
12. Better C++ Support Coming
• C++11 standardization
• C++ native binding in Windows Runtime
• C++ support to mix with Objective-C
• Better C++ support in Android NDK
• C++11 coming to MSVC, GCC, and Clang
20. Example
• How short can you get in C++ to dispatch
work to a new thread and get the result in
the current thread?
• Probably shorter than you expected:
future<string> ft(async(...));
...
cout << ft.get();
21. Example
string flip(string s)
{
reverse(s.begin(), s.end());
return s;
}
int main()
{
vector<future<string>> v;
v.push_back(async([] { return flip( " ,olleH"); }));
v.push_back(async([] { return flip("n!letnI"); }));
for (auto& e : v) {
cout << e.get();
}
}
22. Example
string flip(string s)
{
reverse(s.begin(), s.end());
return s;
}
int main()
{
vector<future<string>> v;
v.push_back(async([] { return flip( " ,olleH"); }));
v.push_back(async([] { return flip("n!letnI"); }));
for (auto& e : v) {
cout << e.get();
}
}
23. Example
string flip(string s)
{
reverse(s.begin(), s.end());
return s;
}
int main()
{
vector<future<string>> v;
v.push_back(async([] { return flip( " ,olleH"); }));
v.push_back(async([] { return flip("n!letnI"); }));
for (auto& e : v) {
cout << e.get();
}
}
24. Example
string flip(string s)
{
reverse(s.begin(), s.end());
return s;
}
int main()
{
vector<future<string>> v;
v.push_back(async([] { return flip( " ,olleH"); }));
v.push_back(async([] { return flip("n!letnI"); }));
for (auto& e : v) {
cout << e.get();
}
}
25. Compiler Compatibility
• Visual Studio 2012
– Pass
• Clang 4.1 & libc++ (OS X)
– Pass
• Visual Studio 2010
– Range-based for and future are unsupported
• GCC 4.7.2; ICC 13.0.1 (on top of VS2010)
– future is unsupported
26. Incomplete List of C++11 Features
• Rvalue references and move semantics Performance
• Initializer lists
• Range-based for-loop
• Type inference (auto)
• Lambda functions and expressions Usability
• Explicit overrides and final
• Null pointer constant (nullptr)
• Right angle brackets
• Unicode characters and strings
• Multi-threading memory model Functionality
• Static assertions
• Smart pointers and other standard library improvements
• …
27. Rvalue References and Move Semantics
• Sorry, it might be too complex for a one-pager…
• Problem: copying objects (containers) can be expensive
• Key concepts: object lifecycle, temporary, lvalue, rvalue
• Key result: able to take away the object content in a
reasonable and consistent way, without surprises, via
– A new reference type (&&) and related rules
– Utilities to convert a type to rvalue reference type (like std::move)
– Move functions to move content to the new object and erase the
original
• Demo of destructor elimination
28. Initializer Lists
• C++98 allows code like this:
int array[] = { 1, 2, 3, 4 };
• C++11 now allows:
vector<int> v = { 1, 2, 3, 4 };
• And you can initialize your own container this way:
MyContainer::MyContainer(
std::initializer_list<Type> list)
{
...
}
29. Range-based for-loop
• Example:
for (int x : { 1, 1, 2, 3, 5 }) {
cout << x << endl;
}
• It implicitly calls begin() and end() on the
list/array/container.
30. Type Inference
• Instead of writing:
vector<boost::future<string> >
::iterator i = v.begin();
• One can now simply write:
auto i = v.begin();
31. Lambdas
• Convenient where functors can be used
– Say, for_each and transform
• Each lambda has a different type
– So auto is handy
– Class template std::function can be used to store
lambdas
• Example:
FILE* fp = fopen(...);
ON_SCOPE_EXIT([&]() { fclose(fp); });
...
32. Explicit Overrides and Final
• Example
struct Base {
virtual void some(float);
virtual void other();
};
struct Derived1 : Base {
virtual void some(int) override; // error
virtual void other() final;
};
struct Derived2 : Derived1 {
virtual void other(); // error
};
33. Null Pointer Constant
• The definition of NULL causes surprises for:
void foo(char*);
void foo(int);
...
foo(NULL);
• Now foo(nullptr) correctly calls
foo(char*).
34. Right Angle Brackets
• C++98 requires an extra space here:
vector<list<string> > sv;
• C++11 allows people to write:
vector<list<string>> sv;
36. Multi-Threading Memory Model
• Another complex topic
• Memory model is defined
• Standard library facilities:
– Mutexes, conditional variables, RAII locks
– Futures and promises (first example)
– Atomic operations
37. Static Assertions
• Example:
template<class T>
struct Check {
static_assert(sizeof(int) <= sizeof(T),
"T is not big enough!");
};
void DoSomething(...)
{
static_assert(sizeof(void*) == 4,
"Supports only 32-bit platforms");
...
}
39. Summary
• Mobile and cloud make C++ relevant again.
• The new C++11 standard makes C++ a more
powerful but easier-to-use language.
– Definitely worth adopting
– Especially for application developers
• Today is just an introduction.
40. References
• ISO/IEC JTC 1/SC22: N3337 – Draft C++ Standard (very close to C++11)
• Bjarne Stroustrup: Evolving a language in and for the real world: C++ 1991-2006
• Bjarne Stroustrup: An Overview of the C++ Programming Language
• Scott Meyers: Summary of C++11 Feature Availability in gcc and MSVC
• Wikipedia: C++11
• 刘未鹏: C++11 (及现代C++风格)和快速迭代式开发
• Stephan T. Lavavej: Lambdas, auto, and static_assert: C++0x Features in VC10, Part 1
• Stephan T. Lavavej: Rvalue References: C++0x Features in VC10, Part 2
• Stephan T. Lavavej: decltype: C++0x Features in VC10, Part 3
• Thomas Becker: C++ Rvalue References Explained
• Herb Sutter: C++ and Beyond 2011: Herb Sutter - Why C++?
• Andrei Alexandrescu, Scott Meyers, Herb Sutter: On Static If, C++11 in 2012, Modern
Libraries, and Metaprogramming
• Nicolai M. Josuttis: The C++ Standard Library: A Tutorial and Reference (2nd Edition).
Addison-Wesley, 2012
44. Use Boost with MSVC
• Most of Boost can be used without building
• One needs to add the include path BOOST
– For IDE: Tools > Options > Projects > VC++ Directories > Include files
– For command line: the environment variable INCLUDE
• Some components need building, like the unit test
framework
b2 toolset=msvc-10.0 --with-test debug link=static runtime-
link=static stage
b2 toolset=msvc-10.0 --with-chrono --with-date_time --with-
system --with-thread debug release link=static runtime-
link=static stage
• One then needs to add the library path BOOSTstagelib
– For IDE: Tools > Options > Projects > VC++ Directories > Library files
– For command line: the environment variable LIB
Editor's Notes
Apart from C++, let people notice Objective-C,PHP, Python, Perl, and Ruby.
According to Bjarne…
Objective-C++: 2002Android support for C++ exceptions: NDK 5 (2010); shared C++ runtime w/ exceptions: NDK 7 (2011)
Many features rely on standard libraries too.The standard library definition is about 70% of the normative text of the standard…