HackerLangs
TopNewTrendsCommentsPastAskShowJobs

ChrisSD

7,259 karmajoined 9년 전
64b2ffe4-6461-4f2e-9258-2a1839d40720

comments

ChrisSD
·18시간 전·discuss
Most of the overly spammy "rewrite in rust" people I see are not in any rust "community" I'm aware of. They mostly seem to be either regurgitating what they heard an influencer say or are intentionally doing it for the meme.

(aside: I find "community" to be a bit silly when it comes to all but the smallest languages. There is rarely one community and a lot of people using a language or even working on it aren't in any of them).
ChrisSD
·19일 전·discuss
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
·2개월 전·discuss
VMs should have VirtIO RNG set up so there is a high quality entropy source at boot time, provided by the host system.
ChrisSD
·2개월 전·discuss
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
·2개월 전·discuss
Can you name 5 as an example?
ChrisSD
·2개월 전·discuss
What law?
ChrisSD
·2개월 전·discuss
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
·2개월 전·discuss
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
·2개월 전·discuss
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
·2개월 전·discuss
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
·2개월 전·discuss
You can open directories using high level win32 APIs. What you need NtCreateFile for is opening files relative to an open directory.
ChrisSD
·2개월 전·discuss
> 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
·4개월 전·discuss
Oh sorry, I thought this was just listing changes since the branch.
ChrisSD
·4개월 전·discuss
> 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
·4개월 전·discuss
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
·4개월 전·discuss
> 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
·4개월 전·discuss
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
·4개월 전·discuss
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
·4개월 전·discuss
> 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
·5개월 전·discuss
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.