M4
Francois-Rene Rideau
rideau@ens.fr
Sun, 21 Jan 1996 03:40:25 +0000 (GMT)
Dear Patrick,
> I've looked briefly at the Tunes M4 source that has been writen.
> Not understanding a thing, I had to lookup an intro to M4.
You should get latest GNU m4 1.4 (which is required),
and read the .info files.
I tried to document a bit
(see the sources themselves, and info file m4* in doc/info),
but do not hesitate
to point out flaws in that docs,
to send patches, etc.
> My god (if I had one), what a mess !
Yes, indeed.
Latest sources (from the Files.html page)
are a bit clearer than used to be in .20,
but m4 is messy whatever you try to do with it !
> I can see that it gets the job done but it looks to me like the kind
> of language you hope you'll never have to learn and use.
I would like never to have learnt it !
> Why use a preprocessor at all ?
> Why not use something clean and powerfull like Scheme ?
Actually, I had to translate my heavily macro-using TASM to as86
which didn't have macros at all
(at least not documented, and not powerful enough anyway).
So I used the only powerful enough macro processor that I found, m4.
It seemed as the most "natural" combination to me
to replace the built-in macro processing done by TASM,
and actually, m4 is much more powerful than what TASM could allow.
Somehow, it started as a quick conversion of TASM into as86,
and ended up as an exercise in programming with a lame language.
I certainly should have considered the possibility of using Scheme
more seriously.
It seems that I fell in the same traps of traditional computing
that I try to denounce whenever I discover one !
I replaced a traditional ad-hoc tool by a much more orthogonal,
but still mentally impaired combination
of a stripped-down meta-language and an stupid assembler.
> We could build an internal representation for assembly instructions
> and a function to print it out into an assembly file.
> Then we'd be able to do more sophiticated things with ease.
That's what we should do.
I intended to do it with the Tunes HLL once it is bootstrapped,
but why not do it now ?
> Of course it wouldn't look the same :
Syntax is not important.
> I have to admit that M4 is probably more efficient if one knows it well.
> And it's too late switch anyway.
m4 is not more efficient.
It is simpler, and has more powerful reflectivity
(but some totally unclean reflectivity and semantics).
No, it's never too late to switch.
I made a bad choice, and it is quite soon enough to repair.
Scheme seems a far better choice, and its syntactic triviality
makes it very easy to read and translate into whatever the HLL might
become.
What implementation(s) of Scheme do you suggest we use ?
> Could it be that Fare is the only one coding and understanding the
> code because no one else knows M4 ?
It could be, but you're the first one I know who's read the sources...
> Will programming Tunes consist of writing assembly language programs with
> M4 for a while or is there a switch to something else coming soon ?
m4 is meant as a transient solution for just the assembly part,
until the LLL is available and makes all that stuff obsolete.
The rule I proposed for Tunes,
that no one expressed disagreement against yet,
is that anyone can use any language seems to suit best,
but *must* agree to translate all his work
into any language that the project may choose later.
If you want to contribute to the LLL project,
and have another idea for the programming language to use,
and are ready to follow it
(not just suggesting that I do it and then let me with translated code),
then I'm ready to translate all my existing code.
> I shouldn't be bothering you with this anyway since I don't have much
> expertise to contribute for this low-level stuff.
No much expertise is required, just good will.
> I just hope I can understand the M4 source sufficiently to be able to
> contribute when it gets a little less hardware specific.
Why not take up the OTOP subproject (the same thing in C) ?
> I started this message with a clear point but now it's not so clear.
> Anyway, comments ?
Yes. What implementation for Scheme do you recommend to use ?
Guile ? SCM ? OScheme ? Scheme48 ? Does it matter much ?
-- , , _ v ~ ^ --
-- Fare -- rideau@clipper.ens.fr -- Francois-Rene Rideau -- +)ang-Vu Ban --
-- ' / . --
Join the TUNES project for a computing system based on computing freedom !
TUNES is a Useful, Not Expedient System
WWW page at URL: "http://www.eleves.ens.fr:8080/home/rideau/Tunes/"