Path: csiph.com!usenet.pasdenom.info!aioe.org!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: Mon, 12 Jan 2015 14:15:01 +0000 Organization: A noiseless patient Spider Lines: 37 Message-ID: <87lhl8t7a2.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> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: mx02.eternal-september.org; posting-host="017616aa25f81ec581c44d76d61ba2f3"; logging-data="3618"; mail-complaints-to="abuse@eternal-september.org"; posting-account="U2FsdGVkX1/JRU4GPxLj/gaMBo6yHkWIlzEdhqMrgco=" Cancel-Lock: sha1:zIbFIlU5V8KamnM9FqvsELkdu4Q= sha1:stBPfrJwNbBxlT+Vd0OS5S9VGIo= X-BSB-Auth: 1.d7e0a4905672a0097a97.20150112141501GMT.87lhl8t7a2.fsf@bsb.me.uk Xref: csiph.com comp.programming:5098 Mark Carroll writes: > BartC writes: > >> On 12/01/2015 11:59, Richard Heathfield wrote: > (snip) >>> and (b) hampers our ability to describe alternative computer architectures. >>> What advantage does this restriction give us that compensates for the loss >>> of flexibility? >> >> We already have 'word' for that, where you generally need to qualify its >> size, outside of a specific context such as a language. > (snip) > > 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? Not knowing anything about Erlang I'm curious about the need to make any assumption about bytes at all. Why does the function not return the number of value bits? Surely that's both more flexible an just as useful? -- Ben.