<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: wabain</title><link>https://news.ycombinator.com/user?id=wabain</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Wed, 29 Apr 2026 00:09:15 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=wabain" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by wabain in "Rust panics under the hood, and implementing them in .NET"]]></title><description><![CDATA[
<p>I think what's really special about the main thread is that Rust (and I believe in some cases the OS) forces the process to exit if the main thread completes. I think the difference in panic handling is mostly down to that. I think the description in the docs for std::thread describe this distinction the most explicitly.[1]<p>Fundamentally panic recovery works the same way in all threads—for both the main thread and spawned threads the standard library implements panic handling by wrapping the user code in catch_unwind().[2][3] It's more or less possible to override the standard library's behavior for the main thread by wrapping all the code in your main() function in a catch_unwind() and then implementing whatever fallback behavior you want, like waiting for other threads to exit before terminating. In some cases something like this happens automatically, for instance if the main thread spawns other threads using std::thread::scope.[4]<p>[1]: <a href="https://doc.rust-lang.org/std/thread/#the-threading-model" rel="nofollow">https://doc.rust-lang.org/std/thread/#the-threading-model</a>
[2]: <a href="https://github.com/rust-lang/rust/blob/7042c269c166191cd5d8daf0409890903df7af57/library/std/src/thread/mod.rs#L521-L523">https://github.com/rust-lang/rust/blob/7042c269c166191cd5d8d...</a>
[3]: <a href="https://github.com/rust-lang/rust/blob/7042c269c166191cd5d8daf0409890903df7af57/library/std/src/rt.rs#L143-L147">https://github.com/rust-lang/rust/blob/7042c269c166191cd5d8d...</a>
[4]: <a href="https://doc.rust-lang.org/std/thread/fn.scope.html" rel="nofollow">https://doc.rust-lang.org/std/thread/fn.scope.html</a></p>
]]></description><pubDate>Tue, 24 Sep 2024 01:05:05 +0000</pubDate><link>https://news.ycombinator.com/item?id=41632152</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=41632152</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=41632152</guid></item><item><title><![CDATA[New comment by wabain in "Contra Wirecutter on the IKEA air purifier"]]></title><description><![CDATA[
<p>This article falls into the trap of conflating the Wirecutter's misapplication of filtration standards with irrelevant minutiae about which terms and diameters they cite for the filter classes. So alongside a pretty cogent description of how fine-matter filtration works by particle size, there's the claim that "a 'PM2.5 filter' … isn’t a thing," despite the PM2.5 class of fine particulate matter being the range specifically mentioned in the Ikea product description in the screenshot. A cursory search will turn up lots of results for filters which show that this is a pretty common term. Where the Wirecutter review actually goes wrong is in taking 2.5 microns as the lower bound of the particulate range, whereas it's conventionally the upper bound.<p>Then there's the idea that "Neither size mentioned (0.3 microns or 2.5 microns) has any relationship to either of the design specs" [the EU E12 and H13 standards]. When I google "hepa" my first hit is a US EPA page giving the specification for the most penetrating particle size of HEPA filters as 0.3 microns, rather than the 0.15 microns given in the article (from the empirical research or EU standards, I'm not sure which). This is from North America, but then, the Wirecutter is an American review site. It's worth considering this kind of (IMO) misfire in light of the article making the least charitable possible inference, that the Wirecutter deliberately set out to discredit the Ikea product because it couldn't give an affiliate link.<p>[1] <a href="https://www.epa.gov/indoor-air-quality-iaq/what-hepa-filter" rel="nofollow">https://www.epa.gov/indoor-air-quality-iaq/what-hepa-filter</a></p>
]]></description><pubDate>Mon, 20 Jun 2022 23:01:28 +0000</pubDate><link>https://news.ycombinator.com/item?id=31817352</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=31817352</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=31817352</guid></item><item><title><![CDATA[New comment by wabain in "`COPY –chmod` reduced the size of my container image by 35%"]]></title><description><![CDATA[
<p>I think the OP is confusing the runtime and image format a bit here. At runtime OverlayFS can use metadata-only copy up to describe changed files, but the container image is still defined as a sequence of layers where each layer is a tar file. There's no special handling for metadata-only changes of a file from a parent layer. As the OCI image spec puts it [1]:<p>> Additions and Modifications are represented the same in the changeset tar archive.<p>[1]: <a href="https://github.com/opencontainers/image-spec/blob/02efb9a75ee11e05937b535cc5f228f9343ab2f5/layer.md#change-types" rel="nofollow">https://github.com/opencontainers/image-spec/blob/02efb9a75e...</a></p>
]]></description><pubDate>Sat, 26 Mar 2022 14:56:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=30812376</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=30812376</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=30812376</guid></item><item><title><![CDATA[New comment by wabain in "A single line of code made a 24-core server slower than a laptop"]]></title><description><![CDATA[
<p>This is an excellent writeup, but I'm curious about how dependent the microbenchmark is on the scripting engine doing no real work. My off-the-cuff guess is that the unshared version might still perform better with other workloads (it would have higher throughput and avoid variance caused by fluctuating degrees of cache contention) but it might be that the observable overhead from hammering a single cache line would disappear if each thread had more varied work to do. And of course if the scripting engine benefits substantially from caching internal state across invocations (things like incrementally optimized JIT code) then having 24 instances can incur substantial extra work.</p>
]]></description><pubDate>Fri, 31 Dec 2021 16:53:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=29749816</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=29749816</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29749816</guid></item><item><title><![CDATA[New comment by wabain in "Parse, Don't Validate (2019)"]]></title><description><![CDATA[
<p>I mean, there's ample evidence on this thread to suggest we're not going to reach a productive conclusion here but I guess I'll keep biting.<p>It's not clear to me if you are suggesting that a dynamic routing table with different kinds of routes cannot be implemented in a type-safe manner in a statically typed language, or if you're working with an analogy where a routing table is <i>like</i> a dynamic programming language at runtime, in that a static set of entities and relations are known ahead of time and those are modified by runtime input. If it's the latter I'm not really sure how the analogy works—if programming languages are to routers as types are to routing entries, what in a router is analogous to a value of a given type?<p>I can speak more to the former possibility; here's a rough sketch of how one could implement a routing table using the tools available in a statically typed environment (and in a type-safe way). One way to do it (I believe the common way, and certainly the only one I've seen in commercial router implementations) is to treat statically populated and dynamically learned routes more or less uniformly in the data structures used to perform data-plane lookups. Each such route entry has the same fields and gets inserted into a data structure with a predefined shape. Where special behavior is needed for routes of different kinds, that behavior can be implemented by using dynamic dispatch in the sense it's usually used in C++, Java, Rust, etc. to call a method associated with a route entry, or using other techniques common to statically compiled languages—there is a fixed set of such operations defined up front. Adding and removing entries from the routing table at runtime does not typically implicate type safety because the types used to describe the table describe all of its possible valid states. For instance, the type for a node in a radix trie might describe how it can either be leaf node or contain subnodes, etc.<p>> The schema need not change. The entries/relations between objects changing is sufficient to violate type-safety.
>
> Route add( <i>str1, </i>str2) to Number.add().<p>It's obviously not <i>always</i> true that entries or relations changing will validate type safety; any non-trivial system will let you perform some kinds of data manipulation at runtime. Conventional static type systems will allow some kinds of mutations (like changing around pointers in a radix trie to insert a new node) but will not have the flexibility to support some others (like changing the shape of a dispatch table at runtime).<p>One kind of call pattern which <i>is</i> incompatible with statically compiled dynamic dispatch is where the types of parameters change along with the base type which owns the dispatch table; I think this is what your add() example is getting at—you need the type of the second parameter to match the first, which you can't validate without runtime checks if you don't know what concrete implementations will be in use at runtime. In the case of a routing table I don't think this kind of polymorphism is needed though; I can't think of an instance where an operation would fundamentally require a fixed relation in the concrete types of different routes. For instance, when routes overlap you can derive a priority value for each one to decide which one to use, rather than directly implementing some kind of function whichIsBetter(a, b) which relies on knowing what concrete route kinds a and b are.</p>
]]></description><pubDate>Mon, 28 Jun 2021 02:43:53 +0000</pubDate><link>https://news.ycombinator.com/item?id=27657552</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=27657552</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27657552</guid></item><item><title><![CDATA[New comment by wabain in "Parse, Don't Validate (2019)"]]></title><description><![CDATA[
<p>I don't think this analogy quite holds together. A router doing lookups from a table is implementing a static routing strategy from a <i>control plane</i> perspective; it's using statically configured values instead of using dynamic information about the network topology gleaned using a routing protocol like BGP. But an implementation of that strategy in terms of table lookups is dynamic—it's walking a data structure to retrieve values which were specified in the runtime configuration, not at compile time.<p>The reason that "dynamic dispatch" in Java, etc. is called that is that the instance of the dispatch table to use is chosen dynamically, rather than being fixed at the callsite. It's true that Java doesn't let the shape of the dispatch table change at runtime, but that's not what dynamic vs static refers to conventionally in this context. The ability to dynamically add and remove methods from a class <i>is</i> something which you typically only get in dynamically typed languages but dynamic dispatch and dynamic typing are not the same thing.<p>In particular, while a full-featured routing information base implementation will usually use some form of dynamic dispatch to customize the behavior of routes originated through different protocols, it's very uncommon for an implementation to rely on dynamic typing which adds or mutates the methods associated with different entities. That's simply a different kind of tool used for different purposes. It's something which can be helpful in object-relational mapping, for instance, because you can create methods based on a dynamic database schema. The RIB is not going to have a schema like that which changes at runtime.</p>
]]></description><pubDate>Sun, 27 Jun 2021 18:50:06 +0000</pubDate><link>https://news.ycombinator.com/item?id=27654120</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=27654120</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=27654120</guid></item><item><title><![CDATA[New comment by wabain in "I've been writing TILs for 5 years"]]></title><description><![CDATA[
<p>You might need something beyond mouse=a to get Putty to report the mouse through to vim—maybe this option? <a href="https://superuser.com/questions/513014/moving-cursor-in-putty-with-mouse-click#answer-517166" rel="nofollow">https://superuser.com/questions/513014/moving-cursor-in-putt...</a></p>
]]></description><pubDate>Sun, 26 Apr 2020 20:10:44 +0000</pubDate><link>https://news.ycombinator.com/item?id=22989804</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=22989804</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22989804</guid></item><item><title><![CDATA[New comment by wabain in "I've been writing TILs for 5 years"]]></title><description><![CDATA[
<p>What I had meant was that when using vim configured with mouse=a, selecting with the mouse while holding down the Alt key would disable the terminal emulator's mouse reporting and allow the selection to be copied to the system clipboard.<p>But actually this depends entirely on the terminal emulator. The Alt/Option key works with the default preferences for iTerm2 on MacOS, but with GNOME terminal I reproduced the same behavior using Shift instead.</p>
]]></description><pubDate>Sun, 26 Apr 2020 20:07:13 +0000</pubDate><link>https://news.ycombinator.com/item?id=22989776</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=22989776</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22989776</guid></item><item><title><![CDATA[New comment by wabain in "I've been writing TILs for 5 years"]]></title><description><![CDATA[
<p>To add what was an essential follow-up for me when I discovered this: Once you’ve enabled mouse=a, use the alt key to select text in vim for your system clipboard, rather than vim’s visual mode.</p>
]]></description><pubDate>Sun, 19 Apr 2020 13:20:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=22915697</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=22915697</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22915697</guid></item><item><title><![CDATA[New comment by wabain in "Old CSS, New CSS"]]></title><description><![CDATA[
<p>Did XHTML ever allow styling with XPath, or is it just used for jQuery-style element selection? My uneducated impression was that for performance reasons browser devs were rejecting even more restricted backwards-lookup and nesting selectors for styling.<p>I've encountered some uses of XPath to validate the semantics of XML data models (this kind of thing still has mindshare in some places - network devices for instance <a href="https://tools.ietf.org/html/rfc7950#section-7.21.5" rel="nofollow">https://tools.ietf.org/html/rfc7950#section-7.21.5</a> ) and I've come to the conclusion that wanting XPath is usually a danger sign. It's helpful for manipulating content you can't control, but that leads to people designing interfaces and models that are too difficult to work with downstream. In document display settings that manifests as a content vs. presentation mentality where you have to write byzantine queries to wrestle data into reasonable output. In configuration use cases I've seen it lead to interfaces that claim way more general edit operations than the implementation can actually pull off, as people struggle to specify XPath-based constraints to make it tractable. It's much better if at all possible to have some kind of scripted layer to do transformations than to try to manipulate a general presentable-cum-semantic data tree.<p>On the XHTML vs HTML5 side, React at least does a good job warning you if you're trying to render something that violates DOM nesting (out of necessity as much as anything, since it will need to operate on the generated tree).</p>
]]></description><pubDate>Sun, 02 Feb 2020 22:12:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=22219806</link><dc:creator>wabain</dc:creator><comments>https://news.ycombinator.com/item?id=22219806</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=22219806</guid></item></channel></rss>