Better HN
topnewbestaskshowjobs
Log inSign up

MathMonkeyMan

2,676 karma · joined Nov 28, 2019 (7y ago) · 1,131 submissions

Submissions

comment 2y ago · link · parent

Not sure why this was downvoted. It's true that ccache and build parallelization (e.g. icecream) can grease the wheels enough that builds are no longer a dev cycle bottleneck.

What the article is about, though, is changing the source code so that it is intrinsically faster to compile. At some point you say "this program isn't complicated, why does it take so long to compile?" Then you start looking at unnecessary includes, transitive includes, forward declarations, excessive inlining, etc.

comment 2y ago · link · parent

Three times I've joined a team that has a substantial C++ codebase, and three times I've been tempted to use libclang based tooling to automate changes, or at least to identify patterns that could be changed.

This article, while not the nerdy deep dive I'd like, does touch on what happens when you try to do that. You realize that the C++ standard library is really complicated, that your existing code is really fucked up, and that libclang is too limited a tool. You end up writing a XSLT engine in hacked up python, but by a different name.

[LibTooling][1] is probably The Right Thing ("in C++", as the article says), but I never spent the time to get it working.

Somebody write a DSL for C++ inspection and transformations that uses LibTooling as a backend. I bet there are many, but none close at hand.

edit: [this][2] is close...

[1]: https://clang.llvm.org/docs/LibTooling.html

[2]: https://clang.llvm.org/docs/LibASTMatchersTutorial.html#inte...

comment 2y ago · link · parent

At this point, internet is like electricity. Except that I have more choices for power providers than I do for internet. In my building in New York City, I have one option (cable via Spectrum), and the cheapest plan they offer is $80 per month.

It recently got a lot faster, which is nice, but I'd happily pay $30/month instead for a small fraction of the bandwidth. But I can't.

I wouldn't qualify for the hypothetical state enforced $15 option anyway.

comment 2y ago · link · parent

You would need someone high up in ISO to feel strongly enough about that to take the revenue hit.

My only experience with ISO standards is the C++ standard, and the community works around the price by making draft copies available for free.

This is a guess on my part, but maybe the majority use case for ISO standards is companies buying copies for their employees or maybe even lawyers. They _have_ to have a copy if they're going to have products that conform to the industry standards, so ISO can charge whatever they want and it's just a minor expense for the business. Compare this with the "hackers in mom's garage" image of software and you see the difference.

comment 2y ago · link · parent

I think it was Chandler Carruth who said "If you're not measuring, then you don't care about performance." I agree, and by that measure, nobody I've ever worked with cares about performance.

The best I'll see is somebody who cooked up a naive microbenchmark to show that style 1 takes fewer wall nanoseconds than style 2 on his laptop.

People I've worked with don't use profilers, claiming that they can't trust it. Really they just can't be bothered to run it and interpret the output.

The truth is, most of us don't write C++ because of performance; we write C++ because that's the language the code is written in.

The performance gained by different C++ techniques seldom matters, and when it does you have to measure. Profiler reports almost always surprise me the first few times -- your mental model of what's going on and what matters is probably wrong.

comment 2y ago · link · parent

"Ok I will!"

comment 2y ago · link · parent

What is another likely explanation?

comment 2y ago · link · parent

I use this [extension][1] with firefox. It makes "open image in new tab" actually open the image in a new tab.

[1]: https://github.com/nopperl/load-reddit-images-directly

comment 2y ago · link · parent

You can get a feel for how it works in this [section][1] of the wikipedia article. Have to know what things like "mass term" mean, though, so there's quite a lot of background required.

[1]: https://en.wikipedia.org/wiki/Higgs_mechanism#Abelian_Higgs_...

comment 2y ago · link · parent

It renders them correctly, just not always exactly the same as Chrome. It's hard to blame devs for not testing on a browser with so little market share.

Some Javascript or maybe Canvas heavy pages run much more slowly on Firefox and are almost unusable on Firefox for Android. I find that this is rare, though.

I'll keep using Firefox + uBlock + Personal Blocklist + Dark Reader + Disable Javascript + Disable CSS + Tampermonkey + Old Reddit Redirect + CORS Everywhere + Consent-O-Matic + Hide YouTube Shorts + Load Reddit Images Directly + ...

comment 2y ago · link · parent

They're not a monopoly, but they've vendor locked education, government, and much of industry. It's brilliant.

comment 2y ago · link · parent

LibreOffice isn't going to win any beauty pageants, but it does everything you need in an office setting.

Some specialists can't live without MS Excel and all of its extensions (banking), but that's not the common case. Common case is word processing, slide presentations, and task management (in spreadsheets).

comment 2y ago · link · parent

I saw an interview where Bill quipped "You know how we balanced the budget? We used a little thing called 'arithmetic'."

comment 2y ago · link · parent

Sean Carroll's pandemic era youtube series "The Biggest Ideas in the Universe"[1] goes into scalar fields and some gauge theory, but I don't remember if he covers the Higgs mechanism. Might be in one of the Q&A videos.

[1]: https://www.youtube.com/playlist?list=PLrxfgDEc2NxZJcWcrxH3j...

comment 2y ago · link · parent

Mice don't look like they feel jet-lagged when they run a fever.

comment 2y ago · link · parent

I wonder about the logistics of moving so many elephants such a distance, even if you do it gradually. Surely Botswana has better ways to spend the money.

comment 2y ago · link · parent

If we could ask the dog "death now, or try your luck on the street?" I assume it would choose the latter. Being a street dog is a hard life, but it's not all suffering. We kill the dogs because letting them roam free is an inconvenience to us. It's not an easy problem to solve, hence all the urging to neuter and spay.

comment 2y ago · link · parent

I think the parent comment was a joke along the lines of "bitcoin is for speculation and everybody knows it."

comment 2y ago · link · parent

I tried it but chickened out. It really just is a sqlite3 database in there, which is cool, but the layout was different from that described in the blog post I was following, and I didn't want to risk bricking a device I just paid hundreds of dollars for.

Hm I could have just backed up the database...

Anyway, I've bought some books with my account, so I don't mind the login.

comment 2y ago · link · parent

Stallman was right.

I have some smart relays that somebody graciously reverse engineered in Python. I still need the spyware app to "bless" a relay, but then it works over TCP (JSON) afterward. Could also skip the app but it's much more complicated.

I got an e-reader that you can drop epub files into (Kobo).

Basically, "control" is almost more important to me than quality, where electronics are concerned. And I'm not a hardliner.

It will only get worse.

comment 2y ago · link · parent

He also coauthored one of the classic textbooks on general relativity, [Gravitation][1].

[1]: https://en.wikipedia.org/wiki/Gravitation_(book)

comment 2y ago · link · parent

I'd be worried about what happens when the steam locomotive is complete and perfect in every way.

comment 2y ago · link · parent

There's no best answer. I do in manually in a `while` with `case` and `shift`. For anything more, I use environment variables or Python.

comment 2y ago · link · parent

First you write in shell without knowing the language, and blow your foot off. A few years go by. "I should use a _real_ language, I'm not an amateur anymore." So you write everything in Python. A few years go by. "I should learn shell, and use it only when appropriate."

Maybe this is what Perl is for, but I never learned it.

comment 2y ago · link · parent

I worked with a guy in a C++ RPC team (think Envoy, but proprietary). He wrote the build tool that was used by our team, which maintained several fairly large C++ programs and libraries. He wrote it all in C++. He was of the opinion that most scripting tasks on the team could be accomplished with a small C++ program. It helped that we had a portable kitchen sink of libraries at our disposal, but he wasn't above using std::system to avoid the hassle.

comment 2y ago · link · parent

> [The US gov] issued its warning several hours after the FSB, the main successor to the Soviet-era KGB, said it had foiled an attack on a synagogue in Moscow by a cell of the militant Sunni Muslim group Islamic State.

comment 2y ago · link · parent

In a sense, plain old diff is a structural diff. The grammar is a sequence of lines of characters.

All tree-sitter gives you is a _different_ grammar, so that a structural diff can operate on different trees given the same text as diff.

A parse tree still doesn't know anything about the meaning of a program, which is what you need to know in order to determine that those assignments to x and y are unordered.

comment 2y ago · link · parent

You can probably rely on backward compatibility of the language and use the "latest." The question is, which version is the grammar written against?
1
232425
38