HNHacker News
TopNewBestAskShowJobs

tpush

4,456 karma · joined April 13, 2014

submissionscomments
tpush··on Everything I wish I knew when learning C
That example doesn't contradict LegionMammal978's point though, if I understood correctly. He's saying that the 'time-travel' wouldn't extend to before checking the conditional.
tpush··on SwiftUI Is Convenient, but Slow
There are probably just more users of SwiftUI here than Flutter or Jetpack Compose (I think Apple in general is a bit over-represented on HN).
tpush··on GCC undefined behaviors are getting wild
Again, you still don't understand.

> It will happen and you need to deal with it when it does, and there are reasonable and unreasonable ways of dealing with that.

A compiler's handling of UB simply can't work the same way handling flag passing works in GCC. Fundamentally.

With GCC, the example is something like:

  if (strcmp(argv[1], "--help") == 0) { /* do help */ } else { /* handle it not being help, for example 'hlep' or whatever */ }

Here, GCC can precisely control what happens when you pass 'hlep'.

Compilers don't and can't work this way. There is no 'if (is_undefined_behavior(ast)) { /screw the user / }'. UB is a property of an execution, i.e. what happens at runtime, and can't _generally_ be detected at compile time. And you very probably do not want checks for every operation that can result in UB at runtime! (But if you do, that's what UBSan is!).

So, the only way to handle UB is either

1) Leaving the semantics of those situation undefined (== not occuring), and coding the transformation passes (so also opt passes) that way.

or

2) Defining some semantics for those cases.

But 2) is just implementation defined behavior! And that is what you're arguing for here. You want signed integer overflow to be unspecified or implementation defined behavior. That's fine, but a job for the committee.

tpush··on GCC undefined behaviors are getting wild
> What should happen when I invoke --hlep then? The program could give an error, could warn that it's an unrecognised flag. Could ask you if you meant --help. Infer you mean help and give you that, or it could give you a choo Choo train running across the screen. Or it could reformat your hard drive. Just because it isn't specifically listed as UD doesn't mean it's not. If it isn't defined then it's undefined. The question is what is the reasonable thing to do when someone types --hlep. I hope we can agree reformating your hard drive isn't the most reasonable thing to do.

I honestly don't understand the point of this paragraph.

> Am I? What's the reason for not defining integer overflow? Yes unspecified behaviour could be used to allow portability, but so can undefined.

Yes, you are confused about that. UB is precisely the kind of behavior where the C standard deemed it unsuitable to define as implementation defined or whatever, and it usually has really good reasons to do so. You could look them up instead of asking rhetorically.

> I'm not saying it shouldn't be UB. I'm saying there's reasonable and unreasonable things to do when you encounter UB. In the article the author took reasonable steps to protect themselves and the compiler undermined that. That isn't reasonable. In exactly the same way that --hlep shouldn't lead to my hard drive getting reformatted.

Again, you seem to fundamentally misunderstand how compilers work in this case. They largely don't "encounter" UB; It's optimization passes are coded with the assumption that UB can't happen. The ability to do that is fundamentally the point of UB. Situations like in the article are not a specific act of the compiler to screw you in particular, but an emergent result.

Additionally, I think you you're also confusing Undefined Behavior with 'behavior of something that is undefined'. These are not the same things.

tpush··on GCC undefined behaviors are getting wild
I think this is confusing undefined behavior with behavior of something that is undefined. And either way, the C standard explicitly applies to C programs, so even this cute "textualist" interpretation would be wrong, IMO.
tpush··on GCC undefined behaviors are getting wild
The "[...] executing that program with that input [...]" part maybe could be read as making it specific to a given UB triggering execution; but I'm no language lawyer :).
tpush··on GCC undefined behaviors are getting wild
> It is undefined behaviour if I write GCC --hlep

No, it's not, and I don't know why you'd think so. UB is a concept applying to C programs, not GCC invocations.

> UD is supposed to allow C to be implemented on different architectures if you don't know whether it will overflow to INT_MIN it makes sense to leave the implementation open. If I, the user knows what happens when an int overflows then I should be able to make use of that and guard against it myself.

I think you're confusing UB with unspecified and implementation defined behavior. It's fine if you think something shouldn't be UB, but you have to go lobbying the C standard for that. Compiler writers aren't to blame here.

tpush··on GCC undefined behaviors are getting wild
> If a situation has been statically determined to invoke UB that should be a compile time error.

That's simply not how the compiler works.

There is (presumably, I haven't actually looked) no boolean function in GCC called is_undefined_behavior(). It's just that each optimization part of the compiler can (and does) assume that UB doesn't happen, and results like the article's are then essentially emergent behavior.

See also: https://blog.regehr.org/archives/213

tpush··on Factorio runs on Apple Silicon
> [...] yet multi-billon dollar studios claim supporting anything beyond x86_64 Windows is an impossible feat.

Who actually claims that? The issue is more that the ROI just isn't there. Remember that porting to a platform incurs additional support costs that need to be payed.

tpush··on Atlas OS: A Windows version designed for gamers
> [...] she's never gotten any viruses after I hosed the Win Defender off her laptop.

How would you (or she!) know that?

tpush··on Considering C99 for Curl
> As someone tangentially involved in this, I think this was misguided.

Do you mean the removal of VLAs from Linux? Why do you think that was misguided?

tpush··on November 2022 Progress Report
> Are there not any linux laptops out there with decent build quality and comparable perf/battery life?

None that I've ever seen, especially now compared to M1 Macs.

tpush··on November 2022 Progress Report
> [...] even Microsoft does a better job here than Apple.

How so?

tpush··on C23 Implications for C Libraries
Presumably because the size of intmax_t was set to something specific on its introduction and changing it now would constitute an ABI break most everywhere.
tpush··on Minecraft Running on Asahi Linux with Open Source GPU Drivers
Already using Asahi Linux on my M1 Air; can't wait until the GPU stuff lands!

Extremely impressive work by all involved!

tpush··on Mozilla revenue 2021 increases 20%
Why not just look at market share across all devices? Which makes chrisseaton's point: Firefox sits at 3.26% as opposed to Safari at 18.61%.
tpush··on 99Wh Battery Linux Laptop
> I am able to squeeze 5% more battery from a MacBook Air 11'' Late 2012 using Linux vs macOS.

> The key aspect is to [...] use no desktop environment, [...]

Is this satire?

tpush··on KDE beats macOS
Not closing the app once all windows are closed is not 'legacy baggage', but intentional design. An app can do more things than just display stuff in windows, e.g. playing music, or downloading stuff.
tpush··on The sinister attempts to ‘decolonise’ mathematics
Because of the killing, torturing, enslavement and exploitation of human beings.
tpush··on I decided to stop working on Mighty
What's Figma got to with any of this? Figma is local compute just as much as any native app.

This is not about web vs. native but client-side vs. server-side rendering & compute.

tpush··on I decided to stop working on Mighty
Would be great if PG got more humble as a result, but something tells me that's never gonna happen.
tpush··on The latest OpenSSL vulns were added fairly recently
Could it be that you have a different openssl in your PATH shadowing the system one? Because I could have sworn macOS 12 also used LibreSSL.
tpush··on “There Seem to be 10 managers for every one dev at Twitter” – Elon
> Socialist are left-wing ideologue. And their name has socialist in it. Ergo they are left-wing.

I'm sorry, but that is among the most braindead takes I've ever seen on HN.

tpush··on Wild mammal biomass has declined by 85% since the rise of humans
> What is the point of restraint? To what end?

You know, stopping climate change. The thing that's gonna keep your grandchildren from eating meat at all if people don't stop consuming so much of it.

tpush··on Where did all the “reject” buttons come from?
Reject is the default! That's the point of the law in the first place. If you, for example, blocked every consent dialog from appearing, no website would have legal grounds to track you (except for legitime purposes yada-yada).
tpush··on Apple's sleeping advertising business
Counterpoint: The Apple News app. Even of you're a paying($10!) subscriber, the app is full of absolutely awful advertisement.

The current culture of Apple produced this app; it wouldn't surprise me if other properties of Apple start to embed ads.

tpush··on Linux M1 GPU driver passes 99% of the dEQP-GLES2 compliance tests
I don't think it really matters who's behind Lina.
tpush··on WhatsApp is more secure than iMessage: Mark Zuckerberg
He's not wrong in this case, though.
tpush··on Adults today care too much what young people think
> As far as I can tell it’s all going off the rails.

What exactly is "going off the rails" and how has that been millennials' fault? Be more specific, please.

tpush··on Improving Firefox Responsiveness on macOS
These scam apps are literally #1 in the App Store. The filter ist practically useless, if not outright harmful in this case.
← PreviousPage 6 of 27Next →