[A86] Re: Alternative language compiler


[Prev][Next][Index][Thread]

[A86] Re: Alternative language compiler




> Take a look at SDCC v2.3.0 ( http://sdcc.sourceforge.net ), the Z80 port
> has improved giganticaly since the last time I saw it (almost
> 'handwritten'). The beauty about this compiler is the intermediate code,
so

I'd be interested to see if it really works that well, speed or size wise
(usually one and the same).

> you could write a frontend
> (?right word?) that generates iCode for your language, and the backends do
> the rest.

That would defeat the purpose of doing a new language.  Having a portable
intermediate language is good when wanting multiple front ends of back ends
to a compiler, but it doesn't help you a whole lot with optimization.  This
is likely the reason that gcc does not produce very good code, and probably
never will.  A new language is necessary because C is not the best language
for making programs for the z80.  It was designed for UNIX systems, not
calcs.

> The major problem I see is that it hasn't got a decent lib (only fairly
> basic standard C stuff). You can also still only compile for one target
> (let's say CrASH[82], versus Ion[83(+)]), and you need to 'manualy' switch
> to another target by copying a new crt0.o file into the Z80-lib directory.
> Which also means that 'descriptions' and 'icons' (stored in the shell
> header) would be always the same unless you assemble a new crt0.o file.
> This are all 'fixable', but your compiler will have the same problems in
> advance (no matter what road you take to create your compiler), untill it
> has 'grown' enough to get supported by the users.

Do you really need libc when writing calc programs?  If you do, then you
probably need to rethink what you are doing.  Again, that's not the purpose
here.

It seems like you would want to just compile the crt0 module along with the
project.  Have a skeleton project available, and copy it when starting a new
project.  Doesn't seem like that big of a problem.

> I could send some SDCC compiled examples to this list to convince people.

Please do.  Some loops, control structures, etc., that are used in a normal
calc program would be good.  Possibly write a simple game like Nibbles
(basic features) in a straight forward manner, and see how well it compares
to a straight forward hand coded version.






References: