Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
haileys
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
6 ms
·
31.
▲
by
haileys
2y ago
> Is this why Germany has no globally relevant software (or hardware tbh) companies founded in the last 40 years? Ableton, Native Instruments, SoundCloud, TeamViewer
32.
▲
by
haileys
2y ago
SomaFM is some of the best of the internet. There's no ads and you don't need to sign in. You can just stream it without faff. Try opening your browser's console, network inspector, etc. and see what happens when you try to p
33.
▲
by
haileys
2y ago
Windows 9x existed at a very different time. PCI wasn't a given. Plug and play wasn't a given. You couldn't even reliably enumerate all hardware on a system. Hardware detection back then involved a lot of poking at random IO
34.
▲
by
haileys
2y ago
When a type is 'static, it doesn’t mean it’s leaked for the lifetime of the program. It just means it owns everything it needs and doesn’t borrow anything. It will still free everything it owns when it is freed.
35.
▲
by
haileys
2y ago
`boost_write` doesn't appear to validate the length of the user supplied buffer before casting and dereferencing either, so that's a kernel-mode OOB read. Not sure how exploitable this actually is though.
36.
▲
by
haileys
2y ago
This is pretty normal for Rust code that FFIs to external libraries. There's a lot more complexity in writing FFI code - you have to think very carefully about everything you do. Case convention is a triviality here.
37.
▲
by
haileys
2y ago
> This sucks. We think it sucks. You think it sucks. But we can't fix it: Apple has to do so. And this is why I gave up on macOS several years ago now and moved to Linux. It's not about which OS is better or worse. All softwa
38.
▲
by
haileys
2y ago
Yes. A lot of the work I've done through my career is essentially this, once you boil away the rest of the details.
39.
▲
by
haileys
2y ago
The problem is that, when you're implementing a foreign trait for a foreign type, you usually want that impl to then be visible to a foreign crate. Not just the local crate. If it were good enough to only have that impl be visible to t
40.
▲
by
haileys
2y ago
The way to do this in idiomatic Rust is to make a wrapper type that implements drop: struct MyForeignPtr(*mut c_void); impl Drop for MyForeignPtr { fn drop(&mut self) { unsafe { my_free_func(self.0); }
41.
▲
by
haileys
2y ago
> In Rust we have Option<T>, which is equivalent to T | null No, not true! As the author correctly states earlier in the post, unions are not an exclusive-or relation. Unions are often made between disjoint types, but not always
42.
▲
by
haileys
2y ago
email, IRC, BitTorrent, DNS, BGP
43.
▲
by
haileys
2y ago
Don't output ANSI colour codes directly - your output could redirect to a file, or perhaps the user simply prefers no colour. Use tput instead, and add a little snippet like this to the top of your script: command -v tput &&g
44.
▲
by
haileys
2y ago
Asynchronous IO isn't about efficiency. The approach the author takes with their language is just threads, but scheduled in userland. This model allows a decoupling of the performance characteristics of runtime threads from OS threads
45.
▲
by
haileys
2y ago
Speaking from practical experience, bindgen is a particularly heavyweight dependency. It requires libclang to be available and also adds a considerable amount of time to the compile. If it makes compiling the software easier - and end use
46.
▲
by
haileys
2y ago
Thanks for taking the time to comment here! > So then he breaks the build by switching to the packaged version of bindgen, an old unsupported version. Could bcachefs-tools solve this problem upstream of distros by releasing a source ta
47.
▲
by
haileys
2y ago
It remains a problem for source packages, which are an important part of Debian necessary for offline and reproducible builds.
48.
▲
by
haileys
2y ago
I think this is the same shape of issue that I’ve experienced with Debian for as long as I’ve used it - close to 15 years now. Debian is a great OS, but it targets stability and long term support for its releases. That just isn’t compatible
49.
▲
by
haileys
2y ago
> So much of the internet is paid for through ads. And look where it's gotten us.
50.
▲
by
haileys
2y ago
> Smart people realised that in open market profits will go to zero as competition increases. This has been observed and written about since at least the 18th century
51.
▲
by
haileys
2y ago
Lots of public housing of a decent standard. The problem is that people, unless they can afford to buy, are forced into renting from a private landlord and working to pay off someone else's mortgage. If you have enough livable public h
52.
▲
by
haileys
2y ago
> Casting to a pointer from an integer should probably be considered generally unsafe. The pointer can't be assumed to be valid anyway without other guarantees. It could have been valid at some point, and then freed at another poi
53.
▲
by
haileys
2y ago
Exactly. So you must use Rust's encapsulation features like modules and visibility to ensure that any particular piece of unsafe code _cannot_ receive a pointer that can't be proven to be valid.
54.
▲
by
haileys
2y ago
> I kind of wish that this pointer casting required unsafe, just because this code should send up red flags, and probably deserves a close look during code review. If a pointer cast performed in safe code can cause unsoundness in unsaf
55.
▲
by
haileys
2y ago
There are hard plastic containers, like regular reusable food containers, that have good seals and little vacuum pumps on the lid. You actuate the lid pump a bit and it removes enough air from the container to keep food for a bit longer. It
56.
▲
by
haileys
2y ago
vacuum containers
57.
▲
by
haileys
2y ago
Yes disabling HTTP would prevent keys being sent if the remote end isn't listening, unless TCP Fast Open is in use, which it is not by default.
58.
▲
by
haileys
2y ago
> But Mary’s Walk should have an apostrophe no matter what you say Where I live we have a major road called the Princes Freeway/Highway. The name originally came from "Prince's", but the apostrophe got dropped a lon
59.
▲
by
haileys
2y ago
Yes, a smarter mix of options is the way to go. Cars are a one-size-fits-all approach that can't hope to achieve what we need for a sustainable future. In Perth, Australia, two thirds of all car trips are for distances of less than 5 k
60.
▲
by
haileys
2y ago
No. EV adoption is an important goal for the car industry's survival. If we're talking about the species' survival, I sure hope we can adopt a broader vision than taking a land-hungry and energy-intensive mode of transport, a
More ›