comp.lang.ada
 help / color / mirror / Atom feed
From: "Randy Brukardt" <randy@rrsoftware.com>
Subject: Re: Ada Implementation of functions and produce C for exotic architectures (Expressif)
Date: Wed, 11 Apr 2018 17:30:05 -0500
Date: 2018-04-11T17:30:05-05:00	[thread overview]
Message-ID: <pam29d$b1j$1@franka.jacob-sparre.dk> (raw)
In-Reply-To: 6975300f-6280-4a45-90fe-75edb881ba26@googlegroups.com

"Dan'l Miller" <optikos@verizon.net> wrote in message 
news:6975300f-6280-4a45-90fe-75edb881ba26@googlegroups.com...
...
>But then there are categories of C's undefined behavior that are
>more like a white-lie fib in most cases, rather than capital-punishment
>crimes:  Relying numerous times on undefined behavior regarding
>integers is commonplace in C and C++, especially regarding char,
>short, int, long, long long instead of int8_t, uint8_t, int16_t, uint16_t,
>int32_t, uint32_t, int64_t, uint64_t, as well as various dubious
>typecasts, as long as one is not porting to one of the astronomically
>weird processors:
>1) Prime 50 series (e.g., no 8-bit byte addresses other than via
>seldom-utilized bit-pointers; ASCII characters are in the range
>128 to 255; schizophrenia of sorts between 16-bit char holding
> one character or two packed 8-bit characters)
>2) the GE and Honeywell processors that Multics ran on (e.g.,
> 9-bit bytes; 36-bit integers)
>3) various modern-era FPGAs with parity turned off (e.g.,
> 9-bit bytes)
>4) various modern-era DSPs (e.g., 32-bit bytes)

You forgot :-) the Unisys U1100/2200 series, also 9-bit bytes; 36-bit 
integers. We built a version of Janus/Ada for that processor targetting 
their C compiler code generator. It was an *interesting* project. The 
front-end of Janus/Ada is able to target virtually any processor after all 
of the abstraction work that had to be done for that project. I'm not sure I 
should say much more, I presume the NDAs are still active.

                                   Randy.




Fortunately for the cavalier C community, IA32, IA64, MIPS, ARM, 
POWER/PowerPC, AMD64, 2900, 6800, 68000, 6502, 88000, Z80, 8085, 16016, 
32032, DEC VAX, Alpha, and so forth processors & microprocessors & embedded 
controllers since the 1970s have an ISA behavior that sufficiently resembled 
PDP-11 (likely intentionally) enough that various integer-related undefined 
behavior causes noticeable bugs at a manageably-infrequent rate (e.g., once 
per change to different processor by management or at Apple once a decade or 
so). 



  reply	other threads:[~2018-04-11 22:30 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-04-11 17:17 Ada Implementation of functions and produce C for exotic architectures (Expressif) Patrice Freydiere
2018-04-11 18:46 ` Dan'l Miller
2018-04-11 19:07   ` Patrice Freydiere
2018-04-11 19:22     ` Dan'l Miller
2018-04-11 20:31       ` Niklas Holsti
2018-04-12  8:10         ` Mark Lorenzen
2018-04-11 19:41   ` Paul Rubin
2018-04-11 20:31     ` Dan'l Miller
2018-04-11 22:30       ` Randy Brukardt [this message]
2018-04-11 21:14 ` Simon Wright
2018-04-12  6:17   ` Patrice Freydiere
2018-04-12  7:19     ` rrr.eee.27
2018-04-12  7:51       ` Simon Wright
2018-04-11 21:57 ` Dan'l Miller
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox