[HN Gopher] Truth Functional Logic for Hackers
       ___________________________________________________________________
        
       Truth Functional Logic for Hackers
        
       Author : ChilledTonic
       Score  : 28 points
       Date   : 2025-03-11 18:30 UTC (4 hours ago)
        
 (HTM) web link (lagomor.ph)
 (TXT) w3m dump (lagomor.ph)
        
       | tantalor wrote:
       | I don't get it. Isn't this what compilers are for? So I don't
       | have to rewrite my code in an equivalent but stupider way just to
       | get a marginal performance gain.
        
         | bbaron63 wrote:
         | Presumably, the compiler is not aware of the hardware bug in
         | the OR operation, so it won't do any transforms to avoid using
         | the OR operation.
        
           | tantalor wrote:
           | Okay so... then patch the compiler? This is basic stuff.
        
       | mcguire wrote:
       | The important part is at the end of the article: " _For those
       | interested in building a stronger foundation in logic, the Open
       | Logic Project provides excellent free educational resources on
       | propositional and predicate logic, formal proof systems, and
       | other topics such as modal logic and set theory - all targetted
       | towards a non-mathematical audience._ "
       | 
       | https://openlogicproject.org/
        
       | lucaspauker wrote:
       | https://en.wikipedia.org/wiki/De_Morgan%27s_laws
        
       | cluckindan wrote:
       | The code blocks' font size varies line by line on mobile. Hint:
       | set it to be smaller than the body text size because monospace
       | fonts tend to be a bit larger than proportional ones.
        
         | ChilledTonic wrote:
         | You've discovered a CSS issue that I did not notice for seven
         | years.
         | 
         | Thanks.
         | 
         | The issue was that for some reason, different types of code had
         | different font size settings.
        
       | hoppp wrote:
       | My first thought was to rewrite it without any or and operation.
       | just return early from if statement.
       | 
       | If user is blacklisted return access denied; If account is
       | expired return access denied; If no conditions match return
       | access granted;
       | 
       | Wouldn't that be more effective?
        
       | nvader wrote:
       | In this blog article from 2021, I warn about making this change
       | without appropriate care, as it has been a source of common bugs:
       | https://danverbraganza.com/writings/de-morgans-flaw-perform-...
        
       ___________________________________________________________________
       (page generated 2025-03-11 23:01 UTC)