[HN Gopher] Structured Identifiers
___________________________________________________________________
Structured Identifiers
Author : roca
Score : 40 points
Date : 2021-10-12 04:45 UTC (18 hours ago)
(HTM) web link (pernos.co)
(TXT) w3m dump (pernos.co)
| the_mitsuhiko wrote:
| We ran into similar issues at Sentry when trying to unify across
| platform differences in how C++ compilers emit function names.
| There is some code in place that tries to clean up function names
| and trim out the relevant part (eg: just the function name). If
| someone is curious, this is how this is implemented currently:
| https://github.com/getsentry/sentry/blob/9681dedd549b64440fe...
|
| For instance it turns
| `<lambda_7156c3ceaa11256748687ab67e3ef4cd>::operator()` into
| `lambda::operator()` or things such as `static unsigned int
| Scaleform::GFx::AS3::IMEManager::DispatchEvent(char const *,char
| const *,char const *) const` into
| `Scaleform::GFx::AS3::IMEManager::DispatchEvent`.
|
| Unfortunately the information in the demangled information is in
| the textual form often not good enough to process it, and the
| demanglers are so complex that maintaining custom formatters for
| them is a huge task.
| mwcampbell wrote:
| FWIW, the demo call stack isn't very accessible with a screen
| reader. In particular, it's not clear how the elision of portions
| of the name is supposed to work. From my perspective when using a
| screen reader, each entry in the call stack consists of an
| unlabeled button, a simple string like "nsGlobalWindowInner::Dump
| (...) at nsGlobalWindowInner.cpp:3370", followed by another
| unlabeled button.
|
| To be fair, I know that making a highly interactive UI like this
| accessible with a screen reader is a lot of work, and you
| probably haven't yet had a customer who needs it. (And it's
| unlikely that I will become a customer in the near future.)
| sfink wrote:
| I need this for a static analysis, where sometimes I want a
| template type (eg `Maybe<T>`) to inherit properties from the
| template parameter. I used to do a horrible hack involving
| processing things in order of the string length of the type, but
| eventually had to hack together a basic parser to tease things
| apart. Which still feels Wrong; I shouldn't be unreliably
| recomputing information that the compiler already knew but threw
| away.
|
| I also do some awful things with regexes to simplify output of
| type names. Basically, I am just a bad person.
| veltas wrote:
| This is the sort of stuff that makes me value C not having
| special syntax for grouping external identifiers.
| [deleted]
___________________________________________________________________
(page generated 2021-10-12 23:02 UTC)