Sujet : Re: The joy of FORTH (not)
De : antispam (at) *nospam* fricas.org (Waldek Hebisch)
Groupes : alt.folklore.computers comp.os.linux.miscDate : 25. Oct 2024, 12:01:32
Autres entêtes
Organisation : To protect and to server
Message-ID : <vfftqa$3kr3l$1@paganini.bofh.team>
References : 1 2 3 4 5 6 7 8 9 10 11 12
User-Agent : tin/2.6.2-20221225 ("Pittyvaich") (Linux/6.1.0-9-amd64 (x86_64))
In alt.folklore.computers Peter Flass <
peter_flass@yahoo.com> wrote:
Lawrence D'Oliveiro <ldo@nz.invalid> wrote:
On Wed, 23 Oct 2024 08:04:37 -0700, John Ames wrote:
... but the one has 512 KB Flash/144 KB RAM, and the other
only 32 KB/16 KB.
512kiB seems to be the recommendation for MicroPython. For the 32kiB one,
I would want to use a cross-compiler for some more resource-efficient
language, like C.
Ridiculous! 32K should be more than enough to run a decent compiler
natively.
Hisoft Pascal for ZX Spectrum had about 25 kB of code. ARM code
tends to be more compact than Z80 code so something of similar
complexity should fit. However this was really Pascal subset
and compiler generated code was not very good. There is also
question of RAM use, with 16kB of RAM there should be enough
space, but MCU-s with 32 kB flash may have only 2KB RAM which
is quite thight for a compiler. Note that with normal compiled
languages you need space for source code and compiler symbol
table. And space for object code (object code may go to flash,
but compiler must leave enough free flash for this). It is
preferable to have incremental compiler. But then symbol
table must be part of running program. In effect you end up
with something that on the surface may be quite different
but internally is like Forth compiler. Also, besides compiler
you need a some support library. Forth was organised in
a way that compiler/interpreter routines simultanously served
as a library for the user.
In a different spirit, modern MCU-s contain inside a lot of
devices. If you want nice symbolic constants helping with
use of devices you need extra space (kilobytes or tens of
kilobytes for all devices). And one wants library of
routines handling devices. So really a lot of things
competing for use of those 32 kB of flash.
-- Waldek Hebisch