[fpc-devel] Project Idea: Mini-FPC
Tomas Hajny
XHajT03 at hajny.biz
Sat Sep 10 11:32:54 CEST 2011
On 9 Sep 11, at 14:15, Skybuck Flying wrote:
> "
> 1) Floating point support is necessary for the compiler to compile/build
> itself, because floating point number support needs to be available in the
> compiler itself (otherwise source files containing floating point numbers
> cannot be processed by the compiler).
> "
>
> Why would a basic/core compiler which does not support floating point
> numbers need floating point numbers ?
>
> Doesn't make much sense to me.
>
> Surely free pascal can be reduced so far to integers only.
OK, it's certainly possible to create a simple Pascal compiler
without most of current features. Such compilers surely exist even
now. What does it have to do with FPC then though? If you want to
create a very simple compiler for the purpose of education about
compiler techniques (my original understanding about your target was
slightly different but apparently wrong judging from your response to
my comments), it's probably better to start from scratch or e.g. use
the old FPK 0.5 sources than trying to reduce the existing very wide
features of FPC to a very small set.
> I can only imagine math.pas containing PI but math.pas should not be part of
> a basic/core compiler anyway.
Indeed, math.pas is a bit more advanced stuff. Excluding floating
points obviously means excluding much simpler stuff like standard
division.
> So this argument of yours seems to make little sense unless you can give a
> very convincing example of "floats" being used inside the core of free
> pascal compiler.
OK, sorry, I clearly misunderstood your intention (my original
understanding was that you were suggesting reduction of the amount of
units to avoid possible confusion with newcomers starting to program
in Pascal, not for people interested in learning how compilers work
or how they may be created).
.
.
> "
> 3) Everyone is free to create a special installation package for his own
> needs, but I can hardly imagine something like that becoming part of the
> general FPC distribution.
> "
>
> The mini-fpc should be a "side-project" for those people interested in
> compiler technology only and not everything else.
OK, anyone can use FPC sources for such an activity, although I
believe that there would be better options for achieving that as
mentioned above. Personally, I don't think that floating point
numbers are a major complexity driver from the compiler point of view
but that doesn't really matter.
Tomas
More information about the fpc-devel
mailing list