albert <albert@cherry.(none)> wrote:
> In article <
87h6zvf...@nightsong.com>,
> Paul Rubin <no.e...@nospam.invalid> wrote:
> >Lorem Ipsum <
gnuarm.del...@gmail.com> writes:
> >> Mecrisp is already ported to a large number of targets, both types of
> >> CPUs and individual boards.... I'm pretty sure it is ported to the
> >> ESP32, the RISC-V and even the FPGA hosted J1 processor by James
> >> Bowman.
> >
> >
https://mecrisp.sourceforge.net/
> >
> >MSP430 (original version), Stellaris (ARM Cortex) a rewrite, Quintus
> >(Risc-V) another rewrite, and J1 (Swapforth, whatever that is, but looks
> >related to the MSP430 version. I don't see anything about ESP32.
> >
> >It is a very capable Forth with an optimizing compiler, but it is
> >written mostly in assembly language rather than in Forth. So targeting
> >it to a different architecture takes a lot of rewriting. I would be
> >interested to know why Matthias did it that way, since Forth is
> >traditionally written in itself.
>
> He could have made the same observation I have. ciforth's are written
> in assembler, because since decennia there has been one assembly
> language: the i86. (now it is changing). So the main systems
> linux, MS-windows and Mac can have the same assembly file for a
> host-based ciforth.
> Killing the middle man of high level Forth (or worse c) has many advantages.
What/who is "middle man" depends on point of view. For me assembler
is a middle man. And in case of ciforth "m4". To explain more:
there is bunch of primitives that naturally are written in
assembler. But most of ciforth code is essentially dictionary
content. Forth is capable of managing dictionary, assembler is
for bootstrap. But there are alternative ways of bootstrap,
that you may dislike but folks like myself find much more
appealing.
> Mecrisp is available on a truckload of SBC with the same processor.
> Relying on compatible c-programming environments on a plethora of
> boards is *not* the way to go.
Why not? AFAIK each of them has C compiler and compiler differences
that matter for Forth are due to assembler and machine language,
so one needs to handle them anyway.
> Mecrisp is intended to be a practical system. Speed is essential,
> and it is comes cheap. MSP430 assembly language is portable
> across hundreds of msp430 boards.
Speed of generated code, yes. Speed of compiler, unlikely.
MSP430 MPU tend to be quite small, so you will have small
programs. Relative to size they are quite fast, so moderate
inefficiency in compiler should not be bad. OTOH size matters
a lot for MSP430. One claim to fame of threaded Forth is that
one gets better code density than form assembler, so using
_theread Forth_ to implement compiler would be quite natural.
--
Waldek Hebisch