@PeterSommerlad It does.
In this particular case, MSVC rejects one version of invalid code and incorrectly accepts the other. And I even totally understand why: the Modules TS had a different grammar.
Both Clang and gcc are even worse: they accept *both* ill-formed variants. And they don't have the "legacy" excuse.
It took a... few more days to work through all the ways types exist in Subspace without hitting an unreachable() in my type picker-apart-er. But you can see it live now here! See how the Result return type is made up of three links?
https://suslib.cc/sus-num-i32.html#method.try_from.signed
In a particular order, the worst things to try pull apart the types from in #Clang are:
1. Partial template specializations (template <class T> struct S<T, int>)
2. Dependent names (A::B)
3. Everything else wasn't so bad
Those 2 felt like Clang was trying to keep the information I need from me, like null pointers in the type tree where they normally give you the answer you need.
FWIW here's the possibly beautiful iterator expression over some of the #Clang AST. :BlobCat_Flower:
Being able to build the #linux kernel with #clang is a great thing for both projects.
We were able to revert 2 commits in LLVM today from having the kernel as a large test case! 2 in one day is a new record (for us).
1. https://github.com/ClangBuiltLinux/linux/issues/1926
2. https://github.com/ClangBuiltLinux/linux/issues/1928
Just got done making my first program in #clang. It's nothing special just a #FizzBuzz challenge but strings in this language mess with my brain so it took about 2h. Really interesting nonetheless and i actually learned something. I now understand that char* can be dynamically allocated and char[] is fixed at compile time (i hope lol).
If you got any beginner coding challenges for me shoot, i'd appreciate it.
ChatGippity is also a great resource when needing something explained.
Popularity of #programming languages from August (#perl is 28 at 0.68%).
Has its limitations, but a couple of points worth noting :
1. #COBOL and #FORTRAN are holding rather well
2. languages that are involved in some sort of data analysis and processing (#sql, #clang /c++) are doing very well. Not sure what to make of #Python; are ppl in #AI seeing through the reality is a scripting over extremely performant c/c++ and that there are other lang that can glue as well?
#golang & #Julia are ⬆️
#programming #perl #cobol #fortran #SQL #clang #python #ai #golang #julia
After being *meh* about C (#clang) at first, I will admit, that it’s not that bad after writing it s bit more.
I never wrote Assembly in my life, but tonight (for some reason) I thought of disassembling simple C code snippets with Ghidra. So, I started with a hello world and was very surprised to find a much more extensive and complex result compared to my original assembly (obtained with GCC).
I mean, it's a Hello World!
#ghidra #gcc #clang #assembly #asm
Been trying out building with clang (official LLVM binaries) on Windows because it would be kind of nice to build with the same compiler on all platforms, but it's really slow?
Consistently getting about 80% longer build times with clang. (Linking is actually ms' LINK behind the scenes so the difference is in c++ compiler.)
Not sure if I have some setting wrong so it does additional work or what's going on because the difference is so big.
#clang #visualstudio #cpp #cplusplus
I spent some time on #Subdoc for #SubspaceCpp this week and hit some big new milestones. Finally showing template parameters and requires clauses on functions and classes. Constructors are rendered.
And concepts are now rendered!
For example, Ord: https://danakj.github.io/subspace-docs/sus-ops-Ord.html
Also headers are self-links, links across pages have been added throughout the docs, I added some extensive docs for collections and options based on the Rust docs but C++ified.
There's now breadcrumb links at the top back to the parent namespaces.
There's lots to do but it's starting to actually look like useful docs now.
One BIG todo is to break apart a QualType into a structure that can be reconstructed into a string for display, but for which all types within it have a chance to be turned into links. Like Option<u32> could become a link to Option and to u32. Similarly, breaking a apart constraints (requires clauses) so that types within it can become links.
These need some serious #Clang knowledge though, maybe someone out there is interested in this?
"To be fair to C and C++, if you set yourself the goal of crossing an 8-lane freeway blindfolded, it does make sense to focus on doing it as fast as you possibly can."
-- Russ Cox, talking about undefined behavior and compiler optimizations
Typescript to C compiler / transpiler
https://youtube.com/watch?v=zZL-2qiFIRw #c #clang #typescript #programming
#c #clang #typescript #programming
This idea of instantiating C++ templates with std::variant turns out to be more complicated than I thought once compiler optimizations are enabled, but function attributes provide the fix. The example code now looks like this. Full write up here: https://indii.org/blog/revisited-combinatorial-instantiation-of-templates-with-std-variant/ #cpp #cplusplus #programming #clang #gcc
#cpp #cplusplus #programming #clang #gcc
Trying to get this to the other archs supported by #FreeBSD's #Linuxulator (amd64 and i386), I'm hitting yet another wall: #Linux headers fail to build there. Oh freakin hell, I expected to do quite some adaptions to support all 3 archs, but I didn't expect it to fail at *this* stage 🤯
Already tried to understand what happens in Linux' build system. Well, it's not exactly easy to understand 🙄
Shot in the dark, trying it with #gcc (instead of the base #clang) now... (which will take a while cause my test machine has to *build* this gcc first, bah ....)
#freebsd #linuxulator #linux #gcc #clang
I just realized & and * are adjacent on the keyboard
me: programming in C for [REDACTED] decades
thank you for coming to my TED Talk (TM)
I'll show my way out...
#programming #c #clang #computer #keyboards