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


Groups > comp.lang.c > #393491

Re: Release my K&R C compiler along OS and utilities

From anthk <anthk@openbsd.home>
Newsgroups comp.lang.c
Subject Re: Release my K&R C compiler along OS and utilities
Date 2025-05-21 05:02 +0000
Organization A noiseless patient Spider
Message-ID <slrn102pdko.2hm3.anthk@openbsd.home.localhost> (permalink)
References <vr7249$27si0$1@dont-email.me> <slrnvtj1vd.1gbn.anthk@openbsd.home> <vrfukd$2662f$1@dont-email.me>

Show all headers | View raw


On 2025-03-20, Oscar Toledo G <biyubi@gmail.com> wrote:
> On 19 Mar 2025 at 6:22:06 CST, "anthk" <anthk@openbsd.home> wrote:
>
>> On 2025-03-16, Oscar Toledo G <biyubi@gmail.com> wrote:
>>> Hi all.
>>> 
>>> I've released recently the source code to my almost full K&R C compiler (minus
>>> extern and static) made in 1993-1996.
>>> 
>>> It was developed based on Small-C and expanded to K&R per the book.
>>> 
>>> The target of this C compiler is a transputer chip. The C compiler runs under
>>> my own operating system, and you'll find along text editor, assembler,
>>> assorted utilities, a 3D modeler, and a ported Ray Tracer program.
>>> 
>>> For this to work, I've made a transputer emulator that can be compiled in
>>> recent macOS (test with Macbook Air M1)
>>> 
>>> The full source code is available at https://github.com/nanochess/transputer
>>> 
>>> Also three articles about the development are linked there.
>>> 
>>> Enjoy it!
>>> 
>>> Regards,
>> 
>> Thanks/Gracias. Altough from you I would expect using something like Minix 3,
>> or OpenBSD :D.
>
> I'm more mainstream these days because I keep distros of IntyBASIC, CVBasic,
> and CoolCV for Windows, macOS and Linux.
>
> I use a Macbook Air for development, and VirtualBox for running both Windows
> and Fedora, so I don't need to use another computer.
>
> Regards,

Did you have a look on EForth+Subleq/Muxleq?

Subleq it's a tiny VM/OISC, albeit slow. Muxleq speed it ups a lot 
by multiplexing instructions. Eforth runs under it.

https://howerj.github.io/subleq.htm

https://github.com/howerj/muxleq

THe repo has both subleq and muxleq.
If you want a recent muxleq.dec, email me; 
I will submit a ready to run subleq (DEC) 
image. 

If any, edit muxleq.fth, set to 1 the opt.*
variables related to floats, a better SEE
and loops (do...loop it's a Forth standard).

My settings. Sorry for not posting a diff:

tant opt.multi      ( Add in large "pause" primitive )
1 constant opt.editor     ( Add in Text Editor )
1 constant opt.info       ( Add info printing function )
0 constant opt.generate-c ( Generate C code )
1 constant opt.better-see ( Replace 'see' with better version )
1 constant opt.control    ( Add in more control structures )
0 constant opt.allocate   ( Add in "allocate"/"free" )
1 constant opt.float      ( Add in floating point code )
0 constant opt.glossary   ( Add in "glossary" word )
1 constant opt.optimize   ( Enable extra optimization )
1 constant opt.divmod     ( Use "opDivMod" primitive )
0 constant opt.self       ( self-interpreter [NOT WORKING] )

Then:

./muxleq ./muxleq.dec < ./muxleq.fth > ./new.dec

Run:

./muxlec ./new.dec

The interpreter uses a soft float approach. Thus, you
can use -O3 -ffast-math without troubles, I guess.

On guides, "Starting Forth" (Web ANS version) and 
Thinking Forth will be more than enough.

There's Sectorforth, but it's really limited. Contrary 
to SectorLisp from Jart, it doesn't have
a integer number set save for numbers declared as 
forth words such as powers of 2 and numbers maybe from 
0 to 16.

If you want to try, you can set a proper SectorForth
by properly bootstrapping the integer part. 

https://github.com/cesarblum/sectorforth

Enjoy.

Back to comp.lang.c | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Release my K&R C compiler along OS and utilities Oscar Toledo G. <biyubi@gmail.com> - 2025-03-16 17:35 +0000
  Re: Release my K&R C compiler along OS and utilities anthk <anthk@openbsd.home> - 2025-03-19 12:22 +0000
    Re: Release my K&R C compiler along OS and utilities Oscar Toledo G. <biyubi@gmail.com> - 2025-03-20 02:30 +0000
      Re: Release my K&R C compiler along OS and utilities anthk <anthk@openbsd.home> - 2025-05-21 05:02 +0000
  Re: Release my K&R C compiler along OS and utilities Hul Tytus <ht@panix.com> - 2025-03-20 01:45 +0000
    Re: Release my K&R C compiler along OS and utilities Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-03-20 02:24 +0000
    Re: Release my K&R C compiler along OS and utilities Oscar Toledo G. <biyubi@gmail.com> - 2025-03-20 02:32 +0000
      Re: Release my K&R C compiler along OS and utilities Hul Tytus <ht@panix.com> - 2025-03-21 06:26 +0000

csiph-web