Differentiable Simulations

Есть такой канал, который я иногда посматриваю, в те минуты, когда мне кажется, что я воспринимаю любой английский.

Канал называется «Two Minute Papers». В каком-то месте, можно сказать, одного с нашей читальней поля ягоды. Но при этом обычно, кроме разбора статьи, есть самые сочные видео-фрагменты, эту статью иллюстрирующие.

В этот раз меня за корытцем йогурта умилила следующее видео:

Differentiable Rendering

Приятного просмотра, можно заменить йогурт сметаной!

Let Necromancy begin!

Эх, давненько мы тут не бузили!

Тут недавно кое-что искал и офигел, сколько добра у нас тут скопилось в избе-читальне, прям жаль, что покрывается пылью!

Может, зазвать свежей кровушки и воскресить?

Акцио!

cppcon 2019 (1)

В прошлом году я ничего не писал о CPPCON пока не посмотрел все лекции.
В этом году я не стану дожидаться ишачей пасхи, а буду выкладывать ссылки Just-in-Time.

https://youtu.be/ejF6qqohp3M — Sean Parent “Relationships” (in code)
Эта русская гардеробщица с постным лицом божественна. Не знаю, где ее отыскал Шон, но я постарался и тоже нарыл: https://s.ukropen.net/groups/00001/2045/photos/141b964fbabe7cf2fcfa.jpg
гардеробщица

https://youtu.be/FJJTYQYB1JQ — Andrei Alexandrescu “Performance”
С шуточками и прибауточками улучшает сортировку а потом исподволь топит за design by introspection.

CPPCON 2018

В этом году трудовыебудни меня совсем утомили, а количество лекций превысило все разумные пределы.
Сверху lightning talks — пятиминутки, потом top-12 полнометражек.
За ними все остальное в порядке интереса (субъективно, фигли).

P.S. 😦 ДО cppcon 2019 всего два месяца, а мне еще ACCU смотреть местами.

Interesting lightning talks:

TOP-12 must haves

Herb Sutter “Thoughts on a more powerful and simpler C++ (5 of N)”
https://youtu.be/80BZxujhY38
Warnings for danglings, metaclasses.

Hana Dusíková “Compile Time Regular Expressions”
https://youtu.be/QM3W36COnE4
Regex that are not only compile-time, but also faster to compile and run than std::regex

Louis Dionne “Compile-time programming and reflection in C++20 and beyond
https://youtu.be/CRDNPwXDVp0
Constexpr everything: try/catch, allocations, virtual calls — at compile time. Compile time reflection. Code injection (see Sutter)

Erik Valkering “Smart References: There and Back Again
https://youtu.be/bfm9m3xJQRY
This library has it all — smart references, mixins, proxies for std containers, universal call syntax…

G. Nishanov “Nano-coroutines to the Rescue!
https://youtu.be/j9tlJAqMV7U
How co-routines can solve latency bottlenecked problems (e.g. prefetch).

R. Leahy “The Networking TS: Testable, Composable Asynchronous I/O in C++
https://youtu.be/hdRpCo94_C4
Good showcasing of the networking TS, and how it drives you to do the right thing. Also, spectacular presentation skills!

Easy::Jit: A Just-in-Time compilation library for C++
https://youtu.be/_WPdof1dTqo
(re)running compilation at runtime for your functions as easy as std::bind-ing them

Interactive C++ Compilation (REPL) Done in a Tiny and Embeddable Way
https://youtu.be/UEuA0yuw_O0
Yes, both embeddable and interactive should be the mainstream. This is another “better than nothing” attempt.

Custom Overload Sets and Inline SFINAE for Truly Generic Interfaces
https://youtu.be/WBTNCYT20f0
Great machinery for simpler overload sets (pattern matching -ish?) Always wanted to multiple inherit from the anonymous classes behind lambdas!

Olivier Giroux “High-Radix Concurrent C++”
https://youtu.be/75LcDvlEIYw
Fun with new cuda (volta, turing) — can build tries!

Jean-Louis Leroy “Open is Good – yomm2: Fast, Orthogonal Open Methods”
https://youtu.be/xkxo0lah51s
Describes open methods — alternative to runtime polymorphism via virtual methods. No need for visitor pattern or clumsy multi-methods.

Andrei Alexandrescu “Expect the expected”
https://youtu.be/PH4WBuE1BHI
Always a pleasure to watch, even if it is a recycled talk. About std::expected
We’d really like “monadic continuation” here in the future.
Bonus: https://www.youtube.com/watch?v=os7cqJ5qlzo Sutter’s proposal from ACCU http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0709r0.pdf

More good talks

Matt Godbolt “The Bits Between the Bits: How We Get to main()”
https://youtu.be/dOfucXtyEsU
Some must-knows around code generation and linking

Nir Friedman “Understanding Optimizers: Helping the Compiler Help You”
https://youtu.be/8nyq8SNUTSc
Some observations and a couple useful patterns for aiding optimization.

Robert Ramey “Safe Numerics”
https://youtu.be/93Cjg42bGEw
Compile time/Runtime safe integer arithmetic

Arno Schoedl “Range-Based Text Formatting For a Future Range-Based Standard Library”
https://www.youtube.com/watch?v=uCybqSX1idU
Good observations on iterating, ranges, containers. Alternative ranges lib.

Arno Lepisk “Avoiding Disasters with Strongly Typed C++”
https://youtu.be/xTdeZ4MxbKo
https://youtu.be/1fwbG5TyI18
How would you use strong typedefs and units

Titus Winters “Modern C++ Design
https://youtu.be/tn7oVNrPM8I
Guidelines for using (modern) C++, another call for regular(ish) types.

Arthur O’Dwyer “Concepts As She Is Spoke”
https://youtu.be/CXn02MPkn8Y
Yet another talk about concepts with non-binding promises.

Walter E. Brown “C++ Function Templates: How Do They Really Work?”
https://youtu.be/NIDEjY5ywqU
Covering function templates with single template parameter. Thoroughly.

Simon Brand “How to Write Well-Behaved Value Wrappers”
https://youtu.be/J4A2B9eexiw
Class design (esp. templated) is more or less broken from c++11 to c++20.

Jason Turner “Applied Best Practices”
https://youtu.be/DHOlsEd0eDE
Jason Turner is eating his own dogfood trying to apply the things he teaches in his project. constexpr everything 😉

What do you mean “thread-safe”?
https://youtu.be/s5PCh_FaMfM
Surprisingly coherent discussion of flavors of thread-safety. Just 30 minutes.

Jon Cohen “Ensuring Exception Safety Through Testing”
https://youtu.be/XPzHNSUnTc4
Testing for exception safety (not for exception throwing). In abseil, soon in googletest.

Bob Steagall “Fast Conversion From UTF-8 with C++, DFAs, and SSE Intrinsics”
https://youtu.be/5FQ87-Ecb-A
^ see title.

Fabian Renn-Giles “A Semi Compile/Run-time Map with (Nearly) Zero Overhead Lookup”
https://youtu.be/qNAbGpV1ZkU
Useful in some domains (e.g., embedded) if all/most keys are known at compile time.

Frozen data structures in C++14
https://youtu.be/vA5sdxbwUG8
Compile time maps/sets

Richard Powell “Named Arguments from Scratch”
https://youtu.be/Grveezn0zhU
Live demo showing how to implement something useful (named args) with meta-programming and boost::Hana

Steven Simpson “Source Instrumentation for Monitoring C++ in Production”
https://youtu.be/0WgC5jnrRx8
motivational — adding metrics to code

Titus Winters “Standard Library Compatibility Guidelines (SD-8)”
https://youtu.be/BWvSSsKCiAw
Tips on writing code, s.t., the next language standard doesn’t break you.
If you don’t like Titus (why would you not?) just read https://isocpp.org/std/standing-documents/sd-8-standard-library-compatibility

Phil Nash “Modern C++ Testing with Catch2”
https://youtu.be/Ob5_XZrFQH0
Testing framework, arguably more fun to use than gtest.

Alastair Rankine “Tools and Techniques for Testing Callbacks Using Standard C++”
https://youtu.be/9aGI5k8DmT8
Testing/mocking via std::function and lambdas

Chandler Carruth “Spectre: Secrets, Side-Channels, Sandboxes, and Security”
https://youtu.be/_f7O3IfIR2k
Security issues in a post-spectre world

Datum: A Compact Bitwise Copyable Variant Type
https://youtu.be/YdzbrFerlRY
This abomination could be only created in Bloomberg. Mildly useful compact variant (hides types insided NAN of a double).

Jason Turner “Surprises in Object Lifetime”
https://youtu.be/uQyT-5iWUow
How you may end up with a dangling object.

Kostya Serebryany “Memory Tagging and how it improves C/C++ memory safety”
https://youtu.be/lLEcbXidK2o
Memory tagging as an alternative to address sanitizer. If only Intel and AMD supported in hardware.

Peter Sommerlad “Woes of Scope Guards and Unique_Resource
https://youtu.be/O1sK__G5Nrg
how to fail writing a generic scope guard for years

C++ Dependency Management: from Package Consumption to Project Development
https://youtu.be/Nni2Qu2WitY
Unlike his other talk this one is of some interest — presents build2 system for build/deploy

Stephan T. Lavavej “Class Template Argument Deduction for Everyone”
https://youtu.be/-H-ut6j1BYU
STL talks about class template deduction. Not really for everyone, mostly for library writers.

Timur Doumler “Class template argument deduction in C++17”
https://youtu.be/UDs90b0yjjQ
Another talk on CTAD. 25% on how to do it. 75% on how to make it do the right thing or disable it.


“What Could Possibly Go Wrong?: A Tale of Expectations and Exceptions”
https://youtu.be/GC4cp4U2f2E
Again about getting exceptions closer to error codes, optionals, variants, std::expected. With a twist by Herb Sutter.

Less interesting stuff here. Cherry pick, or ask me for details

“DynaMix: A New Take on Polymorphism”
https://youtu.be/ckY7Pc-A9Xc
Runtime mixins for C++. Nothing interesting before 20:00

“Why and How to Roll Your Own std::function Implementation”
https://youtu.be/VY83afAJUIg
Been there, done that.

Greg Law “Debugging Linux C++”
https://youtu.be/V1t6faOKjuQ
A few tips for better debugging (gdb, valgrind, sanitizers, p/f/s-trace) in linux

Simon Brand “How C++ Debuggers Work”
https://youtu.be/0DDrseUomfU
Well presented, but only if you really want to know how debuggers (lldb) work (on linux).

Patrice Roy “Pessimistic Programming”
https://youtu.be/pnSvUbE1HHk
What to do when the non-happy path needs to be as fast or as predictable as happy path. Also bonus slides on data-invariant algs.

JeanHeyd Meneide “Scripting at the Speed of Thought: Lua and C++ with sol3”
https://youtu.be/xQAmGBfKnas
Nice and modern library for integrating with Lua. If you need it.

Adi Shavit “The Salami Method for Cross Platform Development”
https://youtu.be/ZSpGNiUvXVI
A demonstration of a technique for providing cross platform/language wrappers for your C++ code. Similar to what we call here “the hourglass”.

Ilya Biryukov “Clangd: architecture of a scalable C++ language server”
https://youtu.be/5HIyAXj1YNQ
Language server for C++, enables code completion for any editor supporting the protocol (vi, emacs, vscode, atom…) Tried it, nice!

Arthur O’Dwyer “Return Value Optimization: Harder Than It Looks”
https://youtu.be/hA1WNtNyNbo
Can we trust compiler to do copy ellision? To do implicit move? More important, can we trust ourselves to know it without testing?


Boris Kolpackov “What to Expect from a Next-Generation C++ Build System”
https://www.youtube.com/watch?v=cJP7SSLjvSI
Not too convincing breakdown of things we need for next-gen c++ build system

Damien Buhl “C++ Everywhere with WebAssembly”
https://youtu.be/QPJPS-Jjb-g
Interesting usages of c++ -> webasm. More cool than useful at times.

Michael Gopshtein “CUDA Kernels with C++”
https://youtu.be/HIJTRrm9nzY
How to C++ Cuda

Simon Brand “Overloading: The Bane of All Higher-Order Functions”
https://youtu.be/L_QKlAx31Pw
Rant about the mess around passing functionals (of all sorts) as parameters succinctly and reasonably.

Ben Deane “Easy to Use, Hard to Misuse: Declarative Style in C++”
https://youtu.be/I52uPJSoAT4
Will teach you how to get rid of: loops, ifs, statements

Funqual: user-defined statically-checked call graph constraints in C++
https://youtu.be/oOZN6GqfdTs
Allows tagging categories of functions and verifying direct/indirect calls. A bit like aspects on call graph.

“Multi-Precision Arithmetic for Cryptology in C++, at Run-Time and at Compile-Time”
https://youtu.be/G33yF26UGMo
yet another big-int (modulo Q) tailored to crypto, with proven const time operations

UEFI Applications With Modern C++
https://youtu.be/z6wKEJ-daD4
Generic wrappers for C uefi API (mainly)


Kris Jusiak “State Machines Battlefield – Naive vs STL vs Boost”
https://youtu.be/yZVby-PuXM0
Comparing different approaches and libraries to (declarative) state machines writing.

Effective replacement of dynamic polymorphism with std::variant
https://youtu.be/gKbORJtnVu8
Talks about replacing virtual-methods based dynamic polymorphism with visiting a variant. But only gives an example of state machine.

CppCon 2018: Mark Elendt “Patterns and Techniques Used in the Houdini 3D Graphics Application ”
https://youtu.be/2YXwg0n9e7E?t=2203
Nothing really until 36:43. A couple of mildly interesting patterns for high perf.

Victor Ciura “Regular Types and Why Do I Care ?”
https://youtu.be/h60zqdzIelE
Stepanov’s legacy. Regular types, comparators, equivalence…

Serge Guelton “C++ in Elvenland”
https://youtu.be/CVg7CYVV3KI
elf binary format and how to get useful info from it

Meson Build System”
https://youtu.be/SCZLnopmYBM
Friendly build system. If you ask “why would we need another one”, see his other talk.

Build Systems: a Simple Solution to a Complicated Problem
https://youtu.be/mWOmkwv8N_U
Look ma, another build system (evoke)


Robert Schumacher “Don’t package your libraries, write packagable libraries!”
https://youtu.be/sBP17HQAQjk
title ^

Timur Doumler & Dmitry Kozhevnikov “Parsing C++”
https://youtu.be/WfIr7lKT4Sk
Another Jet Brains talk about how hard it is to parse C++

Greg Falcon “Initialization, Shutdown, and constexpr”
https://youtu.be/6ZOygaUjzjQ
Another foot-shooting discussion of initialization in (modern) C++

Nicolai Josuttis “The Nightmare of Initialization in C++”
https://youtu.be/7DTlWPgX6zs
A thorough rant about uniform and not so uniform init, initializer lists, almost-always-auto

Stephen Dewhurst “Talking to Typelists”
https://youtu.be/oK7hdBoxRcs
Remember how fun it was back in 2003 to play with lists of types, following Alexandrescu? Rethinking algorithms on types.

Andrew Sutton Concepts in 60
https://youtu.be/ZeU6OPaGxwM
A mediocre presentation of concepts from someone that should have know better.


Kate Gregory “Simplicity: Not Just For Beginners”
https://youtu.be/n0Ak6xtVXno
Philosophy of simplicity, uncle Bob style.
Kate Gregory “What Do We Mean When We Say Nothing At All?”
https://youtu.be/kYVxGyido9g

JF Bastien “Signed integers are two’s complement”
https://youtu.be/JhUxIVf1qok
A proposal to stop the madness and make proper definition for signed ints in C++ and C — http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2018/p0907r4.html

Sean Parent “Better Code: Human Interface”
https://youtu.be/0WlJEz2wb8Y
Not much about algorithms this time (does mention rotate a couple of time)

“The Landscape and Exciting New Future of Safe Reclamation for High Performance”
https://youtu.be/nvfzQAUpunI
RCU and hazard pointers, only if you care (knowledge of the subject required)

Save $$ Testing Code the Playback-Based Way
https://youtu.be/DcNYQ4qFpiI
Framework for instrumenting every call, storing arguments, swizzling pointers.
Too much boilerplate and inheriting from their base classes.

Ben Deane “Operator Overloading: History, Principles and Practice”
https://youtu.be/zh4EgO13Etg
Making the case for overloading operators and using user defined literals to create DSLs.

Odin Holmes “Concurrency Challenges of Interrupt Service Routines”
https://youtu.be/gcRdG7dGMOw
A useful discussion of interrupt related concurrency issues for embedded systems (mainly)

Andrei Zlate-Podani “Engineering Software: integral types”
https://youtu.be/YB18n52BUYM
“numbers” are historically broken in C and C++.


Dan Saks “Making New Friends”
https://youtu.be/POa_V15je8Y
A few shenanigans with using friends for binary operators in templated code.

Richard Powell “How to Argue(ment)”
https://youtu.be/ZbVCGCy3mGQ
How to pass stuff to functions.

Marshall Clow “Development strategies
https://youtu.be/bfWxNoyRrXs
Marshall with his biased perspective on writing and deploying libs. Test, test, and test.

Guy Davidson “Lightweight 2D graphics with io2d”
https://youtu.be/7Jk1a4cnukQ

Let’s Intercept OpenGL Function Calls
https://youtu.be/DMNFb5ycpNY
How to intercept/instrument calls a library (e.g., opengl) makes

Crafting EDSL In C++ using Metaprogramming, Operator Overloading, & Lambda Expressions
https://youtu.be/ijh3Tse5L8s
General pointers to create compile time edsl with operator overloading

“Emulating the Nintendo 3DS: Generative & Declarative Programming in Action”
https://youtu.be/67OCoOLVuK8
Not really about emulating Nintedo, just showing some techniques for declarative programming.

“Concepts and Contracts: When, What, and How”
https://youtu.be/Vj2vuoPJNfE
Not too detailed description of concepts and contracts (WIP)

OOP Is Dead, Long Live Data-oriented Design
https://youtu.be/yy8jQgmhbAU
Not too convincing case for using struct of arrays vs. array of structs.

Writing Standard Library Compliant Data Structures and Algorithms
https://youtu.be/fChDijocVec
Guidelines for making your algs/data structs more STL like

Frederic Tingaud “A Little Order: Delving into the STL sorting algorithms”
https://youtu.be/-0tO3Eni2uo
Some benchmarks comparing sort, partial_sort, nth_element etc.

Patricia Aas “Software Vulnerabilities in C and C++”
https://youtu.be/0S0QgQd75Sw
Classical vulnerabilities in our code. Too slow.

“Co- and Contra-: Adding a Little Variance”
https://youtu.be/nlxA7CWfy78
All this can fit in one slide: what can we do so that vector can be converted to vector

Fedor Pikus “Design for Performance”
https://youtu.be/m25p3EtBua4
Nothing too interesting, Shame, usually, Fedor has great talks.

Alan Talbot “Moving Faster: Everyday efficiency in modern C++”
https://youtu.be/EovBkh9wDnM
Many mildly useful truisms about performance

Michael Caisse “Modern C++ in Embedded Systems
https://youtu.be/LfRLQ7IChtg
Mostly interesting for people wanting to cross-compile C++ and test with Docker for embedded.

Early Modern C++: How to Handle a C++03 Codebase
https://youtu.be/76uHxUi6L5g
Trivial explanations on backporting modern C++ to 03

Using Compile-time Code Generation to build an LLVM IR Pattern Matcher
https://youtu.be/DUEkxJ9YxMY
Not too inspiring example of coding for llvm or of meta-programming.

Jon Cohen & Matt Kulukundis “Touring the Tips of the Week Series”
https://youtu.be/THDpfWG5T7Y
Googlers in togas talk about a couple of abseil tips of the week for 20 mins. Just read the tips instead.

Victor Ciura “These Aren’t the COM Objects You’re Looking For”
https://youtu.be/T_1zutIBHs0
Windows, COM, nobody cares

“Secure Coding Best Practices: Your First Line Is The Last Line Of Defense
https://youtu.be/i0m0FBD-McY
Boring and not too informative 2 parts on vulnerabilities

Я знаю карате, кунг-фу и много других страшных слов!

Написал прототип модульной системы на миксинах с использованием CRTP, притом для embedded.

Вообще, конечно, дивно, что на C++ можно писать полноценный миксиновый код:

System< with_log, with_mesh, with_mqtt > device;

Притом все фрагметры могут пользоваться “сервисами” предоставляемыми другими, т.е. mesh может пользоваться логом.

Времени на подобную эквилибристику, конечно, нет, но не душить же прекрасные порывы! В одном только месте чуть-чуть не хватило остроумия и небольшую корявость все-таки пришлось сделать, но я исправлюсь (или засуну глубоко в макросы).

P.s. Все вышеперечисленное есть следствие вредного влияния неназываемых личностей.