@mikerotch @matrix I'm planning to compile without libc. I need to completely remove all standard memory allocation by all code in the entire SO. Dunno if that's practical in C++; it's been quite a while since I tried any tricky.
Notices by gentoobro (gentoobro@gleasonator.com), page 3
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:15:14 JST gentoobro -
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:14:57 JST gentoobro @mikerotch @matrix @jeffcliff lower the IQ requirements
cough Rust cough
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:14:45 JST gentoobro @mikerotch @matrix I usually put "using std;" in all my C++ files back before I found the true faith. std gets used constantly and frankly anything else is less important and can get out of its way.
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:14:40 JST gentoobro @mikerotch @matrix Now you get into boilerplate. You essentially have to re-declare your types and functions all over the place. There's tradeoffs to everything. C++ takes one direction and I take the polar opposite.
Having my build system slap "#define appendCmds riggedMeshManager_c__appendCmds" and "#undef appendCmds" around each source file with static functions during a unity build is easy and, more importantly, completely transparent to the code. I'm already undermining malloc et. al. with globally included macros. (Another reason for compiling in the static libs by source.)
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:14:31 JST gentoobro @jeffcliff @matrix Languages should never integrate their packaging or build systems, officially or in practice. (Looking at you, npm.) There are too many tradeoffs and gotchas and ideologies involved. No one implementation will properly serve even a large minority of users without serious drawbacks. Most implementations end up being a clusterfuck of complexity and a massive security and stability risk in practice. (Looking at you, lpad.)
If you can't manage to install the -dev package of a dep, should you really be considered by the language designers?
Personally, I think that even having the concept of "modules" in your language (a la Go or Rust) is a bad thing, but my reasoning isn't solid enough yet to argue it definitively.
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:14:05 JST gentoobro @mikerotch @matrix or_you_have_to_reinvent_them_yourself_poorly
Kind of. One::of::the::things::I::hate::about::C++::is::the::constant::use::of::"::". Sure, you can use "using namespace foo;", but then you're just back where you started. To me, unnecessary visual bloat is a dire sin in source code.
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:13:43 JST gentoobro @mikerotch @matrix LTO is optional in my build system since it takes several seconds on every build.
I make extensive use of static functions, often with the same names in many TU's, so a unity build isn't directly feasible for me even for releases. I could probably automate the inclusion of some macros between each source file though, now that I think about it. I'll have to get my C parser working completely before that.
All of my static libraries are compiled as source along with the project for this exact reason. I've read that at least on GCC you can make .a's that keep the LTO information, but it's not risen up my priority list enough to test.
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:13:11 JST gentoobro @mikerotch @matrix competence and manpower are generally decreasing as demographics are deteriorating.
It's getting pretty bad...
Users of a template should be able to figure out its memory layout with just the class definitions and function declarations, no different than typical use of classes. The template function definitions, which are largely what bloats the headers, aren't truly needed until final linking of the executable or library. The compiler should be able to keep a list of which instances of which templates are needed in each TU then have the linker compile the necessary versions using cached IM code like LTO does. And all this completely without build system interaction, since it's the linker provoking the final instantiation and compilation. Function inlining would be no different than with non-template functions.
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 06:12:49 JST gentoobro @mikerotch @matrix PCH, in my personal experience, tends to be a glitchy mess. Maybe that's just build systems and not PCH itself.
But I'm not talking about PCH. I'm talking about being able to put template function definitions in a normal source file, a separate translation unit, and then having the linker figure out what concrete versions to instantiate and then compile. This is roughly how Link Time Optimization works. The compiler keeps some form of intermediate code around for every TU and then runs a final compile and optimization pass over the whole project, inlining functions from other TU's as it sees fit. I see no reason that a C++ compiler couldn't automatically do this with templates, though there may indeed be a legitimate one.
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 02-May-2024 03:46:14 JST gentoobro @mikerotch @matrix Thanks for the explanation of the details.
The question now becomes why they don't cache all the necessary information LTO style and automatically instantiate the required argument combinations at link time.
-
gentoobro (gentoobro@gleasonator.com)'s status on Tuesday, 30-Apr-2024 19:34:13 JST gentoobro @matrix As I understand it, there's some petty detail in the spec that forces all the template functions to have to be in headers like static functions. Some tiny oversight like how in C two identical anonymous structs are considered different types but they're the same if you typedef them.
-
gentoobro (gentoobro@gleasonator.com)'s status on Tuesday, 30-Apr-2024 07:57:21 JST gentoobro @matrix The devil's in the details. Generics tend to be complicated for compilers because they can cause a combinatorial explosion of concrete implementations. Some languages and compilers handle this reasonably. Others are C++.
My understanding of the problem is something like this: PCH aside, C++ has to recompile the entire template system for every translation unit (source file). The templates have to be completely in the headers due to some petty retarded detail of how they work. Then the linker has to throw away all the duplicate template function implementations. C++ is a language with no zen.
-
gentoobro (gentoobro@gleasonator.com)'s status on Monday, 29-Apr-2024 20:12:28 JST gentoobro @matrix Complexity is not always obvious. Generics tend to be complicated. C++ compilers are slow mainly because of templates.
-
gentoobro (gentoobro@gleasonator.com)'s status on Monday, 29-Apr-2024 15:20:07 JST gentoobro @MK2boogaloo https://notabug.org/yzziizzy/gpuedit
Shameless self promotion. 😆 It mostly works, and has highlighters for a couple languages, and has very few undo bugs now. I daily drive it. I got sick of KWrite getting worse with every release and said "fuck it" and spent about 3 solid months to get it to a semi-usable state, at which point the dogfooding started.
The main benefit is that the commands file is highly configurable. Another benefit is that it doesn't load windows-style line endings correctly because I'm too lazy to fix something that I rarely encounter.
-
gentoobro (gentoobro@gleasonator.com)'s status on Monday, 29-Apr-2024 07:23:33 JST gentoobro @matrix There is something to be said for compiler speed. Overly complicated languages need overly complicated compilers. Overly complicated languages can seldom be truly optimized. Similarly, if they compiler devs can't optimize their own compiler, what makes you think they can optimize the output of the compiler? It's not universal, but it is a strong trend.
A "sufficiently advanced compiler" will never exist.
-
gentoobro (gentoobro@gleasonator.com)'s status on Monday, 29-Apr-2024 07:23:14 JST gentoobro @matrix The lack of "extra" keys on most keyboards is annoying. I don't want to fucking run emacs. A couple more modifier keys (control, alt, super, etc) would make text editing better.
-
gentoobro (gentoobro@gleasonator.com)'s status on Saturday, 27-Apr-2024 16:09:56 JST gentoobro @crunklord420 @splitshockvirus What the fuck is in their shaders that takes so long? Mine compile in a couple seconds. Must be some sort of bloated middleware.
-
gentoobro (gentoobro@gleasonator.com)'s status on Thursday, 25-Apr-2024 00:56:13 JST gentoobro @matrix Burn the boats.
-
gentoobro (gentoobro@gleasonator.com)'s status on Sunday, 21-Apr-2024 13:21:56 JST gentoobro @caekislove @JustJohnny @luithe @EssentialUtinsil @ForbiddenDreamer @nugger Ironically, this is one of the few things in America that isn't illegal.
-
gentoobro (gentoobro@gleasonator.com)'s status on Wednesday, 17-Apr-2024 05:00:27 JST gentoobro @Vril_Oreilly @aral Fat binaries are retarded at the core. SNAP, Flatpack, Universal Binaries, Go statically linking everything all the time. All of them. You end up with mountains of duplicate code on your system that eats ram, wastes bus bandwidth, and just slows everything down in general. All just because you couldn't manage to build a package manager (Windows), or got lazy and threw it away (Ubuntu).