5,063 karma · joined July 15, 2021
One could probably produce some sort of function pointer loader library with these tables, but at that point... Why not just use the documented APIs?
[1]: https://github.com/j00ru/windows-syscalls/blob/8a6806ac91486...
And frankly, the Windows way is better. On Linux, the 'ABI' for nearly all user-mode programs is not the kernel's ABI but rather glibc's (plus the variety of third-party libraries, because Win32 has a massive surface area and is an all-in-one API). Now, glibc's ABI constantly changes, so linking against a newer glibc (almost certainly the 'host' glibc, because it is almost impossible to supply a different 'target' glibc without Docker) will result in a program that doesn't run on older glibc. So much for Torvalds' 'don't break userspace'.
Not so for a program compiled for 'newer' Win32; all that matters are API compatibilities. If one only uses old-hat interfaces that are documented to be present on Windows 2000, one can write and compile one's code on Windows 11, and the executable will run on the former with no issues. And vice versa, actually.
With rainbow tables, even 11-character simple passwords like 'password123' can be trivially cracked, and as the number of password leaks show, not everyone is great at managing secrets and credentials.
To answer your question, the headers.
I get your point. Although my point is that there is actually zero need for MSYS at all for this, even as a developer, and especially not with the 'CLANG64' environment. These binaries themselves are built to run in the MSYS2 environment This is how I cross-compile from Windows... to Windows with LLVM-MinGW[1]:
> (gci Env:PATH).Value.Split(';') | sort
> clang-21.exe --version
clang version 21.1.2 (https://github.com/llvm/llvm-project.git b708aea0bc7127adf4ec643660699c8bcdde1273)
Target: x86_64-w64-windows-gnu
Thread model: posix
InstalledDir: C:/Users/dpdx/AppData/Local/Microsoft/WinGet/Packages/MartinStorsjo.LLVM-MinGW.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe/llvm-mingw-20250924-ucrt-x86_64/bin
Configuration file: C:/Users/dpdx/AppData/Local/Microsoft/WinGet/Packages/MartinStorsjo.LLVM-MinGW.UCRT_Microsoft.Winget.Source_8wekyb3d8bbwe/llvm-mingw-20250924-ucrt-x86_64/bin/x86_64-w64-windows-gnu.cfg
[1]: https://github.com/mstorsjo/llvm-mingwNot really. It's just different. As a cross-platform dev, all desktop OSs have their own idiosyncracies that add up to a net of 'they are all equally rather bad'.
Install:
- contrary to the blog post, the entirety of Visual Studio, because the IDE and debugger is *really damn good*.
- LLVM-MinGW[1]
Load the 'VSDevShell' DLL[2] for PowerShell, and you're good to go, with three different toolchains now: cl.exe from VS
clang-cl.exe—you don't need to install this separately in VS; just use the above-mentioned llvm-mingw clang.exe as `clang.exe --driver=cl /winsysroot <path\to\Windows SDK> /vctoolsdir <path\to\VC>`. Or you can use it in GNU-driver-style mode, and use -Xmicrosoft-windows-sys-root. This causes it to target the Windows ABI and links against the VS SDK/VC tools
`clang.exe` that targets the Itanium ABI and links against the MinGW libraries and LLVM libc++.
Done and dusted. Load these into a CMake toolchain and never look at them again.People really like overcomplicating their lives.
At the same time, learn the drawbacks of all toolchains and use what is appropriate for your needs. If you want to write Windows drivers, then forget about anything non-MSVC (unless you really want to do things the hard way for the hell of it). link.exe is slow as molasses, but can do incremental linking natively. cl.exe's code gen is (sometimes) slightly worse than Clang's. The MinGW ABI does not understand things like SAL annotations[3], and this breaks very useful libraries like WIL[4] (or libraries built on top of them, like the Azure C++ SDK[5] The MinGW headers sometimes straight up miss newer features that the Windows SDK comes with, like cfapi.h[6].
[1]: https://github.com/mstorsjo/llvm-mingw
[2]: https://learn.microsoft.com/en-gb/visualstudio/ide/reference...
[3]: https://learn.microsoft.com/en-gb/cpp/c-runtime-library/sal-...
[4]: https://github.com/microsoft/wil
[5]: https://github.com/Azure/azure-sdk-for-cpp
[6]: https://learn.microsoft.com/en-gb/windows/win32/cfapi/build-...
Doesn't it come with `pacman` too?
In this sense, LLMs (as much as I am sceptical about them) are much more useful.
[1]: https://www.microsoftpressstore.com/store/windows-internals-...
[2]: https://www.microsoftpressstore.com/store/windows-internals-...
The C++ equivalent, Vulkan-Hpp[2], follows extremely closely behind. Plus, ash isn't just an FFI wrapper; it does quite a bit of RAII-esque state and function pointer management that is generally required for Vulkan.
[1]: https://github.com/KhronosGroup/Vulkan-Docs/blob/main/xml/vk...
That is just completely illogical and betrays a complete lack of understanding of how Windows works. Most problems people have with Windows are in the user mode, and not in the kernel. The pain of reverting straightforward UI/UX/vendor-provided application code that is probably version-controlled and tagged for specific historic Windows releases is 'too high', so, therefore, let's do something that's even higher cost, and...
> windows 13 or 14 will just be a linux distro
Ugh, not this again. It looks like this train of thought will never leave HN commenters who probably have never seriously actually used or programmed on Windows. Literally every week I see 'Windows should keep the same user mode and move to the Linux kernel'.
You guys know what another Linux kernel running a locked-down user mode stack is called? Android.
As for similarity, I think the sections you've highlighted are broadly similar, but I can't detect any phrase-for-phrase copy-pasting that is typical of LLM or thesaurus find-replace. I feel that the topic layout and the motivations for any tutorial or course covering the same subject matter will eventually converge to the same broad ideas.
The website's sequence of steps is also a bit different compared to your book's. And most telling, the code, diagrams, and maths in the website are all different (such assets are usually an instant giveaway of plagiarism). You've got pseudocode; the website uses the C++ standard library to a great extent.
If it were me, I might rest a little easier :)
TinyRenderer: https://haqr.eu/tinyrenderer/
ScratchAPixel: https://www.scratchapixel.com/index.html
3D Computer Graphics Programming by Pikuma (paid): https://pikuma.com/courses/learn-3d-computer-graphics-progra...
Ray-tracing:
Ray Tracing in One Weekend: https://raytracing.github.io/
Ray Tracing Gems: https://www.realtimerendering.com/raytracinggems/
Physically Based Rendering, 4th Edition: https://pbr-book.org/
Both:
Computer Graphics from Scratch: https://gabrielgambetta.com/computer-graphics-from-scratch/
I'll also link a comment[1] I made a while back about learning 3D graphics. There's no better teacher than manually implementing the rasterisation and ray-tracing pipelines.
$90K a year goes much further in most of Europe barring the centres of the biggest cities—let alone eastern Europe—than it does in the US.
NYC and Bay Area salaries are outrageously inflated, with much of the take-home being funnelled into four/five digit rents or mortgages for houses built out of matchsticks, car loans, health insurance payments, and more. None of this is necessary or costs as much in most of Europe, or the rest of the world, really.
£50 for a heated seat, perhaps, but you also get by far one of the best turbocharged inline-6 engines ever put in a 4-door saloon, the S58. Analogous to Windows NT, a well-engineered kernel.
It could be worse—it could be Linux, with no forward compatibility. The VC/C++ redistributable means that applications can be written on modern Windows that targets much older Windows, by simply providing a sidecar installer that brings with it a newer C/C++ standard library. This situation is basically impossible on Linux without messing with Docker.
Plain Win32 needs a renaissance. I worked with it and felt like a wizard. Message boxes, dialogue boxes, wizards, hammered out in pure C++. Combined with the Windows Implementation Library[1] I was writing fast, modern code.
XMake supports both.
For the record, this isn't just visual. Rasterising to a framebuffer that is considerably larger than the physical resolution and then scaling produces a tangible effect on battery life. Not that it matters much with the impressive efficiency of the M-series SoCs, but it is there nonetheless.
This happens on the native displays of MacBooks and iMacs, too. Try any of the 'looks larger'/'looks smaller' settings and it'll show up.
There are a few Reddit threads that crop up when one searches for 'macOS ringing artifacts scaling'. For instance, these ones:
https://www.reddit.com/r/macbookpro/comments/1252ml8/strange...
https://www.reddit.com/r/MacOS/comments/1ki58zk/fractional_s...
https://www.reddit.com/r/MacOS/comments/l8oadr/macos_fringin...
All are ringing artifacts, typical of downscaling. I no longer have a Mac (chose one for work to try it out, saw this issue, returned it immediately), but I assure you this is what happens.
> The only complaint people tend to make is ever-so-slight additional blurriness
At no scale factor should there be any blurriness unless a framebuffer resolution is explicitly set. The 'scale factor' should be entirely independent of the physical resolution, which macOS simply does not do.
Apple's understanding and implementation of 'Retina' comes from a singular source: the straightforward doubling in each dimension of the display resolution of the iPhone 4 compared to the iPhone 3GS. It has not changed since, and has applied this algorithm throughout its OS stack.
Right-click on the `.exe`
Properties
Compatibility tab
Change settings for all users
Change high DPI settings
Under 'High DPI scaling override' section, tick box for 'Override high DPI scaling behaviour. Scaling performed by'
In the drop-down box below, select 'Application'
Done.For MMC snap-ins like `diskmgmt.msc`, `services.msc`, or `devmgr.msc`, there's a Registry key you can set. See this ServerFault question: https://serverfault.com/q/570785/535358