Re: Computer architects leaving Intel...

Liste des GroupesRevenir à c arch 
Sujet : Re: Computer architects leaving Intel...
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.arch
Date : 05. Sep 2024, 23:51:57
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vbdcmk$gug7$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
User-Agent : Mozilla Thunderbird
On 9/5/2024 8:27 AM, David Brown wrote:
On 05/09/2024 10:51, Niklas Holsti wrote:
On 2024-09-05 10:54, David Brown wrote:
On 05/09/2024 02:56, MitchAlsup1 wrote:
On Thu, 5 Sep 2024 0:41:36 +0000, BGB wrote:
>
On 9/4/2024 3:59 PM, Scott Lurndal wrote:
>
Say:
   long z;
   int x, y;
   ...
   z=x*y;
Would auto-promote to long before the multiply.
>
\I may have to use this as an example of C allowing the programmer
to shoot himself in the foot; promotion or no promotion.
>
You snipped rather unfortunately here - it makes it look like this was code that Scott wrote, and you've removed essential context by BGB.
>
>
While I agree it is an example of the kind of code that people sometimes write when they don't understand C arithmetic, I don't think it is C-specific.  I can't think of any language off-hand where expressions are evaluated differently depending on types used further out in the expression.  Can you give any examples of languages where the equivalent code would either do the multiplication as "long", or give an error so that the programmer would be informed of their error?
>
>
The Ada language can work in both ways. If you just have:
>
    z : Long_Integer;  -- Not a standard Ada type, but often provided.
    x, y : Integer;
    ...
    z := x * y;
>
the compiler will inform you that the types in the assignment do not match: using the standard (predefined) operator "*", the product of two Integers gives an Integer, not a Long_Integer.
 That seems like a safe choice.  C's implicit promotion of int to long int can be convenient, but convenience is sometimes at odds with safety.
 
A lot of time, implicit promotion will be the "safer" option than first doing an operation that overflows and then promoting.
Annoyingly, one can't really do the implicit promotion first and then promote afterwards, as there may be programs that actually rely on this particular bit of overflow behavior.
In effect, in my case, the promotion behavior ends up needing to depend on the language-mode (it is either this or maybe internally split the operators into widening or non-widening variants, which are selected when translating the AST into the IR stage).
Well, as opposed to dealing with the widening cases by emitting IR with an implicit casts added into the IR.

 
If you add this definition to the code:
>
    function "*" (Left, Right : Integer) return Long_Integer
    is (Long_Integer(Left) * Long_Integer(Right));
>
the compiler sees that there is now /also/ an Integer * Integer => Long_Integer multiplication operator, and uses that. Function overloading in Ada can depend on the type expected of the result.
>
 You can make types in C++ that have this effect, but you have to make them and use them consistently.  You can't overload operators on standard types like that.
 
Perhaps you asked for a language that worked like this "out of the box", without the programmer having to add things like the "*" function above, and then Ada would not qualify on the second alternative (automatic lengthening before multiplication, depending on the result type desired).
>
 I asked for either, and you gave me both :-)
 
>
(I don't count personal one-person languages here.
>
While Ada has low market penetration, I don't think it quite qualifies as a one-person language -- yet :-)
>
 
Ironically, my language isn't itself well specified or tested, but ironically, much of the core of the implementation is tested, in my case, for sake of the same code also being used for compiling C.
Well, and in some cases I went and added C23 proposed lambdas (which reused C++ syntax), mostly because BS2 already had lambdas (so, it was mostly a parser thing in this case). But, then, C23 didn't add lambdas.
But, ironically, I had ended up with two implementations of BS2:
   At first, I started prototyping it in BGBCC;
   But, then switched to a new VM for my 3D engine;
     I wanted to do "load from source" like Doom 3;
     Load from source would have been an issue with BGBCC;
     But, then still ended up mostly using static-compiled bytecode;
     Like, it adds overhead to compile stuff at startup time.
   Now, I am back mostly to BGBCC.
It is kinda sad in a way though, as the new VM did have a nicer AST system and a better designed bytecode format. I did since make the AST's in BGBCC "slightly less bad", but would be more work to redesign the bytecode (and efforts keep fizzling out as the existing bytecode "works good enough").
And, then one can argue, "if you are going to redesign the bytecode anyways, why not jump over to CIL / MSIL ?...", which could almost work except that the structure of the metadata is awkward/inflexible and does not map over well to BGBCC (which had used a more JVM-like structure), and was more designed for C# and is an awkward fit to C.
Well, also the way they are used is different, where BGBCC mostly uses RIL as a stand-in for object files and static libraries. And a "lazier but semi-good" option might be to stick to the existing RIL format, but have a separate RIL object per translation unit (rather than all of the TU's in the compiler invocation), with a "symbol manifest" (more like in ".a" libraries). Then maybe pulling in objects as needed when it walks the reachable graph.
With the closest equivalent in MSVC being MSIL inside of COFF objects (or, in GCC land, GIMPLE code inside of object files). But, generally, there is no real expectation of object-file compatibility between compilers.
Though, more tempting to use WAD2 or WAD4 because the "!<arch>" format kinda sucks... (Well, and this was also sort of my plan in my stalled "new compiler" effort, which had intended to use tweaked WAD2 variants as both the object files and library files).
Might make sense to add a second FOURCC for "intention":
   struct Wad2aHeader_s {
     FOURCC magic;    //00 'WAD2'
     DWORD numLumps;  //04 number of directory entries
     DWORD ofsLumps;  //08 offset of lump directory in image
     DWORD ofsTags;   //0C: *
     DWORD resv0;     //10: Reserved (WAD4: Allocation Bitmap Offset)
     DWORD resv1;     //14: Reserved (WAD4: Allocation Bitmap Size)
     FOURCC intent1;  //18: Intention for image use.
     FOURCC intent2;  //1C: Intention sub-type
   };
*: WAD2: N/A / Zero
    WAD2A: FCC Tags and/or file extensions for lump types.
    WAD4: Offset of directory lookup hash table.
Normally, WAD2 lumps omit the file extension from the name, and use a 1-byte type tag. The meanings of this tag bytes were hard-coded in Quake and Half-Life, but for my uses I added a table to map lump types to FOURCC's or 3-char file extensions.
In contrast, WAD4 has file extensions in the lump names (32 bytes, unlike the 16-byte names in WAD2). Also 64 byte directory entries rather than 32. So, had used this spot to give the location of a prebuilt hash table used to be able to lookup entries more quickly.
Where, say, intent is 0/ignored if the WAD is being used as a basic container, but may be other values if being used to construct a more specialized format, as opposed to changing the main FOURCC, similar to the secondary main type FOURCC in RIFF.
If I put it at 0x18, it could be at the same offset in both formats.
Would have been more "elegant" to put it at 0x0C, but alas.
...

Date Sujet#  Auteur
27 Aug 24 * Computer architects leaving Intel...539Thomas Koenig
27 Aug 24 +- Re: Computer architects leaving Intel...1Michael S
27 Aug 24 +- Re: Computer architects leaving Intel...1Stephen Fuld
27 Aug 24 `* Re: Computer architects leaving Intel...536John Dallman
28 Aug 24  +* Re: Computer architects leaving Intel...529BGB
28 Aug 24  i`* Re: Computer architects leaving Intel...528MitchAlsup1
28 Aug 24  i `* Re: Computer architects leaving Intel...527BGB
28 Aug 24  i  +* Re: Computer architects leaving Intel...2Robert Finch
28 Aug 24  i  i`- Re: Computer architects leaving Intel...1BGB
28 Aug 24  i  `* Re: Computer architects leaving Intel...524MitchAlsup1
29 Aug 24  i   `* Re: Computer architects leaving Intel...523BGB
29 Aug 24  i    +* Re: Computer architects leaving Intel...511MitchAlsup1
29 Aug 24  i    i`* Re: Computer architects leaving Intel...510BGB
30 Aug 24  i    i +* Re: Computer architects leaving Intel...499John Dallman
30 Aug 24  i    i i+* Re: Computer architects leaving Intel...11Thomas Koenig
30 Aug 24  i    i ii+- Re: Computer architects leaving Intel...1Michael S
30 Aug 24  i    i ii+* Re: Computer architects leaving Intel...8Anton Ertl
30 Aug 24  i    i iii+* Re: Computer architects leaving Intel...2Michael S
30 Aug 24  i    i iiii`- Re: Computer architects leaving Intel...1Anton Ertl
30 Aug 24  i    i iii`* Re: Computer architects leaving Intel...5John Dallman
30 Aug 24  i    i iii `* Re: Computer architects leaving Intel...4Brett
30 Aug 24  i    i iii  +- Re: Computer architects leaving Intel...1John Dallman
2 Sep 24  i    i iii  `* Re: Computer architects leaving Intel...2Terje Mathisen
2 Sep 24  i    i iii   `- Re: Computer architects leaving Intel...1Thomas Koenig
30 Aug 24  i    i ii`- Re: Computer architects leaving Intel...1BGB
30 Aug 24  i    i i`* Re: Computer architects leaving Intel...487Anton Ertl
30 Aug 24  i    i i +* Re: Computer architects leaving Intel...302John Dallman
30 Aug 24  i    i i i`* Re: Computer architects leaving Intel...301David Brown
30 Aug 24  i    i i i +* Re: Computer architects leaving Intel...293Anton Ertl
30 Aug 24  i    i i i i`* Re: Computer architects leaving Intel...292Bernd Linsel
31 Aug 24  i    i i i i +- Re: Computer architects leaving Intel...1Thomas Koenig
31 Aug 24  i    i i i i `* Re: Computer architects leaving Intel...290Thomas Koenig
31 Aug 24  i    i i i i  +- Re: Computer architects leaving Intel...1Thomas Koenig
31 Aug 24  i    i i i i  `* Re: Computer architects leaving Intel...288Bernd Linsel
31 Aug 24  i    i i i i   +- Re: Computer architects leaving Intel...1Thomas Koenig
31 Aug 24  i    i i i i   +* Re: Computer architects leaving Intel...2Thomas Koenig
31 Aug 24  i    i i i i   i`- Re: Computer architects leaving Intel...1Bernd Linsel
31 Aug 24  i    i i i i   `* Re: Computer architects leaving Intel...284Anton Ertl
31 Aug 24  i    i i i i    +* Re: Computer architects leaving Intel...279Thomas Koenig
31 Aug 24  i    i i i i    i+* Re: Computer architects leaving Intel...157Bernd Linsel
31 Aug 24  i    i i i i    ii+* Re: Computer architects leaving Intel...153MitchAlsup1
1 Sep 24  i    i i i i    iii`* Re: Computer architects leaving Intel...152Stephen Fuld
2 Sep 24  i    i i i i    iii `* Re: Computer architects leaving Intel...151Terje Mathisen
2 Sep 24  i    i i i i    iii  `* Re: Computer architects leaving Intel...150Stephen Fuld
3 Sep 24  i    i i i i    iii   +* Re: Computer architects leaving Intel...139David Brown
3 Sep 24  i    i i i i    iii   i+* Re: Computer architects leaving Intel...108Stephen Fuld
4 Sep 24  i    i i i i    iii   ii`* Re: Computer architects leaving Intel...107David Brown
4 Sep 24  i    i i i i    iii   ii +* Re: Computer architects leaving Intel...103Terje Mathisen
4 Sep 24  i    i i i i    iii   ii i+* Re: Computer architects leaving Intel...101David Brown
4 Sep 24  i    i i i i    iii   ii ii+* Re: Computer architects leaving Intel...97jseigh
4 Sep 24  i    i i i i    iii   ii iii`* Re: Computer architects leaving Intel...96David Brown
4 Sep 24  i    i i i i    iii   ii iii `* Re: Computer architects leaving Intel...95Brett
4 Sep 24  i    i i i i    iii   ii iii  +- Re: Computer architects leaving Intel...1Thomas Koenig
4 Sep 24  i    i i i i    iii   ii iii  +- Re: Computer architects leaving Intel...1MitchAlsup1
5 Sep 24  i    i i i i    iii   ii iii  +* Re: Computer architects leaving Intel...8BGB
5 Sep 24  i    i i i i    iii   ii iii  i`* Re: Computer architects leaving Intel...7MitchAlsup1
5 Sep 24  i    i i i i    iii   ii iii  i `* Re: Computer architects leaving Intel...6David Brown
5 Sep 24  i    i i i i    iii   ii iii  i  `* Re: Computer architects leaving Intel...5Niklas Holsti
5 Sep 24  i    i i i i    iii   ii iii  i   `* Re: Computer architects leaving Intel...4David Brown
6 Sep 24  i    i i i i    iii   ii iii  i    `* Re: Computer architects leaving Intel...3BGB
6 Sep 24  i    i i i i    iii   ii iii  i     `* Re: Computer architects leaving Intel...2David Brown
9 Sep 24  i    i i i i    iii   ii iii  i      `- Re: Computer architects leaving Intel...1BGB
5 Sep 24  i    i i i i    iii   ii iii  +* Re: Computer architects leaving Intel...83David Brown
5 Sep 24  i    i i i i    iii   ii iii  i`* Re: Computer architects leaving Intel...82Terje Mathisen
5 Sep 24  i    i i i i    iii   ii iii  i +* Re: Computer architects leaving Intel...79David Brown
5 Sep 24  i    i i i i    iii   ii iii  i i+* Re: Computer architects leaving Intel...2Thomas Koenig
7 Sep 24  i    i i i i    iii   ii iii  i ii`- Re: Computer architects leaving Intel...1Tim Rentsch
5 Sep 24  i    i i i i    iii   ii iii  i i+* Re: Computer architects leaving Intel...74Terje Mathisen
5 Sep 24  i    i i i i    iii   ii iii  i ii+* Re: Computer architects leaving Intel...16David Brown
9 Sep 24  i    i i i i    iii   ii iii  i iii`* Re: Computer architects leaving Intel...15Terje Mathisen
9 Sep 24  i    i i i i    iii   ii iii  i iii +* Re: Computer architects leaving Intel...12David Brown
9 Sep 24  i    i i i i    iii   ii iii  i iii i`* Re: Computer architects leaving Intel...11Brett
10 Sep 24  i    i i i i    iii   ii iii  i iii i +* Re: Computer architects leaving Intel...5Terje Mathisen
10 Sep 24  i    i i i i    iii   ii iii  i iii i i`* Re: Computer architects leaving Intel...4Brett
10 Sep 24  i    i i i i    iii   ii iii  i iii i i +* Re: Computer architects leaving Intel...2Michael S
11 Sep 24  i    i i i i    iii   ii iii  i iii i i i`- Re: Computer architects leaving Intel...1Brett
11 Sep 24  i    i i i i    iii   ii iii  i iii i i `- Re: Computer architects leaving Intel...1Terje Mathisen
10 Sep 24  i    i i i i    iii   ii iii  i iii i `* Re: Computer architects leaving Intel...5David Brown
10 Sep 24  i    i i i i    iii   ii iii  i iii i  +* Re: Computer architects leaving Intel...3Anton Ertl
10 Sep 24  i    i i i i    iii   ii iii  i iii i  i`* Re: Computer architects leaving Intel...2David Brown
10 Sep 24  i    i i i i    iii   ii iii  i iii i  i `- Re: Computer architects leaving Intel...1Stefan Monnier
10 Sep 24  i    i i i i    iii   ii iii  i iii i  `- Re: Computer architects leaving Intel...1BGB
9 Sep 24  i    i i i i    iii   ii iii  i iii `* Re: Computer architects leaving Intel...2Michael S
10 Sep 24  i    i i i i    iii   ii iii  i iii  `- Re: Computer architects leaving Intel...1Michael S
5 Sep 24  i    i i i i    iii   ii iii  i ii+* Re: Computer architects leaving Intel...45Bernd Linsel
6 Sep 24  i    i i i i    iii   ii iii  i iii+- Re: Computer architects leaving Intel...1David Brown
9 Sep 24  i    i i i i    iii   ii iii  i iii+* Re: Computer architects leaving Intel...2Terje Mathisen
9 Sep 24  i    i i i i    iii   ii iii  i iiii`- Re: Computer architects leaving Intel...1Tim Rentsch
14 Sep 24  i    i i i i    iii   ii iii  i iii`* Re: Computer architects leaving Intel...41Kent Dickey
14 Sep 24  i    i i i i    iii   ii iii  i iii +* Re: Computer architects leaving Intel...32Anton Ertl
14 Sep 24  i    i i i i    iii   ii iii  i iii i+* Re: Computer architects leaving Intel...29MitchAlsup1
14 Sep 24  i    i i i i    iii   ii iii  i iii ii`* Re: Computer architects leaving Intel...28Thomas Koenig
15 Sep 24  i    i i i i    iii   ii iii  i iii ii `* Re: Computer architects leaving Intel...27David Brown
16 Sep 24  i    i i i i    iii   ii iii  i iii ii  +* Re: Computer architects leaving Intel...5Thomas Koenig
16 Sep 24  i    i i i i    iii   ii iii  i iii ii  i`* Re: Computer architects leaving Intel...4David Brown
16 Sep 24  i    i i i i    iii   ii iii  i iii ii  i `* Re: Computer architects leaving Intel...3Thomas Koenig
17 Sep 24  i    i i i i    iii   ii iii  i iii ii  i  +- Re: Upwards and downwards compatible, Computer architects leaving Intel...1John Levine
17 Sep 24  i    i i i i    iii   ii iii  i iii ii  i  `- Re: Computer architects leaving Intel...1David Brown
16 Sep 24  i    i i i i    iii   ii iii  i iii ii  `* Re: Computer architects leaving Intel...21Terje Mathisen
16 Sep 24  i    i i i i    iii   ii iii  i iii ii   `* Re: Computer architects leaving Intel...20David Brown
16 Sep 24  i    i i i i    iii   ii iii  i iii ii    +* Re: Computer architects leaving Intel...14Michael S
17 Sep 24  i    i i i i    iii   ii iii  i iii ii    `* Re: Computer architects leaving Intel...5Terje Mathisen
15 Sep 24  i    i i i i    iii   ii iii  i iii i`* Re: Computer architects leaving Intel...2BGB
14 Sep 24  i    i i i i    iii   ii iii  i iii +* Re: Computer architects leaving Intel...3Thomas Koenig
16 Sep 24  i    i i i i    iii   ii iii  i iii `* Re: Computer architects leaving Intel...5Tim Rentsch
6 Sep 24  i    i i i i    iii   ii iii  i ii+* Re: Computer architects leaving Intel...3Tim Rentsch
7 Sep 24  i    i i i i    iii   ii iii  i ii`* Re: Computer architects leaving Intel...9Chris M. Thomasson
5 Sep 24  i    i i i i    iii   ii iii  i i`* Re: Computer architects leaving Intel...2MitchAlsup1
5 Sep 24  i    i i i i    iii   ii iii  i `* Re: Computer architects leaving Intel...2MitchAlsup1
7 Sep 24  i    i i i i    iii   ii iii  `- Re: Computer architects leaving Intel...1Tim Rentsch
4 Sep 24  i    i i i i    iii   ii ii`* Re: Computer architects leaving Intel...3Thomas Koenig
6 Sep 24  i    i i i i    iii   ii i`- Re: Computer architects leaving Intel...1Chris M. Thomasson
4 Sep 24  i    i i i i    iii   ii +- Re: Computer architects leaving Intel...1jseigh
13 Sep 24  i    i i i i    iii   ii `* Re: Computer architects leaving Intel...2Stephen Fuld
3 Sep 24  i    i i i i    iii   i`* Re: Computer architects leaving Intel...30Stefan Monnier
3 Sep 24  i    i i i i    iii   `* Re: Computer architects leaving Intel...10Terje Mathisen
31 Aug 24  i    i i i i    ii`* Re: Computer architects leaving Intel...3Thomas Koenig
1 Sep 24  i    i i i i    i`* Re: Computer architects leaving Intel...121David Brown
1 Sep 24  i    i i i i    +* Re: Computer architects leaving Intel...3John Dallman
3 Sep 24  i    i i i i    `- Re: Computer architects leaving Intel...1Stefan Monnier
30 Aug 24  i    i i i +- Re: Computer architects leaving Intel...1MitchAlsup1
30 Aug 24  i    i i i +* Re: Computer architects leaving Intel...4Stefan Monnier
30 Aug 24  i    i i i `* Re: Computer architects leaving Intel...2John Dallman
8 Sep 24  i    i i `* Re: Computer architects leaving Intel...184Tim Rentsch
30 Aug 24  i    i `* Re: Computer architects leaving Intel...10MitchAlsup1
31 Aug 24  i    `* Re: Computer architects leaving Intel...11Paul A. Clayton
29 Aug 24  `* Re: Computer architects leaving Intel...6Anton Ertl

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal