Deutsch   English   Français   Italiano  
<slrn102pdko.2hm3.anthk@openbsd.home.localhost>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: news.eternal-september.org!eternal-september.org!.POSTED!not-for-mail
From: anthk <anthk@openbsd.home>
Newsgroups: comp.lang.c
Subject: Re: Release my K&R C compiler along OS and utilities
Date: Wed, 21 May 2025 05:02:35 -0000 (UTC)
Organization: A noiseless patient Spider
Lines: 96
Message-ID: <slrn102pdko.2hm3.anthk@openbsd.home.localhost>
References: <vr7249$27si0$1@dont-email.me>
 <slrnvtj1vd.1gbn.anthk@openbsd.home> <vrfukd$2662f$1@dont-email.me>
Injection-Date: Wed, 21 May 2025 07:02:35 +0200 (CEST)
Injection-Info: dont-email.me; posting-host="c6acd64de8a32a0b228014c00a841b78";
	logging-data="2831068"; mail-complaints-to="abuse@eternal-september.org";	posting-account="U2FsdGVkX19N+pIqykoEig/LZo0H4bWg"
User-Agent: slrn/1.0.3 (OpenBSD)
Cancel-Lock: sha1:NtpFiXBIQNUjDW1lj6RVUNqtozc=

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.