[HN Gopher] Linear Types for Programmers (2023)
       ___________________________________________________________________
        
       Linear Types for Programmers (2023)
        
       Author : marvinborner
       Score  : 34 points
       Date   : 2025-08-02 16:52 UTC (6 hours ago)
        
 (HTM) web link (twey.io)
 (TXT) w3m dump (twey.io)
        
       | scythmic_waves wrote:
       | Sorry off topic but I love the styling of this site.
        
       | jnpnj wrote:
       | Newb question, aren't phantom types and typestates a subset (or
       | cousin) of linear types ?
        
         | burakemir wrote:
         | No. A phantom type is a type whose only use is to communicate a
         | constraint on a type variable, without having a runtime value
         | that corresponds to it.
         | 
         | Typestate is a bit closer: it communicates some property where
         | an operation (typically a method invocation) changes the
         | property and hence the typestate. But there isn't necessarily a
         | mechanism that renders the value in the old typestate
         | inaccessible. When there is, then this indeed requires some
         | linearity/affinity ("consuming the object"), but typestate is
         | something built "on top".
        
       | renox wrote:
       | There's Austral https://austral-lang.org/ for linear types, I'm
       | not sure what is the state of the language but it has a nice
       | tutorial about linear types.
        
       ___________________________________________________________________
       (page generated 2025-08-02 23:01 UTC)