Hacker Newsnew | past | comments | ask | show | jobs | submit | foota's commentslogin

https://sunshowers.io/posts/cancelling-async-rust/#the-pain-... was the most interesting part of this for me, as I can totally see making mistakes like this.

I'm a Go developer and this was still useful for me! Obviously Rust devs are more accustomed to more assistance from their tools than Go devs, but just about every gotcha listed is something that can happen in Go with goroutines, channels, select, and other shared concurrency primitives.

!m schmichael

This is a bizarre take to me, what do you want to do with classes that aren't supported by structs and traits? Imo the usability issues with rust arise from the borrow checker and associated complexity + restrictions on patterns, so I'm surprised that you're citing macros and classes.

Access control.

Here's a struct that maintains an invariant - say, that field a is less than field b. That invariant should be set when it is created.

You find a bug where a is greater than b. Where is the bug? With a struct, it can be anywhere in the code - any line that touches the struct. But with a (well designed) class, a and b are private, and so you only have to look at lines of code within the class. The surface area where the bug can be is much smaller.

The bigger the code base and the more well-used the class is, the more this matters.


Rust has privacy and encapsulation just fine. More than that, Rust's entire safety story is built on these mechanisms; being unable to (safely) access private fields outside of the module in which they were defined is load-bearing when it comes to safely encapsulating unsafe code.

You can do exactly this in rust using non public fields and accessor methods.

I think the large C++ or Java shaped hole in your understanding is simply that you think "class" means encapsulated and "struct" means Plain Old Data and in Rust that's not what it means.

Take std::os::fs::OwnedFd the file descriptor. In fact of course this struct is literally just a C-style integer inside, it's the same size in memory, representationally they're identical. But, it's encapsulated, so it gets to enforce the fact that file descriptors are never -1 by definition, and since it is encapsulated it gets to refuse to participate in arithmetic, and to call close when we throw away the file descriptor, and so on. It's a huge improvement.


Ah, that makes some sense, although some reading says that struct member visibility is by default the module, which is a file if you don't do anything. If you wanted you could probably just wrap all the structs you want to be protected inside a module per file? It is a bit annoying though. I guess the issue here is that in rust struct fields need to be accessed for trait implementations. It wouldn't be backwards compatible obviously, but I wonder if they could have tightened that so that by default only trait implementations for a struct can access that structs members?

Rust has exactly that. The difference is that rust considers the scope of private access te be the entire file it's defined in, not just its methods.

Just the module the struct is defined in, not the file. Easy mistake to make, given that a file is implicitly its own module, but you can create submodules within a file with the `mod` keyword.

I thought it crossed into submodules as well, making it the entire file?

Rust has access control, and rust has better mutability and reference control. Many languages like C# and Java let you take references willy nilly and do almost whatever you want.

Rust has access control. Fields are private by default.

I'm confused too! When I write Python, I do it in a similar style as rust, but knowing the classes and enums are sloppier than rust's; regarding mutation for example.

So apps like Google maps do this? I'm always surprised when it jumps between roads. Like... You knew I've been on this road for the last ten minutes, you think I'm going to teleport into the tunnel beneath me?

I'm not sure about Maps to be honest, but that sort of glitch is a strong indicator that they're just snapping to the nearest current road rather than doing proper routing calculations.

My Toyota has a speed limit symbol on the dashboard which will occasionally show the speed of a slip-road going onto the motorway I'm already on. I'm guessing it's a similar phenomenon.


The latter would feel like actual scifi to me.

I'll take shipping the org chart for a thousand Alex.


I'm fairly certain they're shotting down drones with bullets in Ukraine. See for instance: https://www.youtube.com/watch?v=AkkdWu7Xt7o


> Hosted Linux for Driver Support

> In order to avoid porting thousands of device drivers, we would like to port QEMU to Redox, then run a stripped-down Linux to provide device drivers for less common and older devices. The interface between Redox and Linux-in-QEMU will be designed to be secure, so this approach should give us reasonable safety.

What a fascinating approach to this.


I used to do something very similar with old serial to usb adapters on a newer linux machine and a windows xp guest, it's more common than you might think and rarely unpredictable. The only concern to me would be supporting the incoming protocol as a passthrough (e.g. SCSI or Parallel) though they could just be handed over at the PCI/ISA level if that could be done.


How do you set up the interface "back" to the host?

Is it something like:

USB directly to the guest OS, then an emulated serial port in the guest OS back that the host OS connects to?


right, I have a hub that I connect it to because (shocker) my computer lacks any usb-a ports, so I just pass through the hub, and the serial children it contains are passed through. I just wish the same could be the case for firewire, I'm not willing to pony up the cash to make the dongle from hell (fw400-fw800-tb2-tb3) that may allow thunderbolt passthrough(?)


the prior art in this area is going to be PCI&USB passthrough implemented in qemu and xen, with related but separate in-guest or 'in-host' virtual devices representing the bridged device.

Some related work in the SR-IOV & iommu space makes this a lot easier to implement as well. I would be very surprised if zero new security edge cases get discovered in the next five years or so however. Regardless, I'd look forward to seeing the results of RedoxOS's work here, as this would be a practical alternate implementation of driver domains like you see used in Xen and Qubes.


I agree, as we get even further away from the 90s and 2000s and data gets more valuable, having mechanisms like this to access old systems is vital now that it's getting harder to make "missing link" type machines that have parallel/scsi/ATA/FW/etc. to dump old data


HarmonyOS NEXT already does something like this for driver support and I believe real phones already use it.


I saw this timeline a while ago: https://www.reddit.com/r/waymo/s/mSm0E3yYTY that shows their timeline in each city. Shows Atlanta at just over a year. I think once they've handled similar cities it gets easier and easier to add new ones.


What's the median pay of big tech workers? I started at 150k 8 years ago as a new grad, for comparison.


OP's comment still makes no sense then. H1bs are not hollowing out "middle class" wage earners then - the most you could say is that they are slightly reducing income of high-income earners.

But also, the H1b median salary for a software engineer is ~$120k, which is almost identical to that of the US median overall - so all of this hullabaloo seems pretty groundless.


<< the most you could say is that they are slightly reducing income of high-income earners

First, I would like you to reconsider 'high income' and putting $120k in that category. It was a good chunk of change. In this year of our lord 2025, it is not. It is, for my region anyway, barely acceptable middle class income.


The median income in San Francisco is $69k. In New York City, it's $41k. Median household incomes are ~2x those numbers.

A $120k job in any region of the country is 'high income'. You are feeling a different effect, which is that we have designed our country such that even high income people often do not feel economically secure.


Stop. Just because that is the median income does not automatically make it high. The value of the income comes from what it is able to purchase. That value has been steadily eroded over the year. If anything, it is indictment of the existing system. If anything, the proper way of looking at it is that the actual value you are able to get for your work has been greatly reduced. The number is meaningless to anyone, who is able to look at basic reality ( or does not depend on status quo for one reason or another ).

The sheer balls on people to suggest that high absolute value automatically means it is high. And that is before we get to how those jobs are are not even in the same category...

I am going to stop here, because I don't want to get mean.


If you barely consider yourself middle-class with an income 50% over the median then you are probably at least living in a "high income" region :P

And your self-classification is questionable, but that is very common. Maybe a good trigger to experience gratefulness and satisfaction for the economical situation you are in?


IMHO The ability to choose to live in a high income region (or more specifically a cosmopolitan city) is one of the core characteristics of what it means to be middle class.

Partially, that's because increased self determination is part of being middle class. Partionally, that's because the ability to participate in culture (art, music, education, multiculturalism, etc.) is part of being middle class; and those opportunities are highly concentrated in the cities.


I think you misunderstand me greatly and, more importantly, greatly misunderstand the zeitgeist. I am unbelievably thankful for being paid for what I am doing the amount I am paid.

But, and this is the most important part, just because I am in better situation than most, does not make the overall state of the population that much less shitty.

Am I getting through to you?


> does not make the overall state of the population that much less shitty.

Has it ever been better?

Not saying it shouldn't, just that we might have unrealistic expectations.


<< we might have unrealistic expectations.

I deleted longer response from yesterday. Long story short, I disagree. If anything, it is unrealistic for anyone to expect that current economic ecosystem is sustainable.

I don't expect a lot, but I do expect my standard to improve over that of my parents', not decrease.


Housing affordability was better from 2009-2021 than now. https://www.atlantafed.org/research/data-and-tools/home-owne...

Total national health expenditures have grown much faster than population growth: https://www.healthsystemtracker.org/chart-collection/u-s-spe...

And yet, over the same time period, life expectancy hasn't gone up that much: https://datacommons.org/tools/visualization#visType%3Dtimeli...


Pretty much. All this did is now create a thousand talents program for India.

H1B visa abuse by consultancies and mass recruiters is a real issue, but this now incentivized companies like Google, Meta, Microsoft, Pfizer, Cheveron etc to expand their Indian offices.

Edit: can't reply

> Was there any reason for them not to? It's cheaper than H1B anyways.

Spending an additional $10-15k in visa filing fees isn't that big of a deal for an employer who's already paying around 25-35% in withholding and benefits, but at $100K that makes it enough that if you needed to sponsor 10 people on an H1B, you now hit the monetary amount to avail GCC tax rebates and subsidies in most of Eastern Europe and India, where they will give you an additional $10-20k in tax credits and subsidies per head.

Basically, opening a new office abroad just to save on $10-15k of filing fees per employees wasn't worth it, but now that it'll be $100k per employee, the math just shifted.

> Why is this parasitic organization allowed to incorporate?

VC now, not a director anymore. But help me find a new grad with 3-4 years of exploit development and OS internals experience in the US. I can't.

On the other hand, I can in Tel Aviv. There's a reason the entire cybersecurity industry has shifted outside the US.

Large sectors of the US tech scene just lack ANY domestic know-how.


"...to expand their Indian offices."

Was there any reason for them not to? It's cheaper than H1B anyways.


Because being in roughly the same timezone as the people you’re managing is underrated.


This is mostly just a benefit for mixed teams. If you have entire departments offshore, then you have less cross-zone interaction.


Does it matter for a company at the size of Google?


Yes, as platform teams are generally colocated somewhere else.


OK. But I'm not fighting against them for jobs here. I'm not fighting against H1Bs who are willing to put up with different shared housing situations than I am for housing here.


So you’re going to hire foreigners in the US or you’re going to ship the whole operation overseas. Why is this parasitic organization allowed to incorporate?


The median is actually $133k per the BLS.

The upperbound for middle class pay is over $100k in all states, approaching $200k in a couple.


How many H1B workers do the WITCH companies employ? They are definitely competing with the “middle class”.



"Critics, including many U.S. technology workers, argue that it allows firms to suppress wages and sideline Americans who could do the jobs."

I don't know many tech workers who criticize H1B visas, outside of maybe the way that they empower the employer over employees.


How many American tech workers know anything about h1b? It's not like your employer tells you who is who.


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: