Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!eternal-september.org!feeder.eternal-september.org!mx02.eternal-september.org!.POSTED!not-for-mail From: Ben Bacarisse Newsgroups: comp.programming Subject: Re: 64-bit bytes Date: Tue, 13 Jan 2015 00:51:07 +0000 Organization: A noiseless patient Spider Lines: 41 Message-ID: <871tmzsdtw.fsf@bsb.me.uk> References: <1d1b426e-452d-43ac-a15d-31dff9833370@googlegroups.com> <442bffa5-0e87-4924-a8e2-19dc69236183@googlegroups.com> <07379e64-43df-4e01-9506-fee7d5f56c80@googlegroups.com> <874mrwmazc.fsf@ixod.org> <87lhl8t7a2.fsf@bsb.me.uk> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="10778"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/FDWZf/EfIyheu5joOXerJa3UpGsX8LX8=" Cancel-Lock: sha1:a7p95VvtpCzFbsC9/6YZlNYPwag= sha1:TPJrf6iGf7KwzoU55JFiwkxvbWw= X-BSB-Auth: 1.c94170faa7694540ff57.20150113005107GMT.871tmzsdtw.fsf@bsb.me.uk Xref: csiph.com comp.programming:5126 BartC writes: > On 12/01/2015 14:15, Ben Bacarisse wrote: >> Mark Carroll writes: > >>> Exactly. For instance, Erlang, being designed to run on various odd >>> computer architectures, lets one ask, >>> >>> erlang:system_info(wordsize) >>> >>> which is documented as, >>> >>> ] Returns the size of Erlang term words in bytes as an integer, i.e. on >>> ] a 32-bit architecture 4 is returned, and on a pure 64-bit architecture >>> ] 8 is returned. >>> >>> which clearly implies 8-bit bytes. >> >> I would not call 32-bit and 64-bit architectures "odd"! What would it >> do on a 36-bit or a 60-bit machine? > > At the time the language was created (1986 according to Wikipedia), it > must already have been clear that the machine word sizes the language > would be likely to run on, would be 16 or 32 or 64 bits. In other > words, be based on powers-of-two and therefore multiples of a byte. I agree it's a reasonable limitation. I'm just saying that these are not examples of odd computer architectures. > This is unlike C which is still (even now) expected to work on all > sorts of genuinely odd microprocessor architectures. > > (BTW what would C's sizeof(int) return on a 36-bit or 60-bit machine?) The only conforming C compiler I know of for such a systems reports 4 for sizeof(int) because ints have 36 bits and bytes 9. It's for a system running on Unisys machines. -- Ben.