3 ms·
Impressive effort, but pretty chthonian syntax. And that's with using macros. Main take away from this for me is that pattern matching needs to be a language fe
by moogly 11y ago
Impressive effort, but pretty chthonian syntax. And that's with using macros. Main take away from this for me is that pattern matching needs to be a language feature to see pervasive use.
- vanderZwan 11y agoThe authors themselves state in their talk (linked halfway down the readme) that it's not the type of syntax anyone wants to see in the language - rather that this is an experimental library showing what is possible, using a very quirky syntax. They're more concerned with making it work and with good performance. Although admittedly that's from an older talk, no idea if the current syntax still reflects that sentiment.
- plorkyeran 11y agoStroustrup's pretty opposed to the idea that anything that can be done as a library without any language extensions automatically should be, so I think it's safe to say that by the time this is ready for standardization it will not be a mess of macros that beats the language into submission. It's just a lot easier to get people to try out your prototype when it doesn't require first building the compile from some branch.
- kryptiskt 11y agoThat seems right, in the paper he is pretty open to the idea of extending the language if the solution is general enough: "In the future, we would like to implement an actual language extension that will be capable of working with open patterns. Given such an extension and its implementation, we would like to look into how code for such patterns can be optimized without hardcoding the knowledge of the semantics of the patterns into the compiler. We would also like to experiment with other kinds of patterns (including those defined by the user), look at the interaction of patterns with both the standard library and other facilities in the language, and make views less ad-hoc." http://www.stroustrup.com/OpenPatternMatching.pdf http://www.stroustrup.com/OpenPatternMatching.pdf
- nly 11y agoStroustrup has wanted multi-methods in C++ almost since its inception. At least 20 years.