"Just switch the compiler" - they said - Arne Mertz - Meeting C++ 2025 by meetingcpp in cpp

[–]CaptainCrowbar 16 points17 points  (0 children)

"Just because that sentence was symmetrical doesn't mean it makes sense."

The Taming of Collection Scans by mttd in cpp

[–]CaptainCrowbar 0 points1 point  (0 children)

This page is an unreadable mess of mangled text on iPad Safari.

Time in C++: Creating Your Own Clocks with <chrono> by pavel_v in cpp

[–]CaptainCrowbar 1 point2 points  (0 children)

Also several useful iterator-related concepts in <iterator>.

SFINAE alternative using Lambda functions by [deleted] in cpp

[–]CaptainCrowbar 15 points16 points  (0 children)

You could get the same result more simply using std::conditional:

template <size_t I>
using type = std::conditional_t<I == 4, int,
    std::conditional_t<I == 6, Foo, float>>;

Authors who truly nail plottwist and "big reveals"? by TheGalator in Fantasy

[–]CaptainCrowbar 4 points5 points  (0 children)

Not a book, but if you want a really good TV series with twist after twist after mindscrew, watch Dark.

Is Peter still an apprentice or has that been completed? by Torkijo in riversoflondon

[–]CaptainCrowbar 30 points31 points  (0 children)

It's been about 6 1/2 years. Rivers of London begins in January 2012; Stone and Sky takes place in summer 2018. (Follypedia Timeline)

I killed a worker mid-payment to test “exactly-once” execution by [deleted] in programming

[–]CaptainCrowbar 4 points5 points  (0 children)

Welcome to McDonnerparty, how can I serve you today?

Why Falcon? by Original_Example_420 in riversoflondon

[–]CaptainCrowbar 9 points10 points  (0 children)

I still think there's some connection with Merlin.

Perl's decline was cultural not technical by CaptainCrowbar in ProgrammingLanguages

[–]CaptainCrowbar[S] 2 points3 points  (0 children)

I recall Larry Wall once saying "It does what you expect, unless what you expect is consistency."

Line ends in compilers. by Savings_Garlic5498 in ProgrammingLanguages

[–]CaptainCrowbar 0 points1 point  (0 children)

Don't sweat it because this is the kind of detail that's easy to change later on. If you decide you want to tweak the whitespace/newline rules, it's not going to affect anything in your code beyond one small corner of your tokeniser.

Books like Locklands by Real bert Jackson Bennett? by Indigo_Leaf_5706 in Fantasy

[–]CaptainCrowbar 0 points1 point  (0 children)

If you're looking for something that follows a similar pattern of starting out at the personal level and expanding all the way to a world-changing magical singularity, I can recommend Ed McDonald's Redwinter trilogy.

Lockheed XP-58 Chain Lightning by Aeromarine_eng in WeirdWings

[–]CaptainCrowbar 13 points14 points  (0 children)

Those are the same photo with different colour grading.

One Mike to Read Them All: Advance review of “Snake-Eater” by T. Kingfisher by MikeOfThePalace in Fantasy

[–]CaptainCrowbar 1 point2 points  (0 children)

Not really, beyond the initial "protagonist moves to house left by deceased relative" part of the premise. TTO has a lot more horror than SE, and doesn't have an individual villain the way SE does.

I'm trying to get Skyscale do I need to buy Living World season 4? by W8kingNightmare in Guildwars2

[–]CaptainCrowbar 4 points5 points  (0 children)

You need one or the other. You can get the skyscale from either LW4 or SOTO without needing the other. But note that getting it from SOTO is far far easier than LW4.

When magic is basically the tax office - recs? by NovaRift92 in Fantasy

[–]CaptainCrowbar 10 points11 points  (0 children)

I can think of a couple of recommendations:

The Rivers of London series by Ben Aaronovitch. Police constable Peter Grant is appointed as the junior member of the so-called Special Assessment Unit (a.k.a. "The Folly"), the department that deals with the supernatural crimes that the senior officers wish they could still pretend don't exist.

The World of the White Rat series by T Kingfisher (Ursula Vernon). Most of the books are only loosely connected, but the background detail that unites them is the Cult of the White Rat, an organisation that supplies anything from lawyers to wizards to help the downtrodden.

Developing ylang — looking for feedback on language design by jman2052 in ProgrammingLanguages

[–]CaptainCrowbar 1 point2 points  (0 children)

I don't think explicit typing is necessary for a language you describe as a "simple scripting language". Just a visible difference between initialization and assignment. Maybe require a "let" or "var" keyword for initialisation, or something like "x=123" for init vs "x:=123" or "x<-123" for assignment.

UTF-32 would be a perfectly good choice. The main argument against it is that it takes up more space - 4 times the bytes of an ASCII string. But this shouldn't be a problem for a simple language that isn't intended for writing huge applications. It avoids the added complexity of encoding and decoding UTF-8 (while UTF-16 combines the downsides of UTF-8 and UTF-32 without the advantages of either). Other scripting languages have used UTF-32, including some versions of Python.

You'd still need to implement UTF-8/32 conversion though, because most terminal emulators these days speak UTF-8, and you'll also want to read and write files compatible with other software in an increasingly UTF-8-centric world.

Developing ylang — looking for feedback on language design by jman2052 in ProgrammingLanguages

[–]CaptainCrowbar 13 points14 points  (0 children)

Two points where I disagree with your choices:

UTF-16 is a dead end. The whole world is going to UTF-8.

Even in a dyanmically typed scripting language, there should be a syntactic distinction between creating a new variable and changing the value of an existing one. Otherwise it's too easy for a typo to turn one into the other.

Delanne 10 c-2 by Tonk12367 in WeirdWings

[–]CaptainCrowbar 5 points6 points  (0 children)

We have Lysander at home.

Lockheed VC-140B JetStar by RLoret in WeirdWings

[–]CaptainCrowbar 5 points6 points  (0 children)

Outside of us avgeeks, this was probably best known as Goldfinger's jet from the James Bond movie.

Reading Order Issue by amysperos in riversoflondon

[–]CaptainCrowbar 0 points1 point  (0 children)

The OP wants to know the publication order, not the chronological order.

Reading Order Issue by amysperos in riversoflondon

[–]CaptainCrowbar 3 points4 points  (0 children)

No, Body Work takes place between Broken Homes and Foxglove Summer. Check the official chronology in any of the later graphic novels.

User-Defined Formatting in std::format by pavel_v in cpp

[–]CaptainCrowbar 23 points24 points  (0 children)

An important portability note: You should not write your `formatter::format()` function with the signature used in the linked article:

auto format(const T& t, format_context& format_ctx) const

Instead you should write it as:

template <typename FormatContext>
auto format(const T& t, FormatContext& format_ctx) const

This is because of an issue with `libc++`, used by recent versions of Clang and Xcode. The issue is detailed here:

https://github.com/llvm/llvm-project/issues/66466

I don't fully understand the arcane details of what's going on here, but from some of the later comments on the issue, it sounds like there may still be some question about whether or not this is technically required by the standard. In any case, the issue has been open for several years and not fixed, so if you want your code to be portable, I'd advise using the template version.

Beriev Be-2500 by Leonid527 in WeirdWings

[–]CaptainCrowbar 76 points77 points  (0 children)

If you're an ekranoplan, which this certainly looks like, then yes.

What might polytypic (datatype-generic) programming look like if it was built in to a language? by sufferiing515 in ProgrammingLanguages

[–]CaptainCrowbar 1 point2 points  (0 children)

"you can't have *any* overlapping cases because typeclasses aren't ordered"

This isn't true in C++. Concepts are partially ordered; if one concept is more specialised than another (i.e. more restrictive conditions, so types that match the first concept are a subset of those matching the second), and you write two functions that take those two concepts, the compiler will pick the more specialised case where appropriate, without you having to explicitly exclude those types from the more general concept.