HNHacker News
TopNewBestAskShowJobs

trws

307 karma · joined July 2, 2020

submissionscomments
trws··on The return of the frame pointers
I’m sincerely curious. While I realize that using dwarf for unwinding is annoying, why is it so bad that it’s worth pessimizing all code on the system? It’s slow on Debian derivatives because they package only the slow unwinding path for perf for example, for license reasons, but with decent tooling I barely notice the difference. What am I missing?
trws··on Ask HN: How do you optimize your focus?
This. Also audiobooks of well-trodden stories can work. I used to use the Harry Potter books or the HHGTTG radio show recordings (both on audible) but this only works for programming or other non-math non-language synthesis tasks for me. If I need the language processing part of my brain to actually work for me, rather than being distracted by the voice input so it won’t interrupt me, then I need to use something like music without vocals. The fact that programming falls into the “shut up darn you language centers” category has always perplexed me, but it does. Maybe it just doesn’t always need that side of the brain and kinda takes over when it does? Not sure.
trws··on Borrow checking without lifetimes
I agree they made the right decision not to add custom move constructors, potentially throwing move constructors and unmovable types make life very, very difficult for certain things in c++. That said, an annotation on a field that it either always references part of the parent or may reference part of the parent (or better a defined range or expression from the parent) could provide enough information for an automatically generated move constructor to correctly update the parent referencing pointer or reference. It’s entirely machinable, we had to do a version of this for the OpenMP offload memory model. It’s not the simplest thing, but updating references based on known offsets from known bases isn’t itself all that hard. Getting the syntax for the user to provide enough information to do it to be ergonomic however, that’s hard.
trws··on Why do we need for an Undefined Behavior Annex to C++
No. It would require listing not just every place the standard states undefined behavior is the result, but also every corner case not covered by the spec, or that is under-specified. It’s possible to document known instances, but never to document all possible sources of undefined or unspecified behavior.
trws··on GoboLinux
@tgamblin beat me to it in a sibling here, but this is exactly why I like spack’s way, it mostly gives you the best of both. Now I need to go finish that PR to make it usable as an actual distro…

The only one that doesn’t quite work out is 3. Dependencies are vendored like that when it’s a patched version that can only ever be used with one package, but in general it helps more to have the regular structure to let them be shared. Otherwise we would have to move them when a new dependent appears and some other kinda funky things. I have played with having each package get a “view” of links to all its deps in its prefix, but it’s a high cost in inodes for an only moderate increase in observability. Pretty easy to generate your own (there’s literally a command for it) so not sure if it’s worth it.

trws··on GoboLinux
I agree, but I’m happy to see that Nix, Guix, and the one I do the most work on Spack are starting to gain some traction since they all do basically this. Making it work is not always trivial though, and making it work efficiently is harder. Only in the last few years have I felt like we’re finally getting to the point where this is actually a maintainable model for the majority of software distribution. Here’s hoping it gets the rest of the way!
trws··on XL: An Extensible Programming Language
This is a bit anecdotal, but my freshman high school programming course, in 1999, was taught in Dr Scheme. I had already been programming in Q Basic and C++ at that point, and found it _maddening_. Not because of the perens really, editor was fine, but because of the lack of structured constructs for control flow that I was used to. Tail recursion, while now quite natural to me, just did not make sense at the time. My classmates had less trouble getting that bit because they had no preconceived notion of how control flow worked I think, and also didn’t expect parts of the language to exist that either didn’t or were hidden in the teaching mode we had to use it in. For most of a decade I listed that as my least favorite language of all time, until going back to find out that many of the things that were missing were actually there, they had just been hidden from us, pretty sure by imposing the “beginning student” mode: https://docs.racket-lang.org/drracket/htdp-langs.html

Simplifying for teaching is good. Making useful things completely unavailable… not sure I agree.

trws··on Show HN: htmz – a low power tool for HTML
FWIW, I happen to be in Australia and it’s quite snappy. No noticeable delay at all. If I were on a satellite connection or something it would be different, but trans-pacific cable seems to be doing just fine. Really it’s the super-long initial latency connections where this remains an issue.
trws··on A Git client for simultaneous branches on top of your existing workflow
That's great news, and I'll play with it some more to see if I misunderstood the docs. If so there may well be no issue here. Thank you for clarifying.
trws··on A Git client for simultaneous branches on top of your existing workflow
This makes sense, but I have to say I would find it much less concerning if doing "commit" would apply to some well-defined selection. Either something marked in the UI as "default" or "first" or something so that normal git operations wouldn't cause failure. I realize it makes one of the virtuals special, which is unfortunate, but it means normal command line workflows would be _safe_ even if they wouldn't always provide all the options.
trws··on Ede – An Fltk based desktop environment (2014)
Arguably BeOS/Haiku could count too. It’s less obvious later and with experience with Linux stacking WMs, but it was pretty obviously a different lineage at the time.
trws··on Gnuplotlib: A gnuplot-based plotting backend for NumPy
It’s good, but it’s even better with plotnine (formerly ggplot, the python port of ggplot2).
trws··on Ask HN: How do you setup a new Mac?
I’m vaguely surprised not to see bettertouchtool yet. I am too used to three finger middle click on the touchpad and some other custom gestures to have anything else come first. Lots of others, but most covered already here.

How do people usually deal with the lack of middle click?

trws··on Sane C++ Libraries
This is what “freestanding” is for, FWIW. There are a variety of papers and implementations around this goal, which is generally to have a set of features of c++ the language and the standard library that can work entirely unhosted.

I realize people think of this as a difference between c and c++, but if you go to compile C code with a thread_local variable and throw -nostdlib you’re going to have a bad day. Same for atomics, sometimes complex numbers, floating point exceptions, even receiving arguments and other core language features require some crt code. Removing the runtime library guts the implementation regardless of your language. The question is, does your language provide ways to deal with this? Rust has core, c has alternate ad-hoc embedded libc implementations and a history of bootstrapping implementations long enough to have them be well understood, c++ has/will have free-standing.

trws··on Relearning math as an adult
I probably had crummy teachers in some places, but my experience was that math up through linear algebra made sense and wasn’t all that bad, but that calculus was a huge bag of “if it looks kinda like this try this thing, and if the result looks kinda right it probably worked, if not try this other thing” such that I could never form a framework for it in my head. Also didn’t help when teachers in some things would say “oh this is much easier and more straightforward with calculus”, even without a prerequisite for it, and proceed to only explain concepts with calculus half or more of the class had never learned. One of these days I need to find a way to get it the right way.
trws··on Modeless Vim
FWIW, my “jk” mapping is also global, as is my C-[ mapping. Karabiner FTW. In all seriousness I haven’t found a way to manage a “jk” mapping that so correctly and quickly handles all cases of input in anything else, on any platform. (Except of course built into the keyboard) Autohotkey can kinda sorta do it, but it takes a lot more code for an inferior result sadly.
trws··on Modeless Vim
I freely acknowledge that you can make a delicious “pumpkin” pie with butternut squash, but a real sugar pie pumpkin (use Halloween leftovers and their mealy starchy flesh at your peril) remains superior in my opinion. Sweet potato pie, though, can be absolutely delightful with no squash in sight. Just don’t call it pumpkin pie. ;)
trws··on Adventures of Linux Userspace at Meta [video]
For cases where you might not know which ldd will actually work, I like to use patchelf or readelf to get the interpreter then use the —list arg directly. That way it always actually gives correct results, using a different loader can change the selected library paths even if it thinks it works. One-liner would be approximately $(patchelf —print-interpreter tgt) —list tgt My apologies if the dashes became an em-dash or similar, on a phone.
trws··on Gentoo goes Binary
Yeah, my CFLAGS won’t either. But I have to say I’m tempted to script something up so I can override all the plasma-related packages to use the common ones, or something similar, so I build everything where I care about speed myself and let the gui stuff be binary packages. Would save a whole lot of build time, and I’m not sure it would be much of a loss.
trws··on California Pizza Hut operators laying off all delivery drivers
I agree on the average level of pizza here being low (grew up in Chicagoland, now east bay resident for 9 years) but there are some bright spots. Zachary’s specifically is the best Chicago style deep dish I’ve found outside of Chicago. In fact it’s better than most I had in Chicago, not all to be clear since Uno still holds it for me. Patxis is pretty decent too, though less traditional it’s still on the level of say Giordano’s (roughly third tier Chicago style IMO). Oddly though, if I want a good New York style or tavern style slice, that’s much harder. Mountain Mike’s at least uses good pepperoni, but the odd crust depth is not ideal. At least there are options.
trws··on Obsidian 1.5 Desktop (Public)
I forgot they even had a paid version, sorry about that. The benefit IMO is really just playing the first few bits a few times to help get the visual/muscle memory of moving around with vim motion keys. Not just HJKL but beginning/end, Find and Till, I assume the paid part comes after that but it’s been a while since I’ve used it.

Honestly I’d do the vimtutor, maybe try the free version of this, and just use it for a bit. Use the arrow keys, use the mouse (:set mouse=a turns it on just in case) but see how you like being able to use the <count><action><range> syntax to do things. That’s the real win in my opinion, things like reflow this paragraph gqip (reflow is gq, range for a paragraph is “ip” or In Paragraph), delete this sentence including surrounding spaces and period das (literally Delete Around Sentence), and with movements gU} changes the rest of the current paragraph to uppercase.

There are many lists of these things, but I learned it by treating it as notepad with some odd bindings for save and quit for a bit in college then whenever something was annoying looking up how to do it or how to build it. I’ve now been using vim as my main editor for notes, prose with latex or markdown, and programming for 20 years, and literally given courses on it for graduate students. That is to say, you don’t need to learn it all ip front to use it. Learn how to open it, get in insert mode, write and quit and jump in; hopefully it will fit you like it did for me.

trws··on Obsidian 1.5 Desktop (Public)
That’s a good question. The built in tutorial is actually really good, you can launch it with “vimtutor” on the command line. It doesn’t give you everything, but its instructions and text to try things out on in the editor itself, which I find a good way to learn. It isn’t particularly programming focused either.

For getting used to the motions especially https://vim-adventures.com can be a fun way, in its game format.

For getting started I’d say don’t worry about plugins much, but get https://github.com/tpope/vim-sensible at least so the defaults meant for vi don’t get in the way. The only other thing you might want is a format syntax if your preferred note syntax isn’t highlighted well by default or something. Polyglot can be good to stave that off but really I’d say learn on a really lean config, and get used to using :help or similar. It’s the best way to learn the parts that work everywhere.

trws··on Apple partly halts Beeper's iMessage app again, suggesting a long fight ahead
No, that’s only what happens in iMessage or iOS messages. In almost every other context you get one set per number or email, possibly with an option for a combined conversation. That’s really the issue, there’s no indicator in the conversation of which number or email you’re communicating with, or which you’re sending to, and no interface for separating or combining them. It happens non-deterministically at some point after adding multiple to the same contact, sometimes. That’s why I say the UX is poor, it’s unpredictable and uncontrollable even for someone that knows to look.
trws··on Ask HN: What's your "it's not stupid if it works" story?
Running the largest workload I’ve ever personally launched (4,200 nodes, 144 cores each, 16,000 simultaneous jobs with a mix of one 1,000 node cpu job, 1 AI selection service on one node, about 3,200 nodes worth of 4-core cpu input pre-processing jobs and 4 GPU jobs per node co-located with all the CPU stuff) at 2am the day of the deadline for something about 50 of us had been working on for most of a year, realizing something was set wrong in the launcher. It was our last chance for a full run, we couldn’t start it over or try again, and it was going to fail because of a single runtime value.

I attached gdb to the launcher, “print <var>=<value>” and detached. The run started going about 10 times faster and we got the whole thing done. Crazy, dangerous, but it worked.

Question also made me think of the last-minute change we needed to make to a database’s structure to avoid about 6 million lost user updates when all DB admins were out with no password. That was a fun one too. Not sure I should admit how we managed it.

trws··on Apple partly halts Beeper's iMessage app again, suggesting a long fight ahead
The most common case I know of for what looks like misdirection is having one contact with multiple iMessage phone numbers, especially if multiple contacts share one or more of them. Real world example, my wife and I each have both a work iPhone and a personal iPhone. If both are listed in a single contact, iOS will “helpfully” merge the iMessages from both on a sender’s device, but not on the receiver’s. It’s very difficult to tell which device you’re sending to in this case, and can be changed by the other party if they send you a message and you reply. If you didn’t know what was going on, that would look a whole lot like a message going to the wrong device or even recipient in some cases. As a result I literally have separate contacts for my wife to avoid the problem, the UX is otherwise really abysmal.
trws··on Text Editor Data Structures: Rethinking Undo
Consider my interest piqued. We’ve seen a couple of others in the space, notably Kakoune and Helix. What do you have in mind?
trws··on Why Unix kernels have grown caches for directory entries ('name caches')
I miss this in the days of APFS actually. As much as it’s potentially dangerous, in a system without bind mounts readily available it really was sometimes the best solution to a problem. Mainly used it to allow various directories that couldn’t be moved to be re-homed, looking at you OneDrive.
trws··on Ask HN: Big C++ projects that uses Exceptions and RTTI?
We need the performance, and are frequently at least testing if not running in production on bleeding edge hardware, which almost always supports c/c++ first. That doesn’t make it for everyone though, and honestly I normally tell people to avoid exceptions as much as possible. The big issue is that C++ as a language was designed with exceptions in mind. There is no other way to exit with failure from any constructor that the caller can deal with, so every non-exception class has to use a two-step setup to avoid throwing in the constructor. If you’re doing exception free for real, meaning you can still recover rather than turning them off and just letting the program abort whenever a throw would have occurred, it’s actually a much harder language to write for.

Don’t get me wrong, maintaining exception guarantees and ensuring exceptions are appropriately caught is terrible. I much prefer working with optional and outcome and similar personally, but the assumption of exceptions is very deeply baked in, and avoiding them safely is a lot harder than one might guess.

Also, remember that while exceptions cost code size, they cost literally nothing in instructions executed unless an exception is actually thrown. That’s why the common nix implementation is called “zero cost exceptions”. In the happy path case they are faster than returning a discriminant. It’s not having exceptions available that makes code slow, it’s using them for things that are expected rather than unexpected or for control flow.

trws··on Ask HN: Big C++ projects that uses Exceptions and RTTI?
It depends a great deal on your situation. Where I work, we have codes up to 3 million lines, they all have exceptions and rtti turned on. You’ll find similar situations all over except at google and in gaming, and to some extent anywhere that last quartile latency is a serious concern. The thing about exceptions is that when you throw none of them they cost almost nothing, but throwing one costs on average about 1000 times as much as returning a value would. It’s a massive hit, especially if you care about latency, so it’s best to avoid them for control flow or anything but truly exceptional situations.

RTTI I’d say it’s best to only use in testing and debugging generally, it just plain isn’t reliable for the uses people seem to try to put it to.

trws··on Fortran 2023
Yup, this. The final version the committee actually works on is free for C, C++ and Fortran. After that ISO has it. I’m honestly not sure I would trust the final as much as the final draft. You can also build the c++ spec from the latex for yourself, the repo is public.
← PreviousPage 2 of 4Next →