HNHacker News
TopNewBestAskShowJobs

ChrisSD

7,318 karma · joined August 5, 2017

64b2ffe4-6461-4f2e-9258-2a1839d40720
submissionscomments
ChrisSD··on Simple Is Not Small
I think the point was more that it's hard to compose shell utilities to make something new that's not supported out of the box. Instead you do have to write an entirely new utility and use that.

That said having key/value semantics and not just stream of bytes would make the shell much more versatile, at the cost of making it bigger.

ChrisSD··on You Know GDPR Is Good Based on Who Hates It
Note that GDPR did not mandate the cookie banners we see everywhere today. Those are a form of malicious compliance. Their goal is not to conform to regulation but to undermine the regulation itself in the eyes of the public.
ChrisSD··on AI boosted homework scores, then exam scores dropped: study
Sometimes things are just common sense pure and simple.
ChrisSD··on Malicious Rust crate Arrayref runs a build-time payload
But then that shifts the issue. You've now got an opaque binary blob being injected into programs. What if it is malicious?
ChrisSD··on RipGrep musl binaries occasionally segfault during very-large searches
You can call into the kernel just fine in Windows. The fact you use a function call wrapper instead of a raw syscall is not really relevant.

Most Windows NT kernel functions take a buffer to use rather than allocating their own memory. Even many Win32 functions don't allocate (although there you have to be much more careful).

ChrisSD··on June in Servo: real world compat, media queries, SharedWorker, and more
Servo was sparsely maintained for years after Mozilla abandoned the project. Just in the last year it has picked steam as an independent project with a range of third party sponsors. Work is now progressing apace and it's becoming increasingly compatible with real-world websites.
ChrisSD··on June in Servo: real world compat, media queries, SharedWorker, and more
Maybe give them a second? Yes, it's usable for applications web views if you're willing to restrict yourself but for general purpose web browsing there's still a lot that needs doing (but work is progressing). Under Google's management, web tech has grown fast. And it's an ever shifting living standard. There is a lot for any alternative browser engine to implement, let alone keep pace with the changes.
ChrisSD··on Why do you suck at juggling now?
Like all such metrics, the specifics don't really matter. All that matters is that you can tell a story, over the course of the year, on how you've "improved". The goal is to use the story to highlight the work you've been doing while passing it off as evidence. This kind of story telling is something people in management positions tend to be very good at but it's also a skill people not in management should have some proficiency in.
ChrisSD··on A tale of two path separators
Or you could use powershell and avoid the issue ;).

Though nowadays system files should be protected even from admin and even if you do manage to delete them, Windows can restore them.

ChrisSD··on Myths about /dev/urandom (2014)
VMs should have VirtIO RNG set up so there is a high quality entropy source at boot time, provided by the host system.
ChrisSD··on Incident Report: CVE-2024-YIKES
Yep, that's why I was asking. I'd be very interested to hear of more candidates for uplifting into std.

I guess saying "every project" has 5 dependencies might be somewhat hyperbolic (or at least domain specific) but it would be interesting to know the kinds of things they're talking about that haven't yet been uplifted.

ChrisSD··on Incident Report: CVE-2024-YIKES
Can you name 5 as an example?
ChrisSD··on EU Parliamentary Research Service calls VPNs "a loophole that needs closing"
What law?
ChrisSD··on EU Parliamentary Research Service calls VPNs "a loophole that needs closing"
In that specific sentence the source is cited (via hyperlink). So even if you read it out of all context you can still find out the source is UK's Children’s Commissioner Dame Rachel de Souza who said it, not "the EU" (whatever that means).

For this "story" to gain legs, someone must have pulled that sentence out of content without mentioning the source and then added some misleading context for the outrage.

ChrisSD··on How do I inform Windows that I'm writing a binary file?
For some background on what I meant see:

https://devblogs.microsoft.com/oldnewthing/20140411-00/?p=12...

https://learn.microsoft.com/en-us/cpp/windows/universal-crt-...

ChrisSD··on How do I inform Windows that I'm writing a binary file?
Calling it from C does not mean you need a full C standard library to exist. For example, much of the C standard library is itself written in C. But it's a "freestanding" C which assumes only a minimal set of library functions exist (e.g. functions for copying memory from one place to another, filling memory with zeroes, etc).

And you can of course use non-C languages to call the Win32 API. Or even directly using assembly code.

ChrisSD··on How do I inform Windows that I'm writing a binary file?
The Win32 API. E.g. using WriteFile to write files (https://learn.microsoft.com/en-us/windows/win32/api/fileapi/...)

It wasn't until fairly recently that the C runtime was stably shipped with Windows. Previously you had to install the correct version of the C library alongside your application.

ChrisSD··on Bugs Rust won't catch
You can open directories using high level win32 APIs. What you need NtCreateFile for is opening files relative to an open directory.
ChrisSD··on Bugs Rust won't catch
> WinAPI access for ACLs was added in Windows 10

I'm not sure which docs you mean but that's not true. The NT kernel has used ACLs long before rust was invented. But it's indeed true that rust adds platform-specific methods based on demand. The trouble with ACLs is it means either creating a large API surface in the standard library to handle them or else presenting a simple interface but having to manage raw pointers (likely using a wrapper type but even then it can't be made totally safe).

> the de-facto standard winapi crate, which provides access to the raw syscall

Since the official Microsoft `windows-sys` crate was released many years ago, the winapi crate has been effectively unmaintained (it accepts security patches but that's it).

ChrisSD··on Zig – Type Resolution Redesign and Language Changes
Oh sorry, I thought this was just listing changes since the branch.
ChrisSD··on Type resolution redesign, with language changes to taste
> Many projects including Chromium, boringssl, Firefox, and Rust call SystemFunction036 from advapi32.dll because it worked on versions older than Windows 8.

That's not true. They use ProcessPrng since versions earlier than 10 are no longer supported (well, rust also has a windows 7 target but that couldn't use ProcessPrng anyway since it wasn't available). The issue they linked is from a decade ago. E.g. here's Chromium: https://github.com/chromium/chromium/blob/dc7016d1ef67e3e128...

> If [ProcessPrng] fails it returns NO_MEMORY in a BOOL (documented behavior is to never fail, and always return TRUE).

From Windows 10 onward ProcessPrng will never fail. There's a whitepaper that gives the justification for this (https://aka.ms/win10rng):

> We also have the property that a request for random bytes never fails. In the past our RNG functions could return an error code. We have observed that there are many callers that never check for the error code, even if they are generating cryptographic key material. This can lead to serious security vulnerabilities if an attacker manages to create a situation in which the RNG infrastructure returns an error. For that reason, the Win10 RNG infrastructure will never return an error code and always produce high-quality random bytes for every request...

> For each user-mode process, we have a (buffered) base PRNG maintained by BCryptPrimitives.dll. When this DLL loads it requests a random seed from kernel mode (where it is produced by the per-CPU states) and seeds the process base PRNG. If this were to fail, BCryptPrimitive.dll fails to load, which in most cases causes the process to terminate. This behavior ensures that we never have to return an error code from the RNG system.

ChrisSD··on My “grand vision” for Rust
I think you're too stuck on the current implementation. Work is going into investigating how to evolve the standard library over editions. The "easiest" win would be to have a way to do edition-dependent re-exports of types.
ChrisSD··on Ars Technica fires reporter after AI controversy involving fabricated quotes
> Aurich Lawson of Ars Technica deleted the original article

That's a very "shoot the messenger" statement. While Aurich is the community "face" of Ars, I very much doubt he has the power to do anything like that.

ChrisSD··on Why XML tags are so fundamental to Claude
HTML diverged from SGML pretty early on. Various standards over the years have attempted to specify it as an application of SGML but in practice almost nobody properly conformed to those standards. HTML5 gave up the pretence entirely.
ChrisSD··on Dear Time Lords: Freeze Computers in 1993
Eh. I don't think so. Sure, it was used more in business contexts but it wasn't until Windows 2000 that I saw more regular people using it and recommending it.
ChrisSD··on Dear Time Lords: Freeze Computers in 1993
> It does mention Windows NT but honestly nobody really cared about that until NT 3.0/3.5 and it soon thereafter became Windows XP and laid the foundation for modern Windows.

Fun fact: NT 3.1 was the first version of NT, released in 1993. It was versioned like that to match Windows 3.1 which had been released the previous year.

And NT really took off with Windows 2000. Not just business people but more ordinary people were using it as a more stable alternative to Windows 95/98 (albeit lacking some compatibility, especially with games).

ChrisSD··on Windows 11 Notepad to support Markdown
For everyone that wants a simple, lightweight, alternative to notepad there's edit.exe on recent version of Windows. Assuming you don't mind TUIs.
ChrisSD··on C isn't a programming language anymore (2022)
This article isn't about languages. It's about the protocol for two or more languages to talk to each other. There is no specification for this.

The System V ABI is as close as we get to an actual specification but not everyone uses it and in any case it only covers a small part of the protocol.

ChrisSD··on C isn't a programming language anymore (2022)
It minimally reflects PDP-11 assembly, which is not how modern computers work.
ChrisSD··on Banned C++ features in Chromium
`char8_t` is probably one of the more baffling blunders of the standards committee.
Page 1 of 34Next →