[Oberon] Modules in C++20
hklaver at dds.nl
Mon Oct 25 23:49:20 CEST 2021
Recently in a local bookstore I was browsing through (the Dutch translation of) a book by Bjarne Stroustrup, 'A Tour of C++'. Somewhat surprised I read that C++20 has (or will have) modules à la Wirth (complete with import and export) as a better alternative for header files and #include. Stroustrup writes that using #include in a wrong order is the biggest and most expensive source of bugs since 1972, when this mechanism was introduced in C.
Well, I guess that after nearly 40 years Stroustrup & al. saw the light...
Ofcourse they make modules much more convoluted than Wirth, with multiple 'module units', one of them being the 'module interface unit', and with 'module partitions'. And for the time being C++ will be using these modules next to #include; and then there are also namespaces in C++.
Must give Niklaus Wirth some joy and satisfaction that he did these things the right way from the start (when designing Modula around 1976, Modula-2 around 1979, and Oberon around 1986).
More information about the Oberon