Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

> In other words in order to be able to compile this source file you first need to parse the source file and all included sources until you hit the export declaration and then throw away the result.

I might be completely wrong here, but reading this reminded me of barrel files [1] in JS/TS projects, which are an absolute nightmare. I put together a little visualization a while back that demonstrated how much extra work is required to resolve the module graph if you forward exports, and it is orders of magnitude more than just importing something directly from the file where it is exported. If this is also the case for C++ modules, I'd like to buy the author a beer or six.

[1] https://basarat.gitbook.io/typescript/main-1/barrel



Would love to see the visualization if you have it on hand!


Unfortunately, there might be too much IP in the code (it was for a team presentation at a company I contract for). I could probably scrub that out and put it up on GitHub, though.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: