@foonathan@fosstodon.org
@foonathan@fosstodon.org avatar

foonathan

@foonathan@fosstodon.org

C++, compilers, and programming languages. Library developer @ think-cell, assistant chair for std::ranges @ C++ standardization committee.

This profile is from a federated server and may be incomplete. Browse more on the original instance.

zwarich, to random
@zwarich@hachyderm.io avatar

The worst realization that you’re aging is searching for something on Math Overflow and realizing that you answered it 8 years ago.

foonathan,
@foonathan@fosstodon.org avatar

@zwarich A couple days ago I've watched a lightning talk I gave in 2018.

Learned something new.

pervognsen, (edited ) to random
@pervognsen@mastodon.social avatar

How much RAM do you have in your dev workstation/laptop?

foonathan,
@foonathan@fosstodon.org avatar

@pervognsen 512GB, but I also have 128 cores or so.

foonathan,
@foonathan@fosstodon.org avatar

@pervognsen (because compiling C++ is slow...)

foonathan,
@foonathan@fosstodon.org avatar

@vitaut @pervognsen I have seen "compiler is out of heap space" error messages with MSVC.

foonathan, to cpp
@foonathan@fosstodon.org avatar

I've written a trip report for C++Now 2024, one of the best conferences I've ever attended: https://www.think-cell.com/en/career/devblog/trip-report-cpp-now-2024

vitaut, to random
@vitaut@mastodon.social avatar

Me waiting for Cassio Neri's C++ Now talk about the new FP to string conversion algorithm to be published.

foonathan,
@foonathan@fosstodon.org avatar
foonathan,
@foonathan@fosstodon.org avatar

@dougmerritt @vitaut Yes, the algorithm is a lot simpler than I thought as well!

lesley, to rust
@lesley@mastodon.gamedev.place avatar

#rust noob question: is there a way to "catch one kind of error and propagate the other" with something cleaner than this?

#rustlang

foonathan,
@foonathan@fosstodon.org avatar

@lesley You generally want to stay in the monad if you want to avoid manual matching: https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=1b795b9c952fcec028b82e5384cc55fe

foonathan, to random
@foonathan@fosstodon.org avatar
foonathan,
@foonathan@fosstodon.org avatar

@vitaut Not yet, he'll also open source it soon.

But it's really really simple, I almost could re-derive it once after watching his talk.

foonathan, (edited ) to random
@foonathan@fosstodon.org avatar

Hypothetically, consider the following pattern matching syntax in C++:

expr match {
x => ...
}

What should this mean?
A - match expr against the existing constant x
B - match everything and introduce the name x for expr

foonathan,
@foonathan@fosstodon.org avatar

@pervognsen Yeah, C++ isn't gonna copy that.

x => ... either always introduces a new name or always attempts name lookup for a constant. The question is what should the default be and what requires a keyword.

foonathan,
@foonathan@fosstodon.org avatar

@pervognsen That's also what I prefer, but the committee didn't like that (not my paper).

foonathan,
@foonathan@fosstodon.org avatar

@thibault There is going to be syntax to match against types, yes.

foonathan, to random
@foonathan@fosstodon.org avatar

Small tip for new speakers:

Don't end your talk with "are there any questions?" because then you get an awkward silence, then people realize it's over and start applauding, and then questions.

End it with "thank you for listening", wait for applause, then ask for questions.

vitaut, to random
@vitaut@mastodon.social avatar

new car()

foonathan,
@foonathan@fosstodon.org avatar

@vitaut new auto()

artificialmind, to random
@artificialmind@fosstodon.org avatar

Does anyone have a good resource for rationale and design decisions in IEEE 754 floating point? I'm preparing a blog post about tradeoffs in floating point design from an API perspective.

For example: why would you include +-Inf and not simply fold those into NaN? One important reason is interval arithmetic. But most "normal" float code I've seen doesn't handle Inf much better than NaN.

foonathan,
@foonathan@fosstodon.org avatar

@artificialmind @lesley I don't think the problem there is necessarily with Inf, which is just the representative for the last interval.

It's 1/(-)0 that shouldn't have been allowed IMO.

dgregor79, to random
@dgregor79@sfba.social avatar

Hello C++ folks! I've started a blog series aimed at C++ programmers who are interested in learning #SwiftLang. It teaches the breadth of the Swift language, but anchored in the features and idioms of C++. So if you know your Rule Of Fives and your SFINAEs and think you might be interested in Swift, I'd love to hear what you think. Part 1 is something you know of from C++ that Swift takes a bit further: value types. https://www.douggregor.net/posts/swift-for-cxx-practitioners-value-types/

foonathan,
@foonathan@fosstodon.org avatar

@dgregor79 How does name lookup work for extensions? Does the compiler look for extensions in all imported modules, or do you need to bring them explicitly into scope?

regehr, to random
@regehr@mastodon.social avatar

I keep running across blogs that I should follow but I don't since I don't currently have good RSS+browser integration. do people have favorite (open source or free) options here? I used to use feedly but they seem to be pushing too hard to get me to pay

foonathan,
@foonathan@fosstodon.org avatar

@lesley @regehr I also use Inoreader and pay for the cheapest plan that gives you more feeds.

foonathan, to random
@foonathan@fosstodon.org avatar

> This conversion initializes a temporary object of type T from the prvalue by evaluating the prvalue with the temporary object as its result object, and produces an xvalue denoting the temporary object.

The C++ standard is like me when I need to hit the word count requirements on an essay.

foonathan, to random
@foonathan@fosstodon.org avatar

> If you want to prompt for fingerprint and password input at the same time, you can use pam-fprint-grosshack.

Ah, Linux.

drewdevault, to random
@drewdevault@fosstodon.org avatar

Hm, bit of a long shot, but are there any physicists on here? I have a question: as the universe expands, light traveling through space is redshifted, which means it loses energy. Thermodynamics tells us that energy can't just disappear. Where does that energy go?

foonathan,
@foonathan@fosstodon.org avatar

@simrob @drewdevault @mort gestures vaguely towards quantum field theory

jrose, to random
@jrose@belkadan.com avatar

The world before stacks is a fun bit of software history that for some reason I’m always a bit surprised people don’t know. Of course, not knowing something is the default state and all, and it’s nearly never relevant—even retrocomputing projects rarely go back that far. But it is a glimpse into the kind of thinking people cone up with when using their existing tools to implement a new pattern—and that new pattern was “subroutines”. (The stack itself is a version of that too, where the new pattern is “recursion”.)

https://devblogs.microsoft.com/oldnewthing/20240401-00/?p=109599

foonathan,
@foonathan@fosstodon.org avatar

@jrose While thinking about my VM implementation, I realized that you don't need a call stack, if you don't have recursion, as you can statically reserve memory for each function once.

Turns out, that's Fortran.

lesley, to random
@lesley@mastodon.gamedev.place avatar

Not sure if I agree with this take (I am more in Rust's "limit type inference" camp), but this feels like a blog full of gems (that I somehow missed)

https://borretti.me/article/type-inference-was-a-mistake

foonathan,
@foonathan@fosstodon.org avatar

@lesley Ironically, it has memory safety because it doesn't allow type inference :D

foonathan,
@foonathan@fosstodon.org avatar
  • All
  • Subscribed
  • Moderated
  • Favorites
  • JUstTest
  • thenastyranch
  • magazineikmin
  • ethstaker
  • khanakhh
  • rosin
  • Youngstown
  • everett
  • slotface
  • ngwrru68w68
  • mdbf
  • GTA5RPClips
  • kavyap
  • DreamBathrooms
  • provamag3
  • cisconetworking
  • cubers
  • Leos
  • InstantRegret
  • Durango
  • tacticalgear
  • tester
  • osvaldo12
  • normalnudes
  • anitta
  • modclub
  • megavids
  • lostlight
  • All magazines