On Mon, Oct 14, 2019 at 12:52 PM Lassi Kortela <xxxxxx@lassi.io> wrote:
 
$ upscheme -V

LGTM.
 
 We should probably just adopt their approach.

+1
 
For JVM Schemes like Kawa, there could probably be an equivalent
(java-type-bits ...). I don't know how stable the Java int, long etc.
sizes are.

Completely.  Long is s64, int  is s32, short is s16, and char is u16 (not u8 or s8 or u21) on all JVMs and also CLRs (C#).
 
based on
<https://docs.oracle.com/javase/tutorial/java/nutsandbolts/datatypes.html>
you can switch "int" between signed and unsigned in some situations!

 Not really.  There are standard libraries that provide comparison, division, remainder string->number, and number->string on the signed ints *as if* they were unsigned, that's all.  The unsigned values aren't a separate type.

In C, the signedness of "char" is famously undefined; I don't know whether
that is useful information for Scheme. I can't think of any use for it.

Signed chars are completelyl bogus, and result from what is arguably a bug in the PDP-11 architecture: loading an 8-bit value into a 16-bit CPU register sign-extended it instead of zero-extending it.  Unfortunately, gcc, clang, and Visual C all treat plain char as signed.  Stick to unsigned char.



John Cowan          http://vrici.lojban.org/~cowan        xxxxxx@ccil.org
A rabbi whose congregation doesn't want to drive him out of town isn't
a rabbi, and a rabbi who lets them do it isn't a man.    --Jewish saying