> powerful compile-time and metaprogramming capabilities
While I agree that, generally, compile time metaprogramming is a tremendously powerful tool, the C++ template metaprogramming implementation is hilariously bad.
Why, for example, is printing the source-code text of an enum value so goddamn hard?
Why can I not just loop over the members of a class?
How would I generate debug vis or serialization code with a normal-ish looking function call (spoiler, you can't, see cap'n proto, protobuf, flatbuffers, any automated dearimgui generator)
These things are incredibly basic and C++ just completely shits all over itself when you try to do them with templates
> The C (near-) subset of C++ is (modulo standard libraries) a starting point for this; just adding on templates for type system power (and not for other exotic uses) goes a long way.
In my experience, this is absolutely true. I wrote my own metaprogramming frontend for C and that's basically all you need. At this point, I consider the metaprogramming facilities of a language it's most important feature, by far. Everything else is pretty much superfluous by comparison
This somehow reminds me of the days when the fastest way to deep copy an object in javascript was to round trip through toString. I thought that was gross then, and I think this is gross now
As an aside, if the author reads this, did you consider using bitfields for the superposition state (ie, what options are available for a tile)? I did a wfc implementation a while back and moved to bitfields after a while.. the speedup was incredible. It became faster to just recompute a chunk from scratch than backtrack because the inner loop was nearly completely branchless. I think my chunks were 100 tiles cubed or something.
> I did a wfc implementation a while back and moved to bitfields after a while.. the speedup was incredible.
Yeah, my WFC bot (which happens to generate Carcassonne maps in an amusing coincidence) eventually ended up using https://github.com/bits-and-blooms/bitset which improved things hugely.
> It became faster to just recompute a chunk from scratch
Kinda what mine does - every now and again[0] it stacks the current state and if it gets stuck, just pops the last one and continues from there.
[0] Just checked and it's every `tileCount / 20` iterations, hilariously in a variable named `tenper`. I hate past me.
I read an 'i hate myself' post one time where someone encountered a variable named leghands. Obviously, it had once read legendHandles, and had since been helpfully shortened by the author.
Imagine working on voyager II .. or some old-ass banking software that still runs RPG (look it up, I'll wait), or trying to hire someone to do numerical analysis for the genesis of a format that supercedes IEEE float .. or .. whatever.
There are many applications for extremely specific skillsets out there. Suggesting otherwise is, in my opinion, clearly unwise
I have some feedback that's annoyingly non-specific.
I used Zulip a few years ago as a contractor. It seemed _fine_, but I didn't love it. Specifically, the UI felt sluggish and generally the experience was somewhat unpolished. Maybe things have changed, a lot happens in a couple years, but there you go
I'm from Canada, and I like cars for many of the same reasons I like programming. They're complicated, fickle, and go fucking fast when you get everything right. It's like mainlining adrenaline and validation at the same time.. who wouldn't like that?! They're just fucking fun
> Here, we don't have winter, fall or anything anymore.
I was in the bar in Revelstoke (where I lived, at the time) chatting with an old-timer the other year, and I asked him "is it just me, or did it used to snow more?"
He laughed, and told me that when he was a kid growing up, they weren't allowed to play on the tops of snowbanks because you'd get electrocuted by the high tension power lines. At the time, mid-winter, it was raining outside with a sad pile of slush maybe 1 foot deep.
Even when I was a kid in Revy, snowbanks were 10' deep mid-winter, every winter. It's been raining in town for the last 5 years, all winter. Winter's over. Time to start surfing, I guess.
While I agree that, generally, compile time metaprogramming is a tremendously powerful tool, the C++ template metaprogramming implementation is hilariously bad.
Why, for example, is printing the source-code text of an enum value so goddamn hard?
Why can I not just loop over the members of a class?
How would I generate debug vis or serialization code with a normal-ish looking function call (spoiler, you can't, see cap'n proto, protobuf, flatbuffers, any automated dearimgui generator)
These things are incredibly basic and C++ just completely shits all over itself when you try to do them with templates
reply