Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.os.msdos.programmer > #4566 > unrolled thread

Making a C compiler in Rust (was: Re: Resources to learn common lisp?)

Started byJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
First post2026-08-21 13:06 +0800
Last post2026-08-21 16:48 -0700
Articles 7 — 4 participants

Back to article view | Back to comp.os.msdos.programmer

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Making a C compiler in Rust (was: Re: Resources to learn common lisp?) Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-21 13:06 +0800
    Re: Making a C compiler in Rust (was: Re: Resources to learn common lisp?) "Kerr-Mudd, John" <admin@127.0.0.1> - 2026-08-21 11:34 +0100
      Re: Making a C compiler in Rust (was: Re: Resources to learn common lisp?) Michael S <already5chosen@yahoo.com> - 2026-08-21 14:13 +0300
        Re: Making a C compiler in Rust Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-22 02:23 +0800
    Re: Making a C compiler in Rust Paul Rubin <no.email@nospam.invalid> - 2026-08-21 15:03 -0700
      Re: Making a C compiler in Rust Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> - 2026-08-22 07:24 +0800
        Re: Making a C compiler in Rust Paul Rubin <no.email@nospam.invalid> - 2026-08-21 16:48 -0700

#4566 — Making a C compiler in Rust (was: Re: Resources to learn common lisp?)

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-08-21 13:06 +0800
SubjectMaking a C compiler in Rust (was: Re: Resources to learn common lisp?)
Message-ID<D1RhS.105827$pS.21221@fx16.ams4>
On 05/08/2026 10:26 AM, steve g wrote:
> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
> 
>> On 01/08/2026 6:46 AM, Lawrence D’Oliveiro wrote:
>>> On Fri, 31 Jul 2026 12:21:51 -0300, Anton Antimo wrote:
>>>
>>>> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
>>>>
>>>>> The tragedy is not using Common Lisp for everything.
>>>>
>>>> I loved this bit and I have a feeling you're correct.
>>> What a dumb idea. Common Lisp is full of legacy baggage to cater to
>>> proprietary pre-POSIX OSes which are now extinct.
>>
>> As always, you start off by mouthing your own ignorance.
>>
>> * OpenVMS is both sold and ported to the x86.  https://vmssoftware.com/
> 
> I am actually glad to heear this! the women of the 70's loved these
> things :)
> 
> 
>> * OS/2 is being sold and supported, under a new brand name.
>>    https://www.arcanoae.com/
> 
> not the best solution in the world but it did/does work.
> I still think that PC-DOS was worth it's weight. Automatic IRQ, DMA,
> HIGHMEM managment all automated. Wow!
> 
> 

Dear steve g,

Thank you for that reminder.  I keep forgetting to install my copy of PC
DOS 2000, completely legally obtained from a 2nd hand store of an I.B.M.
customer.  It was even still sealed, if I remember correctly.  But I op-
ened it, because I mean to use it.

I've added alt.lang.asm, comp.os.msdos.programmer, to this discussion
for the I.B.M. PC is, and has always been, best coded in assembly.  At
least, the original B.I.O.S. was, and the 32bit machines still sold pro-
bably still have their B.I.O.Ses coded in assembly too.

Plus, I have several good books on D.O.S. assembly coding on my shelf, I
should use them!

It'll be a good exercise between coding a C compiler in Rust, so I have
added comp.lang.misc to this discussion, since I am completely unaware
of a group dedicated to Rust.  How would we make one?

If you find yourself so inclined to make another C compiler in Rust, or
even Common Lisp, then the book

              /Writing a C Compiler/,
   /Build a Real Programming Language from Scratch/

by Nora Sandler is not at all recommended.  I'm going through it, but I
feel it should be much better.  At least the exercises are amusing!


Have fun, and please enjoy this minor tangent in our discussion!
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

[toc] | [next] | [standalone]


#4570

From"Kerr-Mudd, John" <admin@127.0.0.1>
Date2026-08-21 11:34 +0100
Message-ID<20260821113438.83c34ecb04c6b1f3473a5776@127.0.0.1>
In reply to#4566
On Fri, 21 Aug 2026 13:06:42 +0800
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:

> On 05/08/2026 10:26 AM, steve g wrote:
> > Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
> > 
> >> On 01/08/2026 6:46 AM, Lawrence D’Oliveiro wrote:
> >>> On Fri, 31 Jul 2026 12:21:51 -0300, Anton Antimo wrote:
> >>>
> >>>> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
> >>>>
> >>>>> The tragedy is not using Common Lisp for everything.
> >>>>
> >>>> I loved this bit and I have a feeling you're correct.
> >>> What a dumb idea. Common Lisp is full of legacy baggage to cater to
> >>> proprietary pre-POSIX OSes which are now extinct.
> >>
> >> As always, you start off by mouthing your own ignorance.
> >>
> >> * OpenVMS is both sold and ported to the x86.  https://vmssoftware.com/
> > 
> > I am actually glad to heear this! the women of the 70's loved these
> > things :)
> > 
> > 
> >> * OS/2 is being sold and supported, under a new brand name.
> >>    https://www.arcanoae.com/
> > 
> > not the best solution in the world but it did/does work.
> > I still think that PC-DOS was worth it's weight. Automatic IRQ, DMA,
> > HIGHMEM managment all automated. Wow!
> > 
> > 
> 
> Dear steve g,
> 
> Thank you for that reminder.  I keep forgetting to install my copy of PC
> DOS 2000, completely legally obtained from a 2nd hand store of an I.B.M.
> customer.  It was even still sealed, if I remember correctly.  But I op-
> ened it, because I mean to use it.
> 
> I've added alt.lang.asm, comp.os.msdos.programmer, to this discussion
> for the I.B.M. PC is, and has always been, best coded in assembly.  At
> least, the original B.I.O.S. was, and the 32bit machines still sold pro-
> bably still have their B.I.O.Ses coded in assembly too.
> 
> Plus, I have several good books on D.O.S. assembly coding on my shelf, I
> should use them!
> 
> It'll be a good exercise between coding a C compiler in Rust, so I have
> added comp.lang.misc to this discussion, since I am completely unaware
> of a group dedicated to Rust.  How would we make one?
> 
> If you find yourself so inclined to make another C compiler in Rust, or
> even Common Lisp, then the book
> 
>               /Writing a C Compiler/,
>    /Build a Real Programming Language from Scratch/
> 
> by Nora Sandler is not at all recommended.  I'm going through it, but I
> feel it should be much better.  At least the exercises are amusing!
> 
> 
> Have fun, and please enjoy this minor tangent in our discussion!

I don't know of any attempts to port (I guess a subset at best) Lisp
or Rust to DOS. And I don't think there's many willing to try it in asm.
BICBW! 
-- 
Bah, and indeed, Humbug

[toc] | [prev] | [next] | [standalone]


#4571

FromMichael S <already5chosen@yahoo.com>
Date2026-08-21 14:13 +0300
Message-ID<20260821141343.00003ccc@yahoo.com>
In reply to#4570
On Fri, 21 Aug 2026 11:34:38 +0100
"Kerr-Mudd, John" <admin@127.0.0.1> wrote:

> On Fri, 21 Aug 2026 13:06:42 +0800
> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
> 
> > 
> > Plus, I have several good books on D.O.S. assembly coding on my
> > shelf, I should use them!
> > 
> > It'll be a good exercise between coding a C compiler in Rust, so I
> > have added comp.lang.misc to this discussion, since I am completely
> > unaware of a group dedicated to Rust.  How would we make one?
> > 
> > If you find yourself so inclined to make another C compiler in
> > Rust, or even Common Lisp, then the book
> > 
> >               /Writing a C Compiler/,
> >    /Build a Real Programming Language from Scratch/
> > 
> > by Nora Sandler is not at all recommended.  I'm going through it,
> > but I feel it should be much better.  At least the exercises are
> > amusing!
> > 
> > 
> > Have fun, and please enjoy this minor tangent in our discussion!  
> 
> I don't know of any attempts to port (I guess a subset at best) Lisp
> or Rust to DOS. And I don't think there's many willing to try it in
> asm. BICBW! 

I would not be so sure about *attempts* to port Rust to DOS.
But It sounds certain that there were no successful ports.
Although I can imagine cross-compiler running on one of the popular
LLVM hosts with DOS as a target. May be, not for a full Rust, but for
useful subset. It's not impossible, just pointless.

Now, Lisp is a different story. There were/are many working Lisp systems
running on MS-DOS.

https://www.reddit.com/r/lisp/comments/1c3qdos/lisp_implementation_for_16_bit_dos_pcs/

[toc] | [prev] | [next] | [standalone]


#4572 — Re: Making a C compiler in Rust

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-08-22 02:23 +0800
SubjectRe: Making a C compiler in Rust
Message-ID<PI0iS.1103038$la89.257992@fx06.ams4>
In reply to#4571
On 21/08/2026 7:13 PM, Michael S wrote:
> On Fri, 21 Aug 2026 11:34:38 +0100
> "Kerr-Mudd, John" <admin@127.0.0.1> wrote:
> 
>> On Fri, 21 Aug 2026 13:06:42 +0800
>> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> wrote:
>>
>>>
>>> Plus, I have several good books on D.O.S. assembly coding on my
>>> shelf, I should use them!
>>>
>>> It'll be a good exercise between coding a C compiler in Rust, so I
>>> have added comp.lang.misc to this discussion, since I am completely
>>> unaware of a group dedicated to Rust.  How would we make one?
>>>
>>> If you find yourself so inclined to make another C compiler in
>>> Rust, or even Common Lisp, then the book
>>>
>>>                /Writing a C Compiler/,
>>>     /Build a Real Programming Language from Scratch/
>>>
>>> by Nora Sandler is not at all recommended.  I'm going through it,
>>> but I feel it should be much better.  At least the exercises are
>>> amusing!
>>>
>>>
>>> Have fun, and please enjoy this minor tangent in our discussion!
>>
>> I don't know of any attempts to port (I guess a subset at best) Lisp
>> or Rust to DOS. And I don't think there's many willing to try it in
>> asm. BICBW!
> 
> I would not be so sure about *attempts* to port Rust to DOS.
> But It sounds certain that there were no successful ports.
> Although I can imagine cross-compiler running on one of the popular
> LLVM hosts with DOS as a target. May be, not for a full Rust, but for
> useful subset. It's not impossible, just pointless.

Indeed it is pointless.  I've not met any D.O.S. programmer who's shown
a mild interest in Rust on the platform.  People use Open Watcom, Bor-
land, and other trademarked compilers for whatever projects they have
set their mind to.

Here in comp.lang.lisp I'd be happy to guide anyone undertaking a C com-
piler project in Common Lisp.  Alternatively, Rust compiler, but I can't
guide anyone in that endeavour.

> 
> Now, Lisp is a different story. There were/are many working Lisp systems
> running on MS-DOS.
> 
> https://www.reddit.com/r/lisp/comments/1c3qdos/lisp_implementation_for_16_bit_dos_pcs/
> 
> 

Yes.  Christian Queinnec even mentions a few in his book /Principes
d'Implantation de Scheme et Lisp/, originally published in 1994.

At the time -- when I was reading the book, that was after 1994 -- I was
unable to find a working copy of many of these Lisps, so I let it go.

I now try to focus exclusively on Common Lisp as a practical medium of
my coding adventures.


Now, stepping inside comp.os.msdos.programmer, I wonder if it would be
hard to implement a Common Lisp from scratch, for D.O.S?
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

[toc] | [prev] | [next] | [standalone]


#4573 — Re: Making a C compiler in Rust

FromPaul Rubin <no.email@nospam.invalid>
Date2026-08-21 15:03 -0700
SubjectRe: Making a C compiler in Rust
Message-ID<87ik53nnbc.fsf@nightsong.com>
In reply to#4566
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
> It'll be a good exercise between coding a C compiler in Rust, so I have
> added comp.lang.misc to this discussion, since I am completely unaware
> of a group dedicated to Rust.  How would we make one?

Maybe you wanted comp.compilers.  A compiler doesn't seem like a great
idea of a beginning Rust project though, and Rust IMHO isn't that
attractive for the purpose.  Plus of course C is a terrible language for
which there are plenty of compilers: who needs another?

For a general book about compilers I'll suggest Andrew Appel's "Modern
Compiler Implementation in ML" (1998, if you can count that as modern)
in preference to the older Dragon book ("Principles of Compiler
Design"):

  https://www.cs.princeton.edu/~appel/modern/

I also just saw somewhere (probably here) that Scott Burson's Zeta-C is
now downloadable from somewhere.  It's a C compiler for Lisp machines,
written in Zetalisp, which is fairly close to Common Lisp.  Since this
is still the Lisp newsgroup, maybe that's the most relevant.

Oh yikes, all that cross posting.  Sorry everyone.

[toc] | [prev] | [next] | [standalone]


#4574 — Re: Making a C compiler in Rust

FromJohann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid>
Date2026-08-22 07:24 +0800
SubjectRe: Making a C compiler in Rust
Message-ID<y65iS.361236$BAea.126985@fx01.ams4>
In reply to#4573
On 22/08/2026 6:03 AM, Paul Rubin wrote:
> Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
>> It'll be a good exercise between coding a C compiler in Rust, so I have
>> added comp.lang.misc to this discussion, since I am completely unaware
>> of a group dedicated to Rust.  How would we make one?
> 
> Maybe you wanted comp.compilers.  A compiler doesn't seem like a great
> idea of a beginning Rust project though, and Rust IMHO isn't that
> attractive for the purpose.  Plus of course C is a terrible language for
> which there are plenty of compilers: who needs another?

Dear Paul,

I don't want to bother John Levine about yet another beginning compiler
project based on Nora Sandler's book.  And based on my initial reading
of the first chapter, Rust is indeed a great language to begin this
project as outlined in the book.  For those who have lost the context,
the title is /Writing a C Compiler/.
> 
> For a general book about compilers I'll suggest Andrew Appel's "Modern
> Compiler Implementation in ML" (1998, if you can count that as modern)
> in preference to the older Dragon book ("Principles of Compiler
> Design"):

I have indeed read Appel's book in ML, and am currently on a co-course
writing the Tiger compiler in C.  He also has an edition in Java, which
I have not read.

And thank you for the reminder.  Now I have a great project to spend my
time on this Saturady, namely the Tiger compiler in C.  It's time I
begin chapter two.  For this, I have set aside my copy of John Levine's
-- he is also an author -- book, /Flex & Bison/, because Appel does not
really explain how to use Flex.

> 
>    https://www.cs.princeton.edu/~appel/modern/
> 
> I also just saw somewhere (probably here) that Scott Burson's Zeta-C is
> now downloadable from somewhere.  It's a C compiler for Lisp machines,
> written in Zetalisp, which is fairly close to Common Lisp.  Since this
> is still the Lisp newsgroup, maybe that's the most relevant.


Yes, that's a cool project I have yet to delve into.  It's on my list of
projects-to-explore-in-the-possibly-near-future-or-next-decade.

> 
> Oh yikes, all that cross posting.  Sorry everyone.

Oh, please don't be sorry about cross posting.  I was delighted to see
this reply in comp.os.msdos.programmer.

Now, stepping back into comp.lang.lisp, I'll add that I believe Nora's
C compiler project is eminently suitable for Common Lisp as well, but
so far, nobody else has seen interest in picking it up.  At least not
here.

Now, to finish off -- and to irritate more trolls in comp.lang.c -- I
must mention that Common Lisp is also a good programming language to
make an assembler.  For that, I heartily recommend David Salomon's book
/Assemblers and Loaders/, available in a small link called "here," here

   https://www.davidsalomon.name/assem.advertis/AssemAd.html

in P.D.F. form.  So now alt.lang.asm, and comp.lang.asm are back on
topic, along with all the other groups.  Namely comp.lang.misc for Rust.

And to bring comp.os.msdos.programmer on-topic, sort of, I wonder if
it's possibly to build GNU CLisp for D.O.S?

   https://www.gnu.org/software/clisp/

I did not find it in the list of DJGPP software packages.


Happy porting Common Lisp to D.O.S!
-- 
Johann | email: invalid -> com | http://www.myrkraverk.com/blog/
I'm not from the Internet, I just work there. | via Easynews.com
https://bsky.app/profile/myrkraverk.bsky.social | for ( ;; ) _:;

[toc] | [prev] | [next] | [standalone]


#4575 — Re: Making a C compiler in Rust

FromPaul Rubin <no.email@nospam.invalid>
Date2026-08-21 16:48 -0700
SubjectRe: Making a C compiler in Rust
Message-ID<87ecfrnih9.fsf@nightsong.com>
In reply to#4574
Johann 'Myrkraverk' Oskarsson <johann@myrkraverk.invalid> writes:
> I have indeed read Appel's book in ML, and am currently on a co-course
> writing the Tiger compiler in C.  He also has an edition in Java, which
> I have not read.

I'd go for the ML version of that book.  He made the apt comment that C
is a terrible language for writing compilers in.  Lisp is much better,
but ML, Haskell, and so on are almost perfectly suited for the purpose.

Regarding Lisp, the most interesting dialect these days might be
Clojure, if you can stand the stench of the JVM that accompanies it.
Its ideas are more modern than those of CL.  I haven't tried it myself
so far.  Again the JVM is to blame.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.os.msdos.programmer


csiph-web