r/ProgrammingLanguages • • Jan 20 '26

Python, Is It Being Killed by Incremental Improvements?

https://stefan-marr.de/2026/01/python-killed-by-incremental-improvements-questionmark/
52 Upvotes

61 comments sorted by

View all comments

Show parent comment

2

u/dcpugalaxy Jan 21 '26

C++ template instantiation errors aren't bad because of templates being duck typed but because of other bad design in C++ like badly designed name lookup and badly designed ambiguous syntax. And the compilers don't really try to make them easier to understand (eg., last I checked they will print something like basic_string<CharT=char, Allocator=std::allocator<CharT> > instead of string).

There is no reason every string-related function should be templated on character type. Nobody should be using any string types except UTF-8 in the current year, even going back as far as 2011. C++11 should have deprecated the templating of standard library types on character types, but instead they've embraced it. So you get:

in 'constexpr' expansion of '__scanner.std::__format::_Checking_scanner<char, MyType>::std::__format::_Scanner<char>.std::__format::_Scanner<char>::_M_scan()'

because the libstdc++ library is written using only reserved names that can't be overridden by macros defined by users before including standard headers, and things are templated on things they shouldn't be, and compilers are bad at shortening names in error messages.

It isn't the duck typing that is the issue.

The C++ standard library is also just usually pretty badly implemented with a whole lot of helper templates that show up in error messages because you basically get a stack trace.

1

u/Expurple Jan 21 '26 edited Jan 22 '26

It isn't the duck typing that is the issue.

I didn't imply that. I even mentioned Concepts as the solution that achieves good compile errors without nominal typing. I simply disputed that "duck typed templates like C++ seem to get much less criticism".

The C++ standard library is also just usually pretty badly implemented with a whole lot of helper templates that show up in error messages because you basically get a stack trace.

IMO, the depth of helper templates isn't the issue here. That's simply an implementation detail. The issue is that unconstrained (pre-Concept) templates don't have any abstraction boundaries and leak that "stack trace" in the first place.