<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: MaulingMonkey</title><link>https://news.ycombinator.com/user?id=MaulingMonkey</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Tue, 13 Oct 2026 15:16:19 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=MaulingMonkey" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by MaulingMonkey in "Beating the compiler (2024)"]]></title><description><![CDATA[
<p>> At this time there is no portable way to produce computed gotos or tail call optimization in compiled machine code from Rust.<p>Nightly rust now has the `become` keyword:<p><a href="https://doc.rust-lang.org/std/keyword.become.html" rel="nofollow">https://doc.rust-lang.org/std/keyword.become.html</a><p>> `feature(explicit_tail_calls)` is currently incomplete and may not work properly.<p>Works on my machine (tm).  At least with toy examples.  Including in full optimizationless debug mode, turning `call`s into `jmp`s ensuring `factorial(usize::MAX)` won't stack overflow probably maybe.<p><a href="https://rust.godbolt.org/z/7xf836E8K" rel="nofollow">https://rust.godbolt.org/z/7xf836E8K</a><p>> checked_sub? wrapping_mul? MaulingMonkey, what's wrong with you?<p>Eliminating debug-mode panic boilerplate.</p>
]]></description><pubDate>Mon, 05 Oct 2026 20:17:14 +0000</pubDate><link>https://news.ycombinator.com/item?id=49970074</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49970074</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49970074</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "A custom virtual machine for the Stars 4X game"]]></title><description><![CDATA[
<p>The final shareware version (2.6) was fairly comparable to the retail version (2.7).  This says the shareware version just lacked some sound effects...?  <a href="https://web.archive.org/web/20091129230733/http://wiki.gible.net/index.php/Patches_and_versions" rel="nofollow">https://web.archive.org/web/20091129230733/http://wiki.gible...</a><p>However, I believe the first shareware version <i>I</i> had was 1.x (distributed via CD that was packed full of shareware) which was significantly different.  I remember mining fuel, which tracks with the above link.<p>Stars! was one of my very first video game purchases.  I remember mailing a money order, and recieving a copy in the mail - I didn't have internet at the time.  I'm not sure I even knew the internet <i>existed</i> then, although I would soon after if not.</p>
]]></description><pubDate>Sun, 20 Sep 2026 23:39:54 +0000</pubDate><link>https://news.ycombinator.com/item?id=49781298</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49781298</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49781298</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Rust is tier-1 language at Microsoft"]]></title><description><![CDATA[
<p>IDK about "tier 1" but I'll note I've used VS for debugging and profiling Rust binaries.  I even wrote a tool to auto-generate a wrapper .sln so I can easily launch from VS: <a href="https://github.com/MaulingMonkey/cargo-vs" rel="nofollow">https://github.com/MaulingMonkey/cargo-vs</a><p>The main pain point IME was poor debugger visualizers for standard containers and enums.  I fixed some of that for the standard containers by writing some natvis files for std: <a href="https://github.com/rust-lang/rust/issues?q=state%3Aclosed%20is%3Apr%20author%3AMaulingMonkey" rel="nofollow">https://github.com/rust-lang/rust/issues?q=state%3Aclosed%20...</a> .  Admittedly, they broke a few times.  They also weren't automatically included in the pdbs, so I wrote a crate for that: <a href="https://github.com/MaulingMonkey/natvis-pdbs" rel="nofollow">https://github.com/MaulingMonkey/natvis-pdbs</a> .  And then someone crated and stabilized #[debugger_visualizer] for rust itself, which can do the same job: <a href="https://doc.rust-lang.org/reference/attributes/debugger.html" rel="nofollow">https://doc.rust-lang.org/reference/attributes/debugger.html</a> .<p>(...I should check on enum visualization, but I suspect it's still poor.)</p>
]]></description><pubDate>Thu, 10 Sep 2026 18:30:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=49648267</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49648267</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49648267</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Windows 11's "special" developer edition looks like another marketing misfire"]]></title><description><![CDATA[
<p>Only a token test amount so far.  The root filesystem is read-only by default, but without the whole Nix ecosystem, which is a little awkward (can't install packages even as root without changing that.)  On the other hand, it comes with `distrobox` preinstalled, so it's easy enough to spin up a container and use that (including package installation.)<p>My raw notes are here: <a href="https://github.com/MaulingMonkey/notes/blob/master/programming/platforms/steam%20machine.md#developer" rel="nofollow">https://github.com/MaulingMonkey/notes/blob/master/programmi...</a></p>
]]></description><pubDate>Mon, 07 Sep 2026 04:11:09 +0000</pubDate><link>https://news.ycombinator.com/item?id=49593805</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49593805</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49593805</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Windows 11's "special" developer edition looks like another marketing misfire"]]></title><description><![CDATA[
<p>I shelled out for a Steam Machine (SteamOS ≈ Arch Linux.)  I do gamedev, and I figured having a test machine was a decent enough excuse for a purchase.  It's working suprisingly well for the games I'm actually playing.  They're playing better than on my last Windows desktop tower, even, presumably due to a better GPU.<p>Granted, catalogs vary - anti-cheat and DRM may not play nice, and EvE Online wasn't stable until I switched the renderer from D3D12 to D3D11 (and I haven't tried playing with multiple accounts) - but you might revisit Linux gaming if it's been awhile since you last have.<p>The enshittification of Windows has finally driven me to the point where Linux compatability is going to start affecting my Steam purchases.</p>
]]></description><pubDate>Sun, 06 Sep 2026 23:12:18 +0000</pubDate><link>https://news.ycombinator.com/item?id=49591866</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49591866</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49591866</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Parallel development without the headaches using Git worktree"]]></title><description><![CDATA[
<p>Worktrees share more git state (remotes, blobs, etc.) and don't require hunting down the repository url to feed to git clone, or a network connection to use said url.  While you could get the same benefit from cloning your local repository, you're then in the weird state where `origin` is a local non-bare repository.<p>If you're setting up long-lived checkouts that you reuse, it doesn't help much (except perhaps saving space or bandwidth) vs multiple clones and some once up-front reconfiguration.  On the other hand, if you want something more temporary - and perhaps based on your current HEAD without having to hunt down a commit id to feed a subsequent git clone / git checkout command - worktrees save you some boilerplate (re)configuration.</p>
]]></description><pubDate>Mon, 24 Aug 2026 01:43:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=49414389</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49414389</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49414389</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "When Feature Flags Do and Don't Make Sense (2019)"]]></title><description><![CDATA[
<p>Feature flags are great.  Working on a crash / memory corruption in an optional subsystem?  Just disable the subsystem to unblock coworkers on the same branch while you track down the cause.<p>Feature flags are terrible.  Working on a crash / memory corruption in an optional subsystem?  You disabled it previously for your local build, and you'll lose hours failing to repro despite QA giving excellent repro steps.<p>(For my own gamedev background, I learned to mute audio by setting volume to 0 instead of by disabling the audio subsystem.)</p>
]]></description><pubDate>Sun, 09 Aug 2026 02:51:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=49227985</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49227985</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49227985</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Fil-C: Garbage In, Memory Safety Out [video]"]]></title><description><![CDATA[
<p>I've encountered a few soundness holes in rust-lang in practice, but they've all been fixed before I managed to shoot myself in the foot with any of them:<p>• `std::mem::uninitialized()`.  It's now deprecated in favor of `MaybeUninit`.<p>• `std::env::set_var(...)`.  It's now marked `unsafe`.  While I dodged the bullet, these fellows didn't: <a href="https://www.geldata.com/blog/c-stdlib-isn-t-threadsafe-and-even-safe-rust-didn-t-save-us" rel="nofollow">https://www.geldata.com/blog/c-stdlib-isn-t-threadsafe-and-e...</a><p>• `#[no_mangle]`.  It's now `#[unsafe(no_mangle)]`.<p>I don't believe I've constructed cvs-rs's hole by accident.  cve-rs's code links to <a href="https://github.com/rust-lang/rust/issues/25860" rel="nofollow">https://github.com/rust-lang/rust/issues/25860</a> , which is admittedly still open after a decade.  Progress appears to still be ongoing though!  Related:<p>• <a href="https://github.com/orgs/rust-lang/projects/44/views/1" rel="nofollow">https://github.com/orgs/rust-lang/projects/44/views/1</a><p>• <a href="https://rust-lang.github.io/rust-project-goals/2025h2/next-solver.html" rel="nofollow">https://rust-lang.github.io/rust-project-goals/2025h2/next-s...</a><p>> Meanwhile, here's a memory safety bug that Fil-C fails to catch, not because of a compiler bug, but by design: [...]<p>Thanks for sharing a concrete example of Fil-C's limitations!  Disappointing - but not unexpected - to see it underperforming existing sanitizers.  I was hoping for better.</p>
]]></description><pubDate>Sat, 25 Jul 2026 22:09:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=49052152</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49052152</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49052152</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Fil-C: Garbage In, Memory Safety Out [video]"]]></title><description><![CDATA[
<p>> If you define another language Rust-Without-Any-Unsafe, then maybe that one is safer than Fil-C.<p>Just write `#![forbid(unsafe_code)]` at the top of your src/lib.rs, and track crates not using it with `cargo geiger`.  You don't need a whole new language, it already provides the tools to wield that hatch shut.<p>> Rust is less safe because it has a feature for turning off safety<p>Can I write Fil-C's mmap wrapper in Fil-C?<p>If no, fair enough, but it's worth noting I can write a safe Rust mmap wrapper in Rust, and I absolutely and frequently need to do that kind of "syscall wrapping" in arenas Fil-C explicitly hasn't handled, by virtue of being explicitly a Linux project.<p>If yes, that sounds like an escape hatch to Fil-C's memory safety, undermining the claim that Fil-C is fundamentally safer, and you're now at best arguing it's safer <i>as tends to be used</i>.</p>
]]></description><pubDate>Fri, 24 Jul 2026 21:58:34 +0000</pubDate><link>https://news.ycombinator.com/item?id=49042111</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=49042111</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=49042111</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "How Our Rust-to-Zig Rewrite Is Going"]]></title><description><![CDATA[
<p>I adore unsafe, appreciate it as a feature... but it <i>is</i> an escape hatch.  One that is sometimes necessary, one that is sometimes not necessary but might still be (ab)used for performance, or initial 1:1 porting of C/C++ code.  There are a lot of cases where that escape hatch should probably welded shut though.  Fortunately, the Rust ecosystem has tools like `cargo geiger`, and straight out of the box I can also write:<p><pre><code>    // src\lib.rs
    #![forbid(unsafe_code)]</code></pre></p>
]]></description><pubDate>Thu, 16 Jul 2026 20:57:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48940144</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48940144</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48940144</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "DNSGlobe – Rust TUI to watch DNS propagate around the world"]]></title><description><![CDATA[
<p>> The myth of DNS “propagation” needs to die.<p>What's the actual issue?  Are you being frustrated by people laboring under the assumption that DNS records are being sent by carrier pidgeon or something?<p>> There is no geographical connection whatsoever.<p>DNS censorship will presumably be based on geopolitical boundaries, which in turn are bound by geography.  And I wouldn't be entirely suprised if poor network connections - including those potentially geographically bound (poor weather / flooding / tornados severing or degrading links or power) had <i>some</i> (minor, infrequent) impact on the rate stale cache entries are evicted in favor of fresh ones.<p>Granted, none of that means a DNS resolver halfway across the globe from the authoritative servers can't typically get updated results <200ms (≈light speed), which is safely ignorable / won't be visible as records propagating from geographic neighbor to geographic neighbor.  And granted further, I'm both too boring to censor, and too smart to be on call for anything that would make me aware of global outage reports - so the map is admittedly useless <i>to me</i> beyond farming that hacker vibe aura.<p>But I imagine there's at least one or two dudes out there that'll see a red dot in, say, Australia - and that'll save them a few minutes, by giving them a shortcut to determining the root cause of some issue <i>reported</i> in Australia by letting them correctly guess/blame stale DNS records.</p>
]]></description><pubDate>Mon, 06 Jul 2026 00:42:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=48799484</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48799484</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48799484</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Ask HN: Will programmers write more efficient code during the memory shortage?"]]></title><description><![CDATA[
<p>> Will programmers write more efficient code during the memory shortage?<p>Yes.  No.  Yes.<p>I've worked in gamedev, helping ship code that ran on consoles.  Nice fixed hardware targets.  You OOM, you crash.  We crashed a lot, and cut and saved and optimized and explicitly invoked the garbage collector twice on level transitions, because a single full scripting language GC doesn't work when finalizers must run to deref C++ objects to unroot script objects, and committed other horrific hacks.<p>The memory shortage may eventually impact fixed targets like this.  Or the minspec publishers will swallow for fuzzier targets like "PC".  But it takes awhile for new targets to roll out, and for newly bought PCs to make a significant dent on total percentage of PC ownership.  Steam Machine's about to release with 16+8GB and while price and market saturation may be affected by the memory shortage, I'd be suprised if the actual <i>spec</i> changed.<p>> Maybe there will even be more interest in the invention and use of more advanced algorithms<p>Not for typical gamedev IMO.  There the focus will be more on "reduce the amount of content loaded in memory simultaniously".  That means less detail, smaller scale, or less variation.  Going from 4096x4096 to 2048x2048 textures <i>quarters</i> your texture memory usage.  The surface of meshes also has some square density nonsense going on.  Basic animation tends to scale with bone count and keyframes, which are more linear, although shape keys are more per-vertex nonsense.<p>And of course, reusing the same mesh or texture multiple times doesn't use more memory, just more memory <i>bandwidth</i>.<p>Audio is more a factor of "how many sound effects (and variants) do we need preloaded just in case there's suddenly an event that triggers them".<p>These are the big ticket items for memory use and advanced algorithms don't help much.  Rather, the algorithms help stretch whatever amount of memory you do have to provide the best amount of quality you can, and the small constant shift in total memory availability doesn't change the calculus for how important that is very much (which depending on the game ranges from "unimportant, everything fits in memory easily" to "critical, we're doing open world streaming and we've got terrabytes of raw data already, 16 vs 64GB of memory doesn't change that much")<p>> and data structures that use less memory?<p>Some bit packing type stuff comes up for smaller logical data structures in gamedev, and that can be useful for saving memory bandwidth, but I'm skeptical of how critical it is for total memory usage outside of the occasional Factorio.</p>
]]></description><pubDate>Sat, 20 Jun 2026 04:26:25 +0000</pubDate><link>https://news.ycombinator.com/item?id=48606337</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48606337</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48606337</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Lore – Open source version control system designed for scalability"]]></title><description><![CDATA[
<p>C++'s stdlib collection algorithms were basically all mutate-in-place instead of return-a-new-value until C++20 introduced ranges, and I still don't know anyone who actually uses those.  By contrast, people actually use the `container.iter().map(...)` etc. in Rust.<p>C++ also lacks much of the fancy pattern matching features which are frequently associated with functional programming.  Such features may not be fundamental to functional programming, but they <i>would</i> fall under "some functional programming features", in the sense that they're common in the languages of that ecosystem.</p>
]]></description><pubDate>Wed, 17 Jun 2026 17:50:40 +0000</pubDate><link>https://news.ycombinator.com/item?id=48574006</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48574006</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48574006</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Software is made between commits"]]></title><description><![CDATA[
<p>> But you can learn to phrase your WTFs about your colleague's code politely and constructively. I would even argue that this an absolutely basic skill for professionals. It typically leads to faster and better answers whenever a discussion arises.<p>Phrasing things politely and constructively is what I'm explicitly advocating for when I'm calling for "tact", yes.  But said phrasing is not necessairly the very first thoughts out of my mind.  When we push back on sharing our raw thoughts, it's precisely because we want a moment to be able to translate from passionate, driven, and perhaps rude thoughts - to polite, if perhaps a bit professionally dispassionate words.  From unconvincing incendiary moral judgements against the cult of the singleton, to concrete examples of maintainence concerns and tradeoffs that can be discussed by everyone.  From things that barely make sense in the context of our own minds, to things communicated clearly within the context and bounds of our shared understanding.<p>> Even if confusion seems to spread in a discussion, I would expect the person who realizes this first to call that out and and to reset the conversation.<p>Simply calling out confusion is insufficient to <i>resolve</i> confusion.  Being able to narrow down <i>what</i> I'm confused <i>about</i> is an important skill and first step towards either unconfusing myself, or seeking help from others, allowing them to aid me in solving said confusion.<p>Unconfusing others is a step more difficult.  Unlike with my own confusion, I find it necessary to build an accurate mental model of <i>their</i> thought process through my own indirect observation and questions, to understand where they've misunderstood, the correct understanding, and then a means of explaining and contrasting those two states through nothing more than clear communication to bring them out of said confusion.  I may have to construct full blown examples, showing a concrete way their own initial biases fail them.<p>These are important skills and steps to take, of course, and you're right that there's nothing magic about it, but this is something I've expended a <i>lot</i> of time on over the decades I've been puttering around in development circles.  It's time intensive, requiring one or more people focusing on a single individual's issues, just to reset things to a baseline of being unconfused enough to do good work.<p>And, of course, it will always be necessary, and I'm glad to help.  It's a skill I believe I'm good at, and by unblocking coworkers and friends, I can potentially spend minutes of my time to save <i>hours</i> or even <i>days</i> of theirs, which is well worth it.  But it's also worth taking the time to avoid such scenarios coming up again.  It saves me time, and it saves <i>them</i> time.<p>Sometimes that means clearing up ambiguous or confusing documentation.<p>Sometimes that means keeping others at arm's length - at least until I'm at least no longer confused about what exactly I'm confused about.</p>
]]></description><pubDate>Sat, 13 Jun 2026 20:53:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=48521342</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48521342</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48521342</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Software is made between commits"]]></title><description><![CDATA[
<p>I don't want the private API key I temporarily hardcoded in my public history.  Nor do I want the drag of worrying about so much as sneezing in the general vicinity of a secret in my editor window, when I already self review before commit.<p>I don't want the unkind rant about a coworker's design as I attempt to figure out what they were smoking when they made the thing I'm trying to use, needlessly offending them.  For starters, once it clicks, it might all make sense, and have turned out to be my mistake.  For another, even if a rant is warranted, a pass for "tact", or at least limiting the blame to the blame that is <i>warranted</i>, is proper.<p>I don't want to drag a coworker through my chain of confusion until I've made an appropriate amount of effort to unconfuse myself first.  To do otherwise is likely to bring us both to confusion, possibly in different ways, possibly including confusion about what we're confused about, which is just a mess and dead weight.  There's a time and place to explain and teach, and a time and place to expose my own confusion and ask for help, but neither is step 1.<p>Even if the API is undocumented and confusing, even if you're <i>expected</i> to ask for help as step 1, there's value in a fresh set of eyes getting a feel for <i>exactly</i> how the API is confusing before that, thus informing directions for potential improvement (be that API changes or improved documentation.)</p>
]]></description><pubDate>Thu, 11 Jun 2026 22:50:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=48497478</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48497478</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48497478</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "Queues Don't Fix Overload (2014)"]]></title><description><![CDATA[
<p>I'll note that speedrunners absolutely buffer mid-pipeline in Factorio, and not just for hand-crafting purpouses.  Sometimes you're waiting for R&D, sometimes you're just running half the machines for twice as long, giving you the same output while saving on build costs.  The actual bottlenecks are constantly shifting.  "I'm not speedrunning!" you might say, but every regular game could've started as a speedrun that could've gotten you to where you are faster.<p>Understanding the tendency of mid-pipeline buffers to hide problems is useful, but scorning them entirely is also suboptimal.</p>
]]></description><pubDate>Thu, 11 Jun 2026 17:36:02 +0000</pubDate><link>https://news.ycombinator.com/item?id=48493574</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48493574</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48493574</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "The beauty and simplicity of the good old C-style void* in C++"]]></title><description><![CDATA[
<p>> That's the point, std::byte is for opaque bytes. You're not expected to do arithmetic directly just like you can't do arithmetic on void.<p>That'd make a whole lot more sense to me if `std::byte` didn't explicitly implement a whole bunch of bit twiddling operations:<p><pre><code>    << >> |= &= ^= | & ^ ~
</code></pre>
This isn't opaque.  This is a poor man's half-assed `std::bitset<8>` with a guaranteed `sizeof(std::byte) == 1`.</p>
]]></description><pubDate>Thu, 11 Jun 2026 16:55:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=48492905</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48492905</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48492905</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "The beauty and simplicity of the good old C-style void* in C++"]]></title><description><![CDATA[
<p>To be fair, the `void*` is already a pretty big hint that you're in the danger zone.</p>
]]></description><pubDate>Wed, 10 Jun 2026 00:17:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=48469586</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48469586</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48469586</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "The beauty and simplicity of the good old C-style void* in C++"]]></title><description><![CDATA[
<p>> if somewhere in the plumbing you connect the wrong source to the wrong destination, you get no warning.<p>A valid concern.  I've been in the position of having to fix those bugs.<p>I'm not going to recommend `qsort` over `std::sort` or anything like that.  I've seen `void*` "user data" pointers in C APIs and decided to stuff runtime checkable handle values in there instead of real pointers to blobs.  In Rust, this can mean avoiding some unnecessary `unsafe { ... }` blocks, since while reading anything from a `*const c_void` requires such things, reading from a global `Mutex<HashMap<*const c_void, Arc<dyn Any>>>` or similar nonsense does not.  I'll eat the performance hit unless I'm worrying about an actual hot path!<p>And I'm not going to stand in the way of newtype wrappers around void pointers either.  I'll +1 the PRs with `class ASpecificKindOfBlob { void* data; size_t length; };` and suchlike as well, if `std::span`s aren't your type of thing, and abide by measures to centralize such plumbing in one place such that the opportunities to make a mistake are fewer.<p>But sometimes a blob is just a blob, and breaking out `std::byte` is putting lipstick on a pig.  <i>And it's not even the right color lipstick.</i></p>
]]></description><pubDate>Wed, 10 Jun 2026 00:16:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=48469580</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48469580</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48469580</guid></item><item><title><![CDATA[New comment by MaulingMonkey in "The beauty and simplicity of the good old C-style void* in C++"]]></title><description><![CDATA[
<p>> Fair point (although to be honest: 'complexify' feels a bit of an exaggeration here to me)<p>Both uint8_t and std::byte require a header (<cstdint> or <cstddef>) which may expose you to platform x config specific build failures if you do any conditional #including, and the latter is a whole damn enum class with a strange adversion to arithmetic, where `byte |= 1` becomes `byte |= std::byte(1)`, `byte += 1` becomes `byte = std::byte(std::to_integer<std::uint8_t>(byte) + 1);`, and both become something you can accidentally <i>step into</i> in your full debug builds because it's an actual function call (at least on MSVC - still extra instructions on clang/gcc, but I can see the dang <i>call</i> instruction on MSVC!) instead of a compiler built in.<p>Not to mention, neither is vanilla C++03... I threw a `std::byte` example in a quick godbolt snippet and MSVC wouldn't compile without adding /std:c++17, because of course it defaults to earlier.  Which is silly, but that's also the story of my life.<p>And don't get me wrong - that's all relatively minor - but it's all for middling to negative value IME.  `void*` is frequently <i>clearer</i> - it's a signal that it's an opaque blob at this point in the code, and that <i>something else</i> will try to give it meaning <i>later</i>.  I struggle to think of a single bug that I've encountered, that would've been caught by the compiler had I used `std::byte` over `unsigned char` or `void`.  And conversely, I've seen APIs accepting `std::byte<i>` but requiring higher alignment, where with `void</i>` I might not have dropped my guard as much.<p>> `std::span`<p>At least manages to bind pointer and size into a single variable, which IME at least has the advantage of eliminating some bugs (e.g. mismatching pointers and sizes) and allowing some nifty utility functions to become a lot more wieldy.  You can do things like feed it an array and not have to do any of your own `sizeof(...)` shenannigans.  At <i>this</i> point you're possibly getting into positive expected value, but I'm going to eye roll at pull requests refactoring `void*` based stuff to use it unless I see at least one actual concrete example of calling code improving alongside it - I don't want just hypothetical theoretical ergonomics, I want actual concrete ergonomics!</p>
]]></description><pubDate>Tue, 09 Jun 2026 14:35:26 +0000</pubDate><link>https://news.ycombinator.com/item?id=48461714</link><dc:creator>MaulingMonkey</dc:creator><comments>https://news.ycombinator.com/item?id=48461714</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=48461714</guid></item></channel></rss>