HNHacker News
TopNewBestAskShowJobs

ChrisSD

7,318 karma · joined August 5, 2017

64b2ffe4-6461-4f2e-9258-2a1839d40720
submissionscomments
ChrisSD··on The sad history of Unicode printf-style format specifiers in Visual C++ (2019)
Windows NT uses actual Unicode under the hood (originally UCS-2, now UTF-16).

Windows NT started development in 1989 and was released in 1993. Considering the Unicode standard was first published in 1991/2, I think Windows NT can be counted as an early adopter.

ChrisSD··on Dotfile madness (2019)
The difference between Windows ".." and unixy ".." is that the former is done lexically whereas the latter is a link to the canonical parent.

E.g. on Windows: "path\to\..\file" is always the equivalent of "path\file". Whereas on unixy systems "path/to/../file" may take you to a completely different parent directory.

That said, Unix shells can muddy the waters a bit. They may choose to act lexically with some commands.

ChrisSD··on “Rust is safe” is not some kind of absolute guarantee of code safety
You seem to have misunderstood me. The distinction I'm making is not between kernel panic or undefined behaviour. The distinction is between undefined behaviour and defined behaviour. That defined behaviour can be anything, even including "limping on" somehow.
ChrisSD··on “Rust is safe” is not some kind of absolute guarantee of code safety
There's no "walking back" here. From Rust 1.0 the language was "guaranteed memory safety" https://web.archive.org/web/20150516132407/https://www.rust-...
ChrisSD··on “Rust is safe” is not some kind of absolute guarantee of code safety
That's all very well but the Rust-in-Linux advocates are advocating for #2 and fully agree with Linus on #1. So attacking #1 is attacking straw.
ChrisSD··on “Rust is safe” is not some kind of absolute guarantee of code safety
What is better: continuing to "limp along" in some unknown corrupted state (aka undefined behaviour) or in a well defined (albeit invalid) state?
ChrisSD··on It's time to halt starting any new projects in C/C++
Yeah, I'd emphasize that moving something to the standard library doesn't magically solve maintenance issues. In fact if the community can't even maintain something then that's a strong argument for it not to be moved somewhere that's much harder to contribute to, whose maintainers have a lot else on their plate and where any API mistakes are for forever.
ChrisSD··on Note-taking isn't rocket science
I've recently simplified my note-taking workflow but there are complexities. IMHO, a note taking application needs a way to at least do the following with notes:

* View and edit

* Organise

* Search

* Sync

All in one solutions can be nice but also lock you in. It is as the name says: all or nothing (well all or figure out how to migrate your notes to another application). My current workflow is to use different tools for different jobs. The downside is it's more to set up and it may not be suitable for everybody.

* I use any markdown editor to view and edit notes

* I use the filesystem to organise notes by broad categories (directories are never more than two deep)

* I can use any tool I like for searching notes (my markdown editor(s) has one but I can also all use ripgrep or whatever tool I like)

* I sync using my preferred cloud storage provider

My markdown editor is doing most of the job of a note taking app but the point is I can seamless switch for something else without much hassle. Or use different ones on different platforms.

This does require search tools to do a lot of heavy lifting when broad categories aren't enough to find something. But I've yet to find a better way (I've not had much success managing tags, they get messy fast).

ChrisSD··on The trouble with symbolic links
It's a quirk of history, imho. If Win32 had been written without concern for what came before, it probably would have more closely followed NT conventions.

But it wasn't. It followed on from Win16 and DOS so, to an extent, it emulated DOS-style path and file handling. After all, that's what developers and users were familiar with. The Windows registry did not have all this baggage so it followed the style of the NT kernel.

Though this doesn't explain why Win32 never added CreateFileRelativeToDirectoryHandleW

ChrisSD··on The Windows malloc() implementation from MSVCRT is slow
There is an official Universal CRT Redistributable.
ChrisSD··on The Windows malloc() implementation from MSVCRT is slow
The UCRT has even been present since Windows 7, if users keep up with updates. Or if applications bundle the UCRT installer with their own.
ChrisSD··on Zulip – Threaded real-time chat for distributed teams
It does take a bit of getting used to. Zulip is kind of a cross between chat and a forum.

However, once I did get used to it I think it's been great. Organizing chat into defined topics is super useful for following discussions you're interested in, filtering out those you aren't and for keeping conversations going across time zones.

It's more discoverable than chat but not as rigid as an actual forum. I feel it works well once the learning curve has been surmounted.

ChrisSD··on Why is a registry file called a “hive”? (2003)
The registry is the raw database. The Policy Editor is the human interface with comments and other niceties.
ChrisSD··on Rustc: Add do yeet expressions to allow experimentation in nightly
Note that this is a serious language proposal, but with a funny placeholder name so as to avoid bikeshedding until the feature is ready.
ChrisSD··on Crossbeam – Tools for concurrent programming in Rust
Note that there are plans to integrate crossbeam's channel implementation into the standard library. This won't change the public API but would at least vastly improve the implementation. A similar thing was done with changing the implementation of `HashMap` to be a wrapper around the `hashbrown` library.
ChrisSD··on Bugs in Hello World
This is true of *nix but on Windows they can be absent. In face this is the default for GUI applications.
ChrisSD··on Fork() is evil; vfork() is goodness; afork() would be better; clone() is stupid
A third way is to grant the parent process access to the child such that they can use the child process handle to "remotely" set restrictions, write memory, start a thread, etc.
ChrisSD··on End-of-life dates
With the caveat that ESU (Extended security Updates) cost companies increasing $$$ for every year after extended support ended.
ChrisSD··on The Wild West of Windows command line parsing
The issue there is that the Windows kernel does not validate Unicode. Linux has the same essential problem. Or more so, in that it does not specify an encoding at all.
ChrisSD··on The Wild West of Windows command line parsing
> Rust (LLVM) pragmatically call[s] CommandLineToArgv

This is not correct. It calls `GetCommandLine` to get the raw command line string and then attempts to parse it in the same way as modern C/C++. https://github.com/rust-lang/rust/blob/3b186511f62b0ce20e72e...

The rules themselves are officially documented here: https://docs.microsoft.com/en-us/cpp/cpp/main-function-comma...

Though the linked David Deley investigation is more in-depth: https://daviddeley.com/autohotkey/parameters/parameters.htm#...

ChrisSD··on The Wild West of Windows command line parsing
Yes the shell interprets it first. `cmd.exe` does very little processing and mostly passes on the literal string. But what it does do can be confusing (e.g. `^` is an escape character which is annoying if you were trying to pass in a regex).

In powershell you can use `--%` to pass a literal string as the command line. This is useful for applications that don't use the standard C/C++ parsing rules.

See: https://docs.microsoft.com/en-us/powershell/module/microsoft...

ChrisSD··on Firefox And Pixar Animation Studios team up to help you show your true colors
It's truly weird and I don't understand it. I mean not to defend Firefox but the HN reaction is almost comically extreme.

---

Chrome: ...and so our company's puppy kicking campaign was a total success. In other news, we're updating our terms of service so that you agree to hand over your first born child.

HN: Meh, I'll still use Chrome though.

----

Firefox: Today we fixed a bug that...

HN: OMG FIREFOX SUCKS. I'M USING CHROME NOW.

ChrisSD··on Rust Survey 2021 Results
> Microsoft is also shipping pre-compiled projections for Rust/WinRT.

Eh, sort of. They're basically shipping the Rust equivalent of C header files and import libraries. Whereas before they would parse metadata in a build script which would then generate the Rust code on the fly (which was hell for a number of reasons). And the installed Windows SDK was used for the import libraries.

ChrisSD··on How UTF-8 Works
For whatever it's worth Rob Pike seems to credit Ken Thompson for the invention, though they both worked together to make it the encoding used by Plan 9 and to advocate for its use more widely.
ChrisSD··on How UTF-8 Works
As I said, there are many reasons UTF-8 is a better encoding. And indeed compact, backwards compatible, encoding of ASCII is one of them.
ChrisSD··on How UTF-8 Works
There are many reasons why UTF-8 is a better encoding but UTF-16 does at least have the benefit of being simpler. Every scalar value is either encoded as a single unit or a pair of units (leading surrogate + trailing surrogate).

However, Powershell (or more often the host console) has a lot of issues with handling Unicode. This has been improving in recent years but it's still a work in progress.

ChrisSD··on Minor Semver Issue
It should be noted that Cargo (the Rust package manager) has slightly stricter requirements here: https://doc.rust-lang.org/cargo/reference/semver.html

> Initial development releases starting with "0.y.z" can treat changes in "y" as a major release, and "z" as a minor release. "0.0.z" releases are always major changes. This is because Cargo uses the convention that only changes in the left-most non-zero component are considered incompatible.

This makes it more useful for OSS that never seem to reach 1.0.

ChrisSD··on Minor Semver Issue
https://users.rust-lang.org/t/psa-please-specify-precise-dep...

Essentially there are a few popular Rust libraries that add functions in patch versions (or have done so in the past). This makes it necessary for users of that library to include the patch number when specifying the minimal version that they need because they can't assume an earlier patch will include all the functions they use.

The original forum poster said such libraries were in "violation" of the semver.org spec. This blog post disagrees on using the term "violation" because this is a minor issue (no pun intended... or was it).

ChrisSD··on Wall Street was the real winner of the GameStop saga
It's essentially the old adage about selling shovels during a gold rush.
ChrisSD··on Getting Started with Git Bash
What's the Python issue?
← PreviousPage 5 of 34Next →