home bbs files messages ]

Forums before death by AOL, social media and spammers... "We can't have nice things"

   comp.lang.c      Meh, in C you gotta define EVERYTHING      243,242 messages   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]

   Message 242,170 of 243,242   
   bart to Waldek Hebisch   
   Re: _BitInt(N)   
   27 Nov 25 02:18:03   
   
   From: bc@freeuk.com   
      
   On 27/11/2025 01:30, Waldek Hebisch wrote:   
   > bart  wrote:   
   >> And yet, integer widths have been roughly capped at double a machine   
   >> word size for decades - until 64 bits came along and then few even   
   >> bothered with double-width.   
   >>   
   >> Nobody thought how easy it would be to just have an integer of whatever   
   >> size you like - you just generate whatever code is necessary to make it   
   >> happen. We could have had BitInts on 32- and even 16-bit machines if   
   >> only somebody had thought of it!   
   >   
   > PL/I had things like 'fixed binary(23)' (that is ability to   
   > specify bit size) around 1965, but that stopped at machine   
   > word length.  Pascal had range types, but similarly stopped   
   > at at integer size.   
      
   What were the reasons for PL/I to use odd sizes not related to word size   
   or memory width?   
      
      
   >  GNU Pascal allowed specifiying size in   
   > bits and going to twice machine word (that was limitation   
   > imposed by gcc backend).   
      
   Before 64-bits, we needed double the word size in order to represent   
   ordinary quantities. With 64 bits, there is much less need (hence few   
   128-bit types).   
      
      
   > And yes, such types could be added much earlier and it   
   > is a shame that they are added only now.   
      
   So what is the pressing need now?   
      
   It is a mild convenience for those applications which really need   
   numbers of 100s of bits, but not what I would have thought were worth   
   making special provision for in a language.   
      
   While they would be unwieldy for very much larger numbers, and in any   
   case there are caps in place.   
      
   I can see some use when you want a block datatype or so many bytes   
   (sorry, bits, since it needs to be bit-precise even at the large scale),   
   especially if some bitwise ops are available.   
      
   Eg. do some of the things that Pascal bit-sets were used for, but   
   there's still seems to be lots of support lacking.   
      
   So it still appears to me a rather heavyweight feature, in a lightweight   
   language, that is lacking in everyday use-cases.   
      
   > Part of reason may be that in nineties usage of other   
   > (than C) lower level languages went down.  C was   
   > traditionally quite minimal and did not want new to   
   > introduce new features.   
      
   --- SoupGate-Win32 v1.05   
    * Origin: you cannot sedate... all the things you hate (1:229/2)   

[   << oldest   |   < older   |   list   |   newer >   |   newest >>   ]


(c) 1994,  bbs@darkrealms.ca