Re: technology discussion → does the world need a "new" C ?

Liste des GroupesRevenir à l c 
Sujet : Re: technology discussion → does the world need a "new" C ?
De : cr88192 (at) *nospam* gmail.com (BGB)
Groupes : comp.lang.c
Date : 07. Jul 2024, 00:01:08
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <v6cetg$3vrrp$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11
User-Agent : Mozilla Thunderbird
On 7/6/2024 2:15 PM, bart wrote:
On 06/07/2024 19:46, BGB wrote:
 
But, yeah, for most people, writing the compiler is always "someone else's problem".
>
>
Granted, even with as much suck as it was to write my own C compiler to target my ISA, it is still likely a better experience than it would have been trying to retarget GCC or Clang.
>
GCC is sort of a tangled mess of code, trying to add a new target would likely involve weaving it in all across the codebase, which is comparably fairly large (well into MLOC territory IIRC).
>
>
Any desire to retarget Clang is limited by the issue that it would involve needing to edit and recompile LLVM a large number of times, and LLVM takes an absurdly long time to recompile...
>
They are like "well, use -j N".
   But, like, "-j 1": It takes like 4 hours;
   "-j 4": It still takes around 1 hour, PC still usable.
   "-j 8": It takes 45 minutes, but PC is made unusable.
>
Doing so also eats most of the RAM, on a PC with 112 GB... (Can't install a full 128GB with my MOBO/chipset it seems).
>
At "-j 8", the HDD with the pagefile is basically running at full capacity.
 Those figures are extraordinary.
 But do you really need to recompile everything in LLVM even when changing only target-specific components?
 
I haven't looked into it too much, but as I understand it, changing target stuff will require rebuilding LLVM each time. Either way, I didn't feel terribly inclined to find out.
Seemingly the usual answer is "have a Linux box with some absurd hardware stats to use as a build server". This is, not ideal...
Like, I don't exactly have the money to afford on a "Dual socket Threadripper with 256GB of RAM" or similar in order to try to get semi-fast LLVM rebuilds.

How much of it is due to it using C++ rather than C?
 
Probably a fair bit.
When I looked at the LLVM code before, it seems like they are writing C++ in a similar way to how one would write code in Java. This sort of thing seems "kinda evil" for build times...

Maybe you should consult with David Brown who doesn't believe in the benefits of fast compilers, and always knows some tricks to get a build-time in seconds no matter how slow the compiler.
 
I can generally recompile BGBCC in a few seconds...
Though, for the most part, it is a monolithic unity build, for better or for worse.
Could potentially split it up into multiple components, but doing so would make it more of a hassle than leaving it as a single monolithic entity.

 With my own tools, that run on one core with 8GB (2GB of which seems tied up with the display for some reason, even though the HD display needs only a 0.006GB frame buffer), I can't do anything else when compiling, because it will have finished before I've taken my finger off the Enter key!
 This is largely thanks to machines now being so fast rather than my coding skills, but also because I've never managed to learn how to write huge, bloated, inefficient software.
 
Code tends to get kinda bulky in my case, but still fairly small vs a lot of OSS projects.
As noted, BGBCC is around 250 kLOC.
Overall project is around 2 MLOC, but around half of this is from ported software.
So, say (very loosely):
   250 kLOC: BGBCC
   100 kLOC: jx2vm (CPU emulator)
   200 kLOC: TestKern "OS" and runtime libraries.
     Highly modified PDPCLIB
     Stuff for memory management, filesystem, etc.
     A makeshift GUI of sorts;
     An OpenGL 1.x implementation;
     ...
   ...
Then, say, other stuff:
   50 kLOC: Doom
   75 kLOC: Hexen
  150 kLOC: ROTT
  300 kLOC: Quake3
  ...
Comparably, Doom 3 is around 1 MLOC, but like, it is also C++ and has no chance of running on BJX2 as-is, so not worth bothering.
I had just barely crossed the threshold to where it seemed worthwhile to resume an effort to port Quake3 (after looking at it a few years ago, and noting that at the time, I didn't have a lot of the infrastructure needed for a Quake3 port).
Nevermind an open question of whether it has any hope of being playable on a 50MHz CPU.
Though, if anything gives hope here, it is that ironically Quake3 seems to throw significantly less geometry at the OpenGL backend than Quake1 did (mostly I suspect because QBSP carves all the map surfaces into little pieces along all of the BSP planes, whereas Quake3 tends to leave surfaces intact across planes, duplicating a reference to each surface within each leaf rather than carving it up).
So, for example, Quake3 tended to average (IIRC) around 300-500 polygons per frame (despite the much more elaborate scenery) vs around 1000-1500 per frame for Quake1 (also it has LOD for the 3D models, so models use simpler geometry as they are further from the camera, etc).
But, to really see what happens, I need to get it fully working...
My porting effort did make some aggressive corner cutting in a few areas, like replacing the ZIP based PK3 files with WAD4, and replacing most of the use of JPEG images with ".DDS" files.
Where WAD4 is effectively:
Similar to the WAD2 format, but supporting directory trees and 32-character names. Where, WAD2 was a format originally used in Quake 1 for storing various graphics (and for textures in the QBSP tools). The WAD2 format was also used for similar purposes in Half-Life.
I had also used it for various purposes in my compilers and in my "OS".
Technically also the ".rsrc" section in my PE output is also based on the WAD2 format (replacing the original format used by Windows, which seemed hopelessly convoluted). It still serves the purpose though of mostly holding BMP images and icons.
Or, like:
   IWAD/PWAD:
     Used in Doom and friends
     No compression
     8 character lump names (nominally upper case).
   WAD2:
     Used in Quake and Half-Life
     Optional compression
     16 character lump names (nominally lower case).
       Names will omit file extensions,
         which are stored as a 1 byte lump type.
   WAD3:
     Used by Half-Life / GoldSrc, slightly tweaked WAD2.
   WAD4:
     Custom format (used in my projects), expanded form of WAD2.
     Optional compression
     Directory Trees
     32 character lump names (case sensitive, nominally lower case).
I felt OK with calling it WAD4 as it seemed like no one else had used the WAD4 name, and the format design does mostly carry on the legacy of its WAD predecessors.
I am mostly using LZ4 and RP2 compression, say:
   0: Store
   1: Unused (IIRC, was an LZSS like format in Quake)
   2: Unused
   3: RP2
   4: LZ4
   5..7: Unused
   8: Deflate (unused at present)
   9: Deflate64 (unused at present)
   ...
Deflate gives decent compression, but is mostly a bit slow and heavyweight for my uses here.
Using ZIP for a VFS, while technically possible, has the drawback that one needs to read-in and process the central directory (and doing it the way Quake3 did it, ate a lot of memory).
Comparably, using fixed-length 64-byte directory entries both avoids a lot of the up-front processing and still uses less memory (say, vs representing every file name in the PK3 file as a full-path string which is allocated via the Z_Malloc allocator, with thousands of files, this is a lot of bytes...).
For some uses where TGA or PNG may have been used, I am using the QOI format (moderately fast to decode, like a "Poor man's PNG").

I don't like products like LLVM; one reason I'm still doing this stuff is to makes a stand.
 (About 10 years ago I needed a new side-gate for my house. Rather than buy one, I made one myself that was a perfect size, 6' high. If the people behind LLVM made garden gates, theirs would have been 9 MILES high! Probably 15 miles now.)
 
Possibly...

>
>
It is a mystery why anyone uses LLVM, I would have considered it a dead end due to all this...
 Apparently it takes care of all that pesky back-end stuff. For me it would make the task a thousand times harder. Plus I'd end up with a compiler of which only 0.4% was my own work; 99.6% somebody else's. Based on typical LLVM-based compilers being 100MB.
 
Yeah.
Main EXE for BGBCC is ~ 4MB, but this is building with "/Zi" for VS2022, which doesn't exactly generate the most compact binaries possible (similar to "-O0 -g" with GCC).
Essentially, the binary in this case takes on the role of the entire compiler toolchain (to mimic a GCC cross-compiler setup, I can symlink the various tools to the BGBCC binary, and it tries to mimic the CLI for the tool it is called as).
Luckily, in past small-scale experiments, GNU autotools doesn't seem to notice/care what file-formats are being used, but is fairly particular about some other things (like how the files are named).
For example, if called with no output file, the compiler needs to output "a.out" or "a.exe" as the default output, otherwise autotools gets confused (vs, the MSVC behavior of using the name of the first C source file or similar to derive the name of the default output EXE).
Well, along with reliance of behaviors and command-line options outside the scope of the POSIX spec (where GCC is similar to POSIX 'cc' or 'c89' in terms of its CLI, but not exactly the same).
Though, there are a lot of tools that it does not yet mimic:
   nm, objdump, objcopy, etc...
But these were not used by "./configure" or the Makefile's that configure spits out, so...
It cares not that:
   ".o" files are RIL3 bytecode rather than COFF or ELF.
   ".a" files were also RIL3 bytecode.
     The 'ar' tool linking the '.o' files together,
     rather than an '!<arch>' file...
   ...
Though, technically, POSIX specifies that the '!<arch>' format is used.
For the stalled new compiler effort, the idea was to use WAD2 or similar instead. Well, unless someone can make a strong case for why using the original format actually matters.

 

Date Sujet#  Auteur
4 Jul 24 * technology discussion → does the world need a "new" C ?301aotto1968
5 Jul 24 +* Re: technology discussion → does the world need a "new" C ?298Lawrence D'Oliveiro
5 Jul 24 i`* Re: technology discussion → does the world need a "new" C ?297BGB
5 Jul 24 i +* Re: technology discussion → does the world need a "new" C ?2Lawrence D'Oliveiro
5 Jul 24 i i`- Re: technology discussion → does the world need a "new" C ?1yeti
5 Jul 24 i +* Re: technology discussion → does the world need a "new" C ?267Keith Thompson
5 Jul 24 i i+- Re: technology discussion → does the world need a "new" C ?1Lawrence D'Oliveiro
5 Jul 24 i i+* Re: technology discussion → does the world need a "new" C ?264BGB
5 Jul 24 i ii+* Re: technology discussion → does the world need a "new" C ?18Ben Bacarisse
5 Jul 24 i iii`* Re: technology discussion → does the world need a "new" C ?17BGB
6 Jul 24 i iii +* Re: technology discussion → does the world need a "new" C ?14Ben Bacarisse
6 Jul 24 i iii i+* Re: technology discussion → does the world need a "new" C ?9BGB
6 Jul 24 i iii ii+* Re: technology discussion → does the world need a "new" C ?2David Brown
6 Jul 24 i iii iii`- Re: technology discussion → does the world need a "new" C ?1BGB
7 Jul 24 i iii ii`* Re: technology discussion → does the world need a "new" C ?6Ben Bacarisse
7 Jul 24 i iii ii +* Re: technology discussion → does the world need a "new" C ?2Keith Thompson
7 Jul 24 i iii ii i`- Re: technology discussion → does the world need a "new" C ?1Tim Rentsch
7 Jul 24 i iii ii `* Re: technology discussion → does the world need a "new" C ?3BGB
7 Jul 24 i iii ii  `* Re: technology discussion → does the world need a "new" C ?2bart
7 Jul 24 i iii ii   `- Re: technology discussion → does the world need a "new" C ?1BGB
6 Jul 24 i iii i`* Re: technology discussion → does the world need a "new" C ?4Malcolm McLean
6 Jul 24 i iii i `* Re: technology discussion → does the world need a "new" C ?3BGB
6 Jul 24 i iii i  `* Re: technology discussion → does the world need a "new" C ?2bart
7 Jul 24 i iii i   `- Re: technology discussion → does the world need a "new" C ?1BGB
6 Jul 24 i iii `* Re: technology discussion → does the world need a "new" C ?2Janis Papanagnou
6 Jul 24 i iii  `- Re: technology discussion → does the world need a "new" C ?1BGB
5 Jul 24 i ii`* Re: technology discussion → does the world need a "new" C ?245Keith Thompson
6 Jul 24 i ii `* Re: technology discussion → does the world need a "new" C ?244Lawrence D'Oliveiro
6 Jul 24 i ii  +* Re: technology discussion → does the world need a "new" C ?228BGB
6 Jul 24 i ii  i+- Re: technology discussion → does the world need a "new" C ?1BGB
6 Jul 24 i ii  i+* Re: technology discussion → does the world need a "new" C ?6James Kuyper
6 Jul 24 i ii  ii`* Re: technology discussion → does the world need a "new" C ?5BGB
9 Jul 24 i ii  ii `* Re: technology discussion → does the world need a "new" C ?4David Brown
9 Jul 24 i ii  ii  `* Re: technology discussion → does the world need a "new" C ?3Michael S
9 Jul 24 i ii  ii   +- Re: technology discussion → does the world need a "new" C ?1David Brown
9 Jul 24 i ii  ii   `- Re: technology discussion → does the world need a "new" C ?1BGB
7 Jul 24 i ii  i`* Re: technology discussion → does the world need a "new" C ?220Keith Thompson
7 Jul 24 i ii  i +* Re: technology discussion → does the world need a "new" C ?215BGB
7 Jul 24 i ii  i i`* Re: technology discussion → does the world need a "new" C ?214James Kuyper
7 Jul 24 i ii  i i `* Re: technology discussion → does the world need a "new" C ?213BGB
8 Jul 24 i ii  i i  `* Re: technology discussion → does the world need a "new" C ?212James Kuyper
8 Jul 24 i ii  i i   `* Re: technology discussion → does the world need a "new" C ?211Kaz Kylheku
8 Jul 24 i ii  i i    +- Re: technology discussion → does the world need a "new" C ?1BGB
8 Jul 24 i ii  i i    +- Re: technology discussion → does the world need a "new" C ?1Ben Bacarisse
8 Jul 24 i ii  i i    +* Re: technology discussion → does the world need a "new" C ?207James Kuyper
8 Jul 24 i ii  i i    i`* Re: technology discussion → does the world need a "new" C ?206BGB
9 Jul 24 i ii  i i    i `* Re: technology discussion → does the world need a "new" C ?205David Brown
9 Jul 24 i ii  i i    i  +* Re: technology discussion → does the world need a "new" C ?197bart
9 Jul 24 i ii  i i    i  i+* Re: technology discussion → does the world need a "new" C ?194Ben Bacarisse
9 Jul 24 i ii  i i    i  ii`* Re: technology discussion → does the world need a "new" C ?193bart
9 Jul 24 i ii  i i    i  ii +* Re: technology discussion → does the world need a "new" C ?184Ben Bacarisse
9 Jul 24 i ii  i i    i  ii i+* Re: technology discussion → does the world need a "new" C ?3BGB
10 Jul 24 i ii  i i    i  ii ii`* Re: technology discussion → does the world need a "new" C ?2Ben Bacarisse
10 Jul 24 i ii  i i    i  ii ii `- Re: technology discussion → does the world need a "new" C ?1BGB
9 Jul 24 i ii  i i    i  ii i`* Re: technology discussion → does the world need a "new" C ?180bart
9 Jul 24 i ii  i i    i  ii i +- Re: technology discussion → does the world need a "new" C ?1Tim Rentsch
10 Jul 24 i ii  i i    i  ii i `* Re: technology discussion → does the world need a "new" C ?178Ben Bacarisse
10 Jul 24 i ii  i i    i  ii i  `* Re: technology discussion → does the world need a "new" C ?177bart
10 Jul 24 i ii  i i    i  ii i   `* Re: technology discussion → does the world need a "new" C ?176Ben Bacarisse
10 Jul 24 i ii  i i    i  ii i    +- Re: technology discussion → does the world need a "new" C ?1Thiago Adams
10 Jul 24 i ii  i i    i  ii i    +* Re: technology discussion → does the world need a "new" C ?167bart
10 Jul 24 i ii  i i    i  ii i    i+- Re: technology discussion → does the world need a "new" C ?1Janis Papanagnou
10 Jul 24 i ii  i i    i  ii i    i+* Re: technology discussion → does the world need a "new" C ?54Tim Rentsch
10 Jul 24 i ii  i i    i  ii i    ii+* Re: technology discussion → does the world need a "new" C ?14Michael S
10 Jul 24 i ii  i i    i  ii i    iii+* Re: technology discussion → does the world need a "new" C ?8David Brown
11 Jul 24 i ii  i i    i  ii i    iiii`* Re: technology discussion → does the world need a "new" C ?7Michael S
11 Jul 24 i ii  i i    i  ii i    iiii `* Re: technology discussion → does the world need a "new" C ?6Kaz Kylheku
11 Jul 24 i ii  i i    i  ii i    iiii  `* Re: technology discussion → does the world need a "new" C ?5Michael S
11 Jul 24 i ii  i i    i  ii i    iiii   +- Re: technology discussion → does the world need a "new" C ?1Kaz Kylheku
11 Jul 24 i ii  i i    i  ii i    iiii   +- Re: technology discussion → does the world need a "new" C ?1bart
11 Jul 24 i ii  i i    i  ii i    iiii   +- Re: technology discussion → does the world need a "new" C ?1David Brown
11 Jul 24 i ii  i i    i  ii i    iiii   `- Re: technology discussion → does the world need a "new" C ?1Ben Bacarisse
11 Jul 24 i ii  i i    i  ii i    iii+- Re: technology discussion → does the world need a "new" C ?1Kaz Kylheku
11 Jul 24 i ii  i i    i  ii i    iii`* Re: technology discussion → does the world need a "new" C ?4Tim Rentsch
11 Jul 24 i ii  i i    i  ii i    iii `* Re: technology discussion → does the world need a "new" C ?3BGB
11 Jul 24 i ii  i i    i  ii i    iii  `* Re: technology discussion → does the world need a "new" C ?2Tim Rentsch
11 Jul 24 i ii  i i    i  ii i    iii   `- Re: technology discussion → does the world need a "new" C ?1BGB
10 Jul 24 i ii  i i    i  ii i    ii`* Re: technology discussion → does the world need a "new" C ?39bart
10 Jul 24 i ii  i i    i  ii i    ii +* Re: technology discussion → does the world need a "new" C ?37Michael S
10 Jul 24 i ii  i i    i  ii i    ii i+* Re: technology discussion → does the world need a "new" C ?34bart
11 Jul 24 i ii  i i    i  ii i    ii ii+- Re: technology discussion → does the world need a "new" C ?1Michael S
11 Jul 24 i ii  i i    i  ii i    ii ii`* Re: technology discussion → does the world need a "new" C ?32Tim Rentsch
11 Jul 24 i ii  i i    i  ii i    ii ii `* Re: technology discussion → does the world need a "new" C ?31bart
11 Jul 24 i ii  i i    i  ii i    ii ii  +* Re: technology discussion → does the world need a "new" C ?2Tim Rentsch
11 Jul 24 i ii  i i    i  ii i    ii ii  i`- Re: technology discussion → does the world need a "new" C ?1bart
11 Jul 24 i ii  i i    i  ii i    ii ii  `* Re: technology discussion → does the world need a "new" C ?28Keith Thompson
11 Jul 24 i ii  i i    i  ii i    ii ii   `* Re: technology discussion → does the world need a "new" C ?27bart
11 Jul 24 i ii  i i    i  ii i    ii ii    +* Re: technology discussion → does the world need a "new" C ?25Keith Thompson
11 Jul 24 i ii  i i    i  ii i    ii ii    i+* Re: technology discussion → does the world need a "new" C ?15bart
12 Jul 24 i ii  i i    i  ii i    ii ii    ii`* Re: technology discussion → does the world need a "new" C ?14David Brown
12 Jul 24 i ii  i i    i  ii i    ii ii    ii +* Re: technology discussion → does the world need a "new" C ?12bart
12 Jul 24 i ii  i i    i  ii i    ii ii    ii i+- Re: technology discussion → does the world need a "new" C ?1Janis Papanagnou
12 Jul 24 i ii  i i    i  ii i    ii ii    ii i+* Re: technology discussion → does the world need a "new" C ?7David Brown
12 Jul 24 i ii  i i    i  ii i    ii ii    ii ii`* Re: technology discussion → does the world need a "new" C ?6bart
12 Jul 24 i ii  i i    i  ii i    ii ii    ii ii +* Re: technology discussion → does the world need a "new" C ?2bart
13 Jul 24 i ii  i i    i  ii i    ii ii    ii ii i`- Re: technology discussion → does the world need a "new" C ?1David Brown
13 Jul 24 i ii  i i    i  ii i    ii ii    ii ii `* Re: technology discussion → does the world need a "new" C ?3David Brown
17 Jul 24 i ii  i i    i  ii i    ii ii    ii ii  `* Re: technology discussion → does the world need a "new" C ?2Bart
17 Jul 24 i ii  i i    i  ii i    ii ii    ii ii   `- Re: technology discussion → does the world need a "new" C ?1David Brown
12 Jul 24 i ii  i i    i  ii i    ii ii    ii i`* Re: technology discussion → does the world need a "new" C ?3Keith Thompson
12 Jul 24 i ii  i i    i  ii i    ii ii    ii i `* Re: technology discussion → does the world need a "new" C ?2James Kuyper
12 Jul 24 i ii  i i    i  ii i    ii ii    ii `- Re: technology discussion → does the world need a "new" C ?1BGB
11 Jul 24 i ii  i i    i  ii i    ii ii    i`* Re: technology discussion → does the world need a "new" C ?9bart
12 Jul 24 i ii  i i    i  ii i    ii ii    `- Re: technology discussion → does the world need a "new" C ?1Thiago Adams
10 Jul 24 i ii  i i    i  ii i    ii i+- Re: technology discussion → does the world need a "new" C ?1Keith Thompson
11 Jul 24 i ii  i i    i  ii i    ii i`- Re: technology discussion → does the world need a "new" C ?1James Kuyper
11 Jul 24 i ii  i i    i  ii i    ii `- Re: technology discussion → does the world need a "new" C ?1Tim Rentsch
10 Jul 24 i ii  i i    i  ii i    i+* Re: technology discussion → does the world need a "new" C ?2James Kuyper
11 Jul 24 i ii  i i    i  ii i    i`* Re: technology discussion → does the world need a "new" C ?109Ben Bacarisse
10 Jul 24 i ii  i i    i  ii i    `* Re: technology discussion → does the world need a "new" C ?7Janis Papanagnou
10 Jul 24 i ii  i i    i  ii `* Re: technology discussion → does the world need a "new" C ?8Kaz Kylheku
9 Jul 24 i ii  i i    i  i+- Re: technology discussion → does the world need a "new" C ?1David Brown
9 Jul 24 i ii  i i    i  i`- Re: technology discussion → does the world need a "new" C ?1Keith Thompson
9 Jul 24 i ii  i i    i  +- Re: technology discussion → does the world need a "new" C ?1Michael S
9 Jul 24 i ii  i i    i  `* Re: technology discussion → does the world need a "new" C ?6BGB
9 Jul 24 i ii  i i    `- Re: technology discussion → does the world need a "new" C ?1Tim Rentsch
10 Jul 24 i ii  i `* Re: technology discussion → does the world need a "new" C ?4Lawrence D'Oliveiro
6 Jul 24 i ii  +* Re: technology discussion → does the world need a "new" C ?9James Kuyper
7 Jul 24 i ii  `* Re: technology discussion → does the world need a "new" C ?6Keith Thompson
6 Jul 24 i i`- Re: technology discussion → does the world need a "new" C ?1Lawrence D'Oliveiro
5 Jul 24 i +* Re: technology discussion → does the world need a "new" C ?26bart
5 Jul 24 i `- Re: technology discussion → does the world need a "new" C ?1lexi hale
7 Jul 24 `* Re: technology discussion → does the world need a "new" C ?2Bonita Montero

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal