17 ms·
LLVM 13.0
- klaussilveira 5y agoKaleidoscope is great to learn your way into LLVM: https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangImpl01.html https://llvm.org/docs/tutorial/MyFirstLanguageFrontend/LangI...
- tubby12345 5y agoGoing through that tut literally this week and the docs are horribly out of sync with llvm itself. Solution is to check out 11.0 tag and to follow https://releases.llvm.org/11.0.0/docs/tutorial/MyFirstLanguageFrontend/index.html https://releases.llvm.org/11.0.0/docs/tutorial/MyFirstLangua...
- RcouF1uZ4gsC 5y agoLooking at the release notes for Clang, there are no new C++20 features. Clang is really falling behind GCC and even Microsoft Visual C++ with regards to C++20 implementation. https://en.cppreference.com/w/cpp/compiler_support/20 https://en.cppreference.com/w/cpp/compiler_support/20
- cracauer 5y agoSadly format did not make it.
- Thev00d00 5y agobut we have fmtlib thank goodness
- cute_boi 5y agoalso it doesn't support many hardware compared to gcc and people seem to be more crazy about it idk why :(
- h2odragon 5y agoThings like this will win fans: https://blog.matthieud.me/2020/exploring-clang-llvm-optimization-on-programming-horror/ https://blog.matthieud.me/2020/exploring-clang-llvm-optimiza...
- pjmlp 5y agoThe two main backers (Apple and Google) seem to have backed out. From my point of view, for Apple, their use of C++, C++17 is good enough. Metal uses a C++14 dialect as shading language, IO and DriverKit an embedded friendly subset, for everything else there is Objective-C and Swift. Google seems to have been put off by losing the ABI vote and changed focus into Abseil instead, and have their own Draconian style guide anyway. And are increasingly adopting Rust as well. Intel, ARM, IBM, Sony, Nintendo will have to jump in. By the way, concepts were mostly implemented by a single guy!
- jabl 5y ago> Intel, ARM, IBM, Sony, Nintendo will have to jump in. Intel and IBM have recently announced their own proprietary LLVM-based compilers, but they seem more interested in backend work to make their own CPU's look good [1] than spending resources on frontend work. I guess that applies to ARM as well. Sony and Nintendo are, I guess, mostly satisfied? They just want a decently good compiler and toolchain ecosystem, but for games most performance comes from the GPU anyway, chasing low-single-digit performance increases for CPU code doesn't seems like a super good investment opportunity for a game console company.
- jedisct1 5y agoNightly versions of Zig now include LLVM 13.0.0. So you can already use it to easily compile and cross-compile code (Zig, but also C and C++) to many targets including WebAssembly and Apple Silicon, using LLVM 13.
- boris 5y agoHow about an equivalent for Clang targeting the MSVC runtime (which is how both Google and Mozilla build their web browsers for Windows), is this supported?
- jcelerier 5y agoI use the llvm-mingw (targeting ucrt) for that, it's available on GitHub and has been updated to 13
- rofrol 5y agoI googled what is ucrt - https://github.com/MicrosoftDocs/cpp-docs/blob/master/docs/porting/upgrade-your-code-to-the-universal-crt.md https://github.com/MicrosoftDocs/cpp-docs/blob/master/docs/p... - https://stackoverflow.com/questions/57528555/how-do-i-build-against-the-ucrt-with-mingw-w64 https://stackoverflow.com/questions/57528555/how-do-i-build-...
- gavinray 5y agoHow can you use Zig to compile C++? This isn't one I was aware of
- SloopJon 5y agoThere's a blog post that describes this: https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html https://andrewkelley.me/post/zig-cc-powerful-drop-in-replace... HN discussion: https://news.ycombinator.com/item?id=27872596 https://news.ycombinator.com/item?id=27872596 previous discussion: https://news.ycombinator.com/item?id=22679138 https://news.ycombinator.com/item?id=22679138
- nicoburns 5y agoThis will be included in the next Rust release and seems to contain some nice compile time wins. Pretty much 10% faster across the board for most Rust crates: https://www.reddit.com/r/rust/comments/pxvcy4/ryan_levick_the_new_pass_manager_in_llvm_13_now/ https://www.reddit.com/r/rust/comments/pxvcy4/ryan_levick_th... EDIT: The new pass manager which improved the compile times is not scheduled to be enabled until Rust 1.57 (the release after the next one).
- runevault 5y agoI was a little bummed to see the pass manager being held back. I wish there was a flag you could pass to rustc to go ahead and use it now while only making it the default in 1.57 (or at least I haven't heard of being able to do that).
- mrlonglong 5y agoYou can play with 1.57 if you use the nightly release.
- haberman 5y agoI'm excited for the release of [[clang::musttail]], an attribute that I implemented to bring guaranteed tail calls to C, C++, and Objective-C: https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNotes.html#major-new-features https://releases.llvm.org/13.0.0/tools/clang/docs/ReleaseNot... I talked more about some performance motivation for this feature here: https://blog.reverberate.org/2021/04/21/musttail-efficient-interpreters.html https://blog.reverberate.org/2021/04/21/musttail-efficient-i...
- ndesaulniers 5y agoI worry whether LLVM can actually provide such guarantees ATM. https://reviews.llvm.org/D107872 https://reviews.llvm.org/D107872 makes me doubt.
- haberman 5y agoYes I think there are some bugs to be worked out still. I implemented Clang's [[clang::musttail]] attribute on top of the existing LLVM "musttail" attribute, but it does appear that there are some issues with the existing attribute at the LLVM level. In addition to the bug you mentioned, there are a few architectures where musttail is not supported supported. The POWER backend (big endian or pre-POWER10) and ARM backend (32-bit only) will throw errors for musttail in the backend. In the long-term though, I see this being a solid foundation on which to build. x86/x64/ARM64/POWER10 all support it. All the architectures seem to be going in a direction where this is possible to guarantee. Hopefully the bugs will get ironed out over time. Thanks for your bugfix on this!
- google234123 5y agoWelcome to the future of C++ :) [[clang::musttail]] [[deprecated]] [[nodiscard]] static inline bool& func(...) noexcept {...}
- Matheus28 5y agoYou forgot constexpr
- AndreyKarpov 5y agoDetecting errors in the LLVM release 13.0.0 - https://pvs-studio.com/en/blog/posts/cpp/0871/ https://pvs-studio.com/en/blog/posts/cpp/0871/