4 ms·
As noted elsewhere it seems your experience is somewhat outdated: the releases of the LLVM D Compiler (one of the two compilers worth using for production build
by nicwilson 5y ago
As noted elsewhere it seems your experience is somewhat outdated: the releases of the LLVM D Compiler (one of the two compilers worth using for production builds, the other being GDC) are buffered to the bugs introduced in DMD (which is more stable than it used to be although there are still regressions), and there is a fork based GC available for linux, but as the GC will only ever trigger on allocation, don't use it and it won't collect.
> While C++ is not by any means a great meta-language, it's improved considerably since that time.
C++ has also painted itself into a corner multiple times too, which despite being technically an improvement over the status quo are lacking severely in their utility. C++ screwed up "constexpr if" big time by always introducing a scope (which costs you a pair of {}'s in the rare occasion you need one) which means you can't conditionally insert declarations (i.e. variables, structs/classes, functions).
> but beyond the novelty you'd hardly find a mature or reliable codebase written by a team of professionals using hacks like [string manipulation and mixins].
They are a wonderful hack when you need them and nothing else will do what you want. This is not unlike resorting to macros in C++, except that its hygienic, unlike macros.
I'm not claiming the project is mature and I'm only one person, but reliable definitely out there. The most heinous set of string mixins i've ever written[1] has definitely got to be the code for generating wrappers to call the OpenCL object property querying functions (clGetDeviceInfo & friends). You need to pass a size and a void pointer to the address of the return object that you have to call once, twice or more (depending on the type of the queried property) to figure out how much memory you need to allocate to call it again.
The important thing is that the interface[2] you use to drive this code generation is very clean and return on investment for getting the generic case correct is large.
[1]: https://github.com/libmir/dcompute/blob/master/source/dcompute/driver/ocl/util.d#L71 https://github.com/libmir/dcompute/blob/master/source/dcompu...
[2]: https://github.com/libmir/dcompute/blob/master/source/dcompute/driver/ocl/device.d#L172 https://github.com/libmir/dcompute/blob/master/source/dcompu...
- renox 5y agoAbout the 'constexpr if' introducing a scope, they did it volontary against the very good (and fun) proposal of Andrei Alexandrescu, so there must be arguments against 'scopelesd constexpr if' even though I admit that I don't understand what they could be.. After all #if also doesn't introduce a scope!
- nicwilson 5y ago> they did it volontary [sic] That really undersells the `static if considered paper` which has got to be the most offensive standards paper I've read. > so there must be arguments against 'scopelesd constexpr if' I've yet to find any. What I don't understand is: you hardly ever need to introduce a scope with Ds `static if` and in the very rare cases you do it takes all of two keystrokes, but with C++ you are completely unable to get rid of the scope.
- gallier2 5y ago> That really undersells the `static if considered paper` which has got to be the most offensive standards paper I've read. Indeed. Never read something stinking so much of sour grapes from NIH-suffering old farts.
- WalterBright 5y agoBjarne wrote the rejection of mine, Andrei's, and Herb's proposal to include static if: https://isocpp.org/files/papers/n3613.pdf https://isocpp.org/files/papers/n3613.pdf
- mhh__ 5y agoAn awful paper