I did something similar, a full C23 C compiler targeting freedos.
See https://github.com/avwohl/uc386
It does global optimization; you can put all the .c files on the command line.  
It
does dead code elimination for all your source and unused parts of the 
libraries.  It passes the fujitsu and other test suites.  It builds the GNU 
utilies and gawk, and the current micropython 
https://github.com/avwohl/freedos_micro_python . Micropython has the ssl, ssh, 
and http libraries with sample programs in python for wget, scp, and sftp 
working.

On the morality, CLAUDE is listed as a contributor.   I did prod it in the 
right direction.  I used to work for the PQCC (production quality compiler) 
project at Carnegie Mellon back in the early 1980s.  So I think I had some 
influence on the outcome.


----- Original message -----
From: Steve Nickolas via Freedos-devel <[email protected]>
To: Steve Nickolas via Freedos-devel <[email protected]>
Cc: Steve Nickolas <[email protected]>
Subject: [Freedos-devel] "AI" clanked compilers was Re: New BASIC compiler
Date: Tuesday, June 16, 2026 9:24 AM

I'm going to bounce off this particular post because it's semi-related.

Not too long after I started having one LLM try to clone QuickBasic 4.5, I 
had another LLM try to create a Borland-like C compiler.  (You can 
probably understand why someone on a "FreeDOS development" list would want 
such a thing.)  It would mainly be intended for crosscompiling, but even 
if it doesn't end up able to self-host, it could be able to run on DOS for 
DOS development thanks to DJGPP.

Well, it's reaching viability and that's forced me to take a turn inward 
and consider the moral quandaries if I actually release this beast, and I 
think there's at least two separate moral scenarios at play.

For several years I've wanted such a thing but the idea of developing it 
has just been overwhelming.  A clanker or two has actually enabled me to 
produce this project, but having to have relied on clankers in the first 
place makes it feel hollow.  So here's what I figured...

1. The compiler, linker, librarian.  This is where the morality is going 
to be at its most problematic.  Not only is it something I couldn't really 
contribute more than broad suggestions or at most top-level UI code, it's 
where "you don't know where the clanker pinched its code" REALLY comes 
into play.  Frankly, I'd prefer to rewrite all of this with real human 
ingenuity - it's just that that ingenuity won't, can't be mine.

2. The runtime.  This is a lot less of an issue to me morally, for two 
reasons.  First, because I know exactly where most of this code is pinched 
from - 4.4BSD, FreeBSD and NetBSD, with attribution.  Perfectly 
legitimate.  In this case the clanker just sorted stuff out, added some 
stuff like _cdecl around it for the benefit of the compiler tooling, and 
called it a day.  Provenance chain's clear.  The rest of the code is glue 
code like bioskey() and absread() anc clrscr() where there's hardly more 
than one way to write it in the first place, and most of it I can read and 
understand no problem.

It may still be some time before I have anything to show, and again, there 
is the moral issue, of which I am all too well aware.  I still think it's 
relevant enough to here to mention because of the nature of the project.

-uso.


_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel


_______________________________________________
Freedos-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/freedos-devel

Reply via email to