HNHacker News
TopNewBestAskShowJobs

_gabe_

1,843 karma · joined April 26, 2022

submissionscomments
_gabe_··on Progress toward a GCC-based Rust compiler
This is definitely not true. Whenever I have a question about a C++ language feature I typically go here first[0], and then if I’m looking for compiler specific info I go to the applicable compiler docs second. Likewise, for Java I go here[1]. For JavaScript I typically reference Mozilla since those docs are usually well written, but they reference the spec where applicable and I dig deeper if needed[2].

Now, none of these links are the specifications for the languages listed, but they all copiously link to the specification where applicable. In rare situations, I have gone directly to the specification. That’s usually if I’m trying to parse a subset of the language or understand an obscure language feature.

I would argue no one writes code against a compiler. Sure we all validate our code with a compiler, but a compiler does not tell you how the language works or interacts with itself. I write my code and look for answers to my questions in the specification for my respective languages, and I suspect most programmers do as well.

[0]: https://en.cppreference.com/w/

[1]: https://docs.oracle.com/javase/specs/index.html

[2]: https://developer.mozilla.org/en-US/docs/Web/JavaScript

_gabe_··on Beeper Mini is back
I didn’t mention this, because it doesn’t matter. I use an iPhone. I’m writing this on an iPhone. I use a MacBook. Why the heck should I care about my friends and family paying some “Apple status” fee to get an iPhone just so I can share pictures and videos with them?

> iPhone users mostly just want android users to get iphones. Doesn't matter why.

This is anecdotal. Where is the data proclaiming this? I’ve never personally met somebody that cares what brand of phone you have.

And I guess it should also be said, I don’t use drugs or anything. I just want to be able to message friends and family without pointless restrictions. I don’t know where you’re getting these ideas from.

_gabe_··on Beeper Mini is back
Nobody I know in the US uses WhatsApp. This has been repeated ad nauseam in other comments. I don’t know why this is, but in the US people tend to use the default message apps on their phones to text each other.

The only other app that I’ve seen used in several places is GroupMe, but that’s typically reserved for large groups (more than 10 people or so) that may include people you’re not friends with, but more acquaintances. So it’s been used for school classes, community groups, and things like that.

Me and my friends don’t care about green vs blue bubbles or any of that garbage. We just want to be able to communicate over the paid cellular plan that we already have. What happens in Europe has no bearing on this. All I pointed out by my comment above is that this is a problem and there are people that would like a solution.

And, not that this matters, I’m writing this on my iPhone. But, this is still an annoying problem to me because much of my family and some of my friends use android. Apple degrades my experience with family and friends for no technical reason. The only reason they do this, presumably, is to retain a large market share and promote some stupid “exclusivity” ideal that appeals to some people.

_gabe_··on Beeper Mini is back
It’s false based on what? Your own anecdotal experience? I have a friend group that has iPhones and Androids. We went on vacation and had to jump through so many hoops just to share our pictures. We don’t care what devices everybody uses, because why the heck should that matter?

The fact that it can be simple to share high fidelity pictures and videos, but it isn’t just because Apple wants their walled garden benefits nobody but Apple. So your claim that this is laughably false is easily refuted by my anecdotal evidence.

People that are friends or family with differing devices do exist. I know, it’s shocking. And it would be nice to have something as simple as messaging just work without all these stupid UX downgrades for no reason at all.

_gabe_··on Sorry, but a new prompt for GPT-4 is not a paper
I have no idea. The author of that tweet seems to imply that the results aren’t reproducible. I was just commenting to point out that the author’s intent may have been different from what the grandparent comment was saying.
_gabe_··on Sorry, but a new prompt for GPT-4 is not a paper
I feel like the author of this tweet wasn’t saying step-by-step isn’t worthy, he was saying that non-reproducible results are not science. He emphasizes this twice in that tweet:

> one experiment on one data set with seed picking is not worthy reporting

> Additionally, we all need to understand this is just one good empirical result, now we need to make it useful…

_gabe_··on You don't need JavaScript for that
> they work with screen readers, with increased font size, high contrast, and other less-known or unknown and even future use-cases and needs

Where does this idea come from? I’m seeing it all over these comments, and I strongly suspect this sentiment is coming from people that haven’t actually looked at WCAG or been tasked with creating a compliant accessible website. You can botch the contrast, hard code font sizes in pixels, and leave out pertinent navigation details for screen readers with plain HTML and CSS. Here’s WCAG if you don’t believe me (emphasis mine):

> Myth No. 9: Pages With JavaScript Cannot Meet WCAG 2.0: FALSE WCAG 2.0 was designed to allow many new modern technologies to be used and still provide accessibility. Pages with JavaScript can be made to conform to WCAG 2.0. It is also possible to write pages with JavaScript using the JavaScript in a way that would make the pages not conform. It is also possible to create a page using only HTML which do not conform.[0]

There is nothing about using JS that makes a site less accessible, and there is nothing built in to HTML to make a site automatically accessible. The only way you’ll have an accessible site is by testing it manually and bringing in users to find edge cases.

[0]: https://www.w3.org/WAI/GL/wiki/WCAG_Myths

_gabe_··on You don't need JavaScript for that
Disabling JS doesn’t magically make your site screen reader friendly. It’s entirely possible to create a shit layout that uses no JS and is just as horrible to use as a shit layout with JS. Likewise, adding JS doesn’t magically make your site non-screen reader friendly.

What actually makes a site screen reader friendly? Developers that actually write accessibility tests, tab through their site manually, open it with a blindfold and a screen reader to make sure they can navigate it, etc. This myth that no JS automagically enables accessibility needs to die.

_gabe_··on YouTube is now blocking ad blockers so I make ads run faster
Exactly. Which is why I feel no sympathy for the entitled complainers when google says enough and blocks the ad-blockers. As somebody that makes videos and makes a decent amount of money from it, I could care less about people that are so adamantly demanding free content getting cut off by Google. These people clearly don’t care about paying the subscription Google offers if they want to avoid ads, they clearly don’t want to watch ads to even support the creator, why would I care about having these people watch my videos?

It’s especially funny to see this sentiment on hacker news. “Those stupid content creators, clearly if they want to make money, just don’t use YT!”. I’m curious, what’s the alternative? Cable? Good luck. Udemy? What if I’m trying to make entertainment videos? Oh, I guess I could just build my own low latency highly efficient video hosting site and get a paid subscriber base that manages to cover hosting costs and make a profit! Yea, because that’s completely realistic…

_gabe_··on .NET Blazor
> over the years I've developed some insight in visual design and UX … Luckily, I've always worked with designers and people who are better at CSS

These two things are completely tangential. Translating a design into well structured HTML/CSS should not require any UX or design experience. In the same way, you don’t need to know HTML/CSS to create a good design and UX.

_gabe_··on YouTube blames ad blockers for slow load times, not the browser
If only there were an affordable subscription plan people could buy to avoid the ads? I do find it funny that people who make well over $100K a year will jump through so many hoops to avoid a $20 a month subscription cost. Then, when YT finally says no more and makes the experience worse for these people, the justifications and complaints start rolling out like there’s no end!

And if you only watch YT occasionally, meaning the subscription isn’t worth it, then I think watching a couple ads for the 1-2 videos you watch a month is a great compromise! I watch YT all the time, and the ads are not excessive compared to cable, or heck, even popular streaming nowadays! The new streaming platforms make you pay a subscription, give you reduced video quality, and have the gall to slap you with a ton of ads!

One final note (that I’ve mentioned on HN before): the channels on YT have full control over whether or not ads play, and where and when the ads play. Of course the channel owners won’t publicly announce this, because it’s much easier to let YT take the PR hit for the ads. And because I know it will be asked why I’m any sort of authority on this, I have a channel with 50K subscribers and have experimented with turning ads off on particular videos to see if YT respects that decision, and they do.

_gabe_··on Push ifs up and fors down
I know this is a late response, but this still doesn’t really make sense to me. What stopped you from placing the break point at the start of the function, before the return values were hit and stepping through the code?

In my experience, having multiple exits is even better because I can check which edge case is being hit by placing multiple breakpoints, or a breakpoint at a specific exit I want to check. I understand the pain of having to step through the code to get back to a certain execution point, but I’ve never been in a situation where multiple exits caused such cognitive load as to hinder that process further.

_gabe_··on The big TDD misunderstanding (2022)
Why does testing behavior matter? I don’t care if my tests exhaustively test each if branch of the code to make sure that they call the correct function when entering that if branch. That’s inane.

I care about whether the code is correct. A more concrete example; say I’m testing a float to string function, I don’t care how it converts the floating point binary value 1.23 into the string representation of “1.23”. All I care about, is the fact that it correctly turns that binary value into the correct string. I also care about the edge cases. Does 0.1E-20 correctly use scientific notation? What about rounding behavior? Is this converter intended to represent binary numbers in a perfect precision or is precision loss ok?

If your tests simply check that you call the log function and the power function x times, your tests are crap. And this is what I believe the parent commenter was talking about. All too often, tests are written to fulfill arbitrary code coverage requirements or to obsequiously adhere to a paradigm like TDD. These are bad tests, because they’ll break when you refactor code.

One last example, I recently wrote a code syntax highlighter. I had dozens of test cases that essentially tested the system end to end and made sure if I parsed a code block, I ended up with a tree of styles that looked a certain way. I recently had to refactor it to accommodate some new rules, and it was painless and easy. I could try stuff out, run my tests, and very quickly validate that my changes did not break prior correct behavior. This is probably the best value of testing that I’ve ever received so far in my coding career.

_gabe_··on Push ifs up and fors down
Why is multiple method exits hell to get through with a debugger? I use a debugger for my C++ code all the time and I’ve never run into an issue because of multiple returns.
_gabe_··on HTML First
I don’t understand why you’re bringing HTMX into this? This is a blog about HTML first, and the comment I originally responded too seemed to imply a more traditional MVC or SSR site was the way to go. It feels like you’re just searching for a “gotcha” argument at this point and not arguing in good faith.

My whole argument can be succinctly summed up by this comment from a different Hacker News user from when React was first announced:

> One of the biggest problems with the web platform is that we've spent the last 20 years trying to shim applications into a document framework. HTML was designed to help academics share research papers, not to replace native thick-client applications, yet that's the direction it's been evolving towards.

> I'm really happy to see Web Components (inc. Polymer, Angular, x-tags, and React) landing into HTML. If we accept that web apps != web pages at a spec level, hopefully we can build an awesome platform on which to create tools that leverage all the great parts of the web (linkable, available, auto-updating, device-agnostic) without the mess that we've made trying to make the web do something it wasn't designed for.[0]

This sentiment, after 10 years, is still spot on. The web isn’t academics sharing research papers anymore. Interactive web apps, whether you like it or not, require a ton of client side state management. React was developed to address concerns with managing that state and improving performance where HTML5 fell short. It still succeeds at that.

Of course, if you have a static site, don’t use React! But let’s not pretend there’s no use case for it either. There’s tradeoffs. And I’ll repeat that til the end of time. No matter what you choose, there’s tradeoffs.

[0]: https://news.ycombinator.com/item?id=5789055

_gabe_··on HTML First
> almost real-time connectivity with a database

If only they actually worked like this. I’ve experienced, as I’m sure many other people have, problems booking flights, lodging, buying tickets, etc, where when I go to checkout it fails because I was too slow. It’s also much faster to only request smaller pieces of data if you can, instead of resending an entire web page and then re-rendering the whole web page.

All that to say, there are tradeoffs. Finding the solution with the best latency and the best experience requires a careful analysis of all these details and figuring out which approach (or combination of approaches) solves that problem the most efficiently. Of course it’s not easy, but nothing you’ve said here indicates one solution would always outperform another solution.

_gabe_··on HTML First
> the more it benefits the development team to write that code in their language of choice on the backend

Why?

TS is maintainable and very pleasant to code in. Most people’s computers are way faster than making round trips to a server. You talk about serializing everything to/from JSON, but my phone can do that in milliseconds (if not faster). Compare that to 100-200ms of latency between a faraway server, and all of a sudden doing things client side makes sense.

Engineering is all about tradeoffs. I’m tired of people trying to make blanket statements like “React is always better”, or “SSR is always better”. It’s not, and we know it’s not. There are several successful, performant, maintainable apps written using React. There are plenty written using a backend framework and SSR too. Heck, there’s successes that use both!

The common denominators in the success stories? Competent engineers. And I expect a competent engineer can analyze requirements and determine what would be the best outcome for their target users. A booking site absolutely benefits from a front end framework that handles client side logic. It probably also benefits from a clever backend for processing the data after the user is finished with it. Let’s not pretend there’s a one sized solution that fits everything, because there isn’t.

_gabe_··on Albert Einstein in 1939 composed a message for the people of AD 6939
Perhaps you’re being a bit too uncharitable to overcompensate?

I’ve never heard of this, and the only sources I can find for the claim you made about mother Teresa make claims that the organization that mother Teresa started would refuse patients pain medication out of misguided notions. I’m curious what specifically you’re referring to here.

And as for:

> FDR was a racist that put Japanese Americans in camps

I wouldn’t go so far to say that FDR was racist for doing this. America was literally bombed and dragged into a war, and other countries were also placing civilians in internment camps. From Wikipedia:

>> Japan interned 130,000 Dutch, British, and American civilians in Asia during World War II.

Does this mean the Japanese were racist? No. This was world war, and countries were doing this as a source of leverage.

I don’t know about the rest of your examples, but I feel like you may be being a bit uncharitable in your characterization of these circumstances.

[0]: https://en.m.wikipedia.org/wiki/Civilian_internee

_gabe_··on How Wikipedia became the last good place on the internet
Here’s an article from Larry Sanger (original creator of Wikipedia) giving the case for why Wikipedia is biased https://larrysanger.org/2020/05/wikipedia-is-badly-biased/ .
_gabe_··on M3 Macs: there's more to performance than counting cores
I’m not about to factory reset my machine to see what the defaults are, but I haven’t messed with any settings. It’s probably just another bug.
_gabe_··on M3 Macs: there's more to performance than counting cores
I think the buggy apps and UI isn’t emphasized enough on Macs. I honestly can’t remember the last time I was on Windows and performing an action failed to give me any visual indicator whatsoever that something happened, but that’s common on my M2. I’ll click something, have no feedback, and then a few seconds later the thing happens.

Just a couple concrete examples, if you open an app in a workspace, then switch screens to a different workspace, then click the app in the dock, nothing happens. I would expect to be taken to the screen and have the app made visible, but instead, nothing. I kept thinking that the app must be frozen or something until I switched screens and found it.

Another example, I was carrying my laptop to and from work. I put it in my backpack with padding that protects the laptop. I didn’t jostle it around, I literally just carried it to and from work. I get home and the screen is in some sort of weird flickering bugged out state. I had to forcefully restart it just to get it working again.

With all that said, the trackpads and gestures on Macs are amazing. The displays are also very visually appealing. The performance is good.

_gabe_··on My rude-ass car
My 2019 Honda Accord doesn’t make me look at a screen to turn on defrost. But it does have a screen conveniently placed with directions and a map! And that screen reads my messages to me and even allows me to speak a response without ever taking my eyes off the road!

There are plenty of modern cars with a very pleasant mix of tactile controls for things like AC, radio, defrost, etc, while also having lane keep, cruise control auto distance thing, and a screen with a map. There’s a ton of new technology that I love in my newer car, and I’m very glad I’m not driving my crappy 2004 CRV anymore.

Edit: I forgot about the backup camera. The backup camera is also amazing. It gives me way more visibility then just trying to look out my window, and it gives me visibility if I’m parked between giant cars.

_gabe_··on Home schooling's rise from fringe to fastest-growing form of education
Baptists are very different from Catholics which are very different from Protestants which are very different from Church of Christ. Sure they’re all Christian, but the beliefs/cultures vary a lot between different denominations which is what I assume the two parent comments are pointing out. If you think you can collectively call American Christianity one religion, then you haven’t experienced different sects of the church. Believing in Jesus is the only common denominator.
_gabe_··on 'It's quite soul-destroying': how we fell out of love with dating apps
> the "joke" implied intimacy in said meal.

No, the joke is literally that it tastes better because I’m not worrying about the fine details. You are your own worst critic and all that. When somebody else makes it, you can enjoy the food for what it is and don’t find yourself focusing on the flaws.

And I don’t think I’m missing the forest for the trees here. The whole argument hinges on, “things are innately better if I put more work into it”, which I don’t believe is true. In the specific example of ready made meals vs a meal being cooked personally, the quality of the food has no bearing on how much work it took you to prepare it.

And this is trivially provable. Wealthy people that have personal chefs certainly don’t have a lower quality of life even though they don’t personally prepare every meal. Of course McDonald’s everyday will lower your quality of life, but going to fine restaurants won’t. All of these have vastly different levels of effort involved, but the effort involved doesn’t correlate to quality of life.

_gabe_··on 'It's quite soul-destroying': how we fell out of love with dating apps
I can’t believe this is getting downvoted. I wonder how many people who downvoted cook for themselves 100% of the time. I’ve never met anybody that does that. Usually you trade cooking nights with a spouse or roommate. You occasionally go out for a nice meal. You use preprepared ingredients.

Is a ready made meal from a spouse worse than a meal cooked by yourself? Is a frozen store bought dinner worse than a pre-cooked meal that you personally cooked and froze? Is a meal made by a chef at a nice restaurant worse because you didn’t cook it yourself? This standard is ridiculous.

It’s especially funny to me, because there’s a running joke in my family that a meal cooked by somebody else always tastes better than when you cook it yourself.

_gabe_··on Was Rust Worth It?
> First of all, and most importantly, we're not talking about Undefined Behaviour, which happens at runtime, but about IFNDR

From the link I posted, from cpp reference, which gives a definition for what constitutes undefined behavior:

>> ill-formed, no diagnostic required - the program has semantic errors which may not be diagnosable in general case… The behavior is undefined if such program is executed

And as for the rest of your argument, you still haven’t answered the one question that matters. Is an executable file with machine code well-defined? If it is, then once you compile a C++ program, the generated binary is well-defined. And once again, all the superfluous arguments about what could happen are irrelevant when there’s no context provided. There’s lots of different types of undefined behavior. An integer overflow by itself does not make your program susceptible to remote code execution. It’s the fact that the integer overflow gets stored in a register that later gets used to write to invalid memory, and then that invalid memory has harmful code injected into it that gets executed.

We should strive to engineer correct software. I agree. It’s all this hand waving about how all undefined behavior is equal that irks me. Because it’s not true, as evidenced by the example listed above about the program that’s “technically” ill-formed C++, but in practice compiles to a harmless program. Engineering requires an understanding of what could go wrong and why. Blindly fretting about all undefined behavior is useless and doesn’t lead to any sort of productive debates.

Engineering is all about understanding tradeoffs. Which is one of the reasons the C++ spec does not define everything in the first place. The fact that in 2023 people don’t understand that all decisions in software come with a tradeoff is lunacy. And once again, I agree that undefined behavior is bad, but to pretend that the existence of IFNDR means the whole language is unusable is silly. People use C++ everyday, and have been for almost 40 years. I’d like more productive conversations on how rust protects the user from the undefined behavior that makes an impact, not about how it doesn’t have IFNDR because that’s irrelevant to the conversation entirely.

[0]: https://en.cppreference.com/w/cpp/language/ub

_gabe_··on Was Rust Worth It?
> Thus, the compiler theoretically has the liberty to emit whatever it wants for this program.

In theory, sure. In practice, what does it do? We can look and see.[0][1][2] (I don't know of any compiler that emits garbage in the example you listed). For some reason, there's this sentiment that's arisen that treats undefined behavior as some sort of bugaboo that's capable of anything and everything (including summoning nasal demons).

Here's a question that I can't find an answer to. Is machine code well-defined (as in, can it contain undefined behavior)? If the answer is yes, then all Rust programs can also contain undefined behavior, because they eventually turn into machine code after all. If the answer is no, then that means once a C++ program is compiled into machine code, the executable is a well-defined program.

This whole nasal demon garbage was a good hyperbole at the time to explain that, yes, undefined behavior is bad. But it's been taken to this extreme where people will use arguments like this to try and convince others that if your program has undefined behavior, then it could summon a nasal demon, because who knows what could happen.

In reality, that won't happen. In reality, a signed integer overflow can result in a meaningless program, or a security vulnerability, or many other bad things, but it doesn't mean that the compiled machine code is all of a sudden inventing new instructions at random that the CPU will happily accept. It doesn't mean that your program will turn your OS into a pac-man game. It doesn't mean that it's impossible to find the root cause of the issue and remove the undefined behavior.

In practice, undefined behavior means that your program is broken, but you can look at the compiled program and trace exactly what it does. Computers are machines, they behave predictably (for the most part). They fetch an instruction, execute the instruction, and read/store results to memory. If you look at the instruction and memory (the cache stored on the specific core that the processor is using), you can reliably predict what the CPU will do after executing that instruction.

And yes, multithreading exacerbates the effects undefined behavior and makes it more difficult to debug. But you can debug the issue, even if it means you have to look at the machine code directly.

So while, yes, a compiler can emit garbage when it encounters the example program you gave, using that as an argument for why undefined behavior is bad is dumb. Because in reality, compilers will do something that makes sense, and if it doesn't, you can just look at what it produced. In all the examples you listed, I'm sure that if you created a small example illustrating those situations, the compiled program would do what you expect it to. (Like in the case of having different default args, it will probably just throw an error like this[4]).

Sorry for the rant, it just annoys me that we can't discuss undefined behavior without somebody making an argument that doesn't matter in virtually every case. Undefined behavior is bad! But there are good, real, common examples that show why it's bad! Use those instead instead of talking about how compilers are technically permitted to spew trash when they encounter a program that looks normal, because I'd be very surprised if any modern compiler exists that does spew trash for a normal looking program.

This talk by Chandler Carruth seems pretty good on explaining the nuance of undefined behavior[5].

[0]: https://godbolt.org/z/zv4GhPK5E

[1]: https://godbolt.org/z/6obn7134G

[2]: https://godbolt.org/z/33cKcx5xs

[3]: https://en.cppreference.com/w/cpp/language/ub

[4]: https://learn.microsoft.com/en-us/cpp/error-messages/compile...

[5]: https://www.youtube.com/watch?v=yG1OZ69H_-o

_gabe_··on Was Rust Worth It?
Can you give an example of non-C++ code that a modern compiler (MSVC, clang, g++ or something) successfully compiles with no diagnostics? I’m genuinely curious. If not, this just sounds like more C++ FUD because the spec doesn’t define everything under the sun and allows a certain amount of leeway to compilers for things like emitting different error diagnostics.
_gabe_··on Software disenchantment
> How many users pick one solution over another because it's quicker?

Isn’t that what drives the most sales in upgrading a phone? Idk many people that care about the microscopic improvements to the camera or UI, most of the time it’s something along the lines of “my iPhone 8 doesn’t run fast enough anymore, time to upgrade”. Same with consoles. I remember one of the big pitches of next gen consoles being “look! No more loading screens!”. And even ChatGPT 3.5 vs ChatGPT 4. There are tons of people that will use crappier output because it’s faster. Speed is still absolutely a selling point, and people do care.

_gabe_··on Flappy Bird implemented in TypeScript types
Isn’t every programming language simply a spec? C and C++ are infamous for just being a spec, with lots of undefined portions resulting in undefined behavior. And if every programming language is a spec, should we inhibit the flexibility of what you can do in them? (I think the answer here is no, but maybe there’s a good reason for limiting what you can do)

Edit: Additionally, it takes very little to define a specification that leads to emergent behavior. That’s not necessarily a bad thing. It’s been awhile, but all you need for a turing machine is a way to store and read memory, and move the tape (instruction pointer) if I remember right. If that’s correct, you can come up with an infinitely complex machine with 3 instructions (provided you have an infinite amount of tape).

← PreviousPage 4 of 19Next →