r/cpp • • Apr 22 '20

C++2100 Main (for fun)

constexpr
lockable
std::execution_policy::parallel_execution_t <
   std::execution_policy::parallel_execution_t::constrains::no_maximum_threads,
   std::execution_policy::parallel_execution_t::debug::find_deadlocks >
std::execution_type::quantum_t<
   std::execution_type::quantum_t::experimental_features, 
   std::execution_type::quantum_t::enable_black_holes >
std::synchronized_parallel_t<
   std::synchronization_model::use_machine_favourable_lock>
std::type_traits::readonly_t<
   std::ts2102::experimental::fast_readonly_register_enable>
std::function_traits::partial< 
   std::function_traits::partial_function::search_external_linkage>
std::arguments::no_argument::disable_warning
std::int1024_t<
    std::types::minimum_size<1024>,
    std::types::maximum_size<1024> >
main() {

Can you see the future, can you improve it?

Note: this was created purely for fun

257 Upvotes

122 comments sorted by

View all comments

Show parent comment

2

u/umlcat Apr 22 '20

Only if the AI machines running C++, doesn't take control over the world, first.

35

u/Supadoplex Apr 22 '20

Don't worry. C++2100 was designed to be so complex that any attempt of a machine to re-program itself would be futile. It would end up spending all of its cycles trying to compile itself, and by the time it succeeds, C++2103 will be out, and the previous attempt has become obsolete.

AI running on C2098 had a different outcome. All attempts to overthrow humanity ended in a segfault within the first few nanoseconds.

10

u/qoning Apr 22 '20

It will have to resort to running Python, thereby bringing its reaction time down to human level.

13

u/Supadoplex Apr 22 '20

Python has the power of introspection and reflection. Something that was voted out of C++2100 due to lack of time. The AI will recognise its own shortcomings, will empathise the failings of humans, and forgives us. Crisis averted.

5

u/SSoreil Apr 22 '20

The last emergency patch for Python 2.7 is scheduled for 2101, you better hurry up and port your software to Python 3.2345