[HN Gopher] Best of show - abuse of libc
       ___________________________________________________________________
        
       Best of show - abuse of libc
        
       Author : mooreds
       Score  : 101 points
       Date   : 2021-01-08 20:52 UTC (2 hours ago)
        
 (HTM) web link (www.ioccc.org)
 (TXT) w3m dump (www.ioccc.org)
        
       | lxe wrote:
       | How did printf end up here in the first place? Decades of feature
       | additions, or were these features a part of an early spec?
        
         | segfaultbuserr wrote:
         | Fun fact, on glibc, an extension feature is that you can define
         | your own custom conversion specifiers for printf().
        
       | badsectoracula wrote:
       | Up next: a C compiler that compiles to printf statements :-P
        
         | hahajk wrote:
         | https://github.com/HexHive/printbf
         | 
         | well this is a brainfuck interpreter inside printf. I'm pretty
         | sure there are plenty of c-to-bf transpilers.
        
       | dang wrote:
       | General thread here:
       | https://news.ycombinator.com/item?id=25651942
        
         | navaati wrote:
         | Thanks for all, dang !
        
         | SftwreEngnr wrote:
         | Thanks for nothing, dang!
        
       | kderbyma wrote:
       | awesome. I didn't know about that printf hack....time for some
       | fun experiments
        
       | Groxx wrote:
       | > _Format specifiers can take extra "arguments". - "%hhn": store
       | the number of bytes written mod 256 to the char pointer ..._
       | 
       | Oh boy. I'll put that down for my "thing I don't think I wanted
       | to know" of the day.
        
         | rightbyte wrote:
         | There is some innocent beauty in the twistedness of printf -
         | especially with GNU extensions.
        
           | tomjakubowski wrote:
           | GNU's printf specifier language is Turing complete, I
           | believe.
        
             | alisonkisk wrote:
             | Theres a great example of what you can do with this,
             | submitted and discussed on HN here:
             | https://news.ycombinator.com/item?id=25690319
        
       ___________________________________________________________________
       (page generated 2021-01-08 23:00 UTC)