Back to home page

DOS ain't dead

Forum index page

Log in | Register

Back to the forum
Board view  Mix view

Free Pascal linking (Developers)

posted by Rugxulo Homepage, Usono, 11.04.2008, 16:16

> > For sure there are more Windows machines than DOS ones. But I'm
> skeptical
> > that that 20k is static (probably requires MSVCRT).
>
> Depends on your definition. Of course FPC doesn't use MSVCRT, since it is
> not a (MS) C compiler?!?!?

Well, TCC (Tiny C) for Win32 outputs to PE .EXEs that depend on MSVCRT. And so does MinGW (right??). So, yes, some third-party compilers do use it.

> Nor does it use other DLLs, except for the two dlls that are effectively
> the interface to the kernel on windows: user32 and kernel32. However
> disallowing that would be like disallowing interrupts on Dos.

Sounds like an ideal candidate for HX! :-)

> It does. FPC is also the compiler with the lowest memory use on the
> shootout, killing gcc. (though that is something different than binary
> size)

I don't know how much GCC uses minimum, but I know that 4.x has much greater optimizations, so -O2 can use a lot more than 3.x ever did.

> > It's even mentioned on their wiki as a known issue. I mean, for now,
> "UPX
> > is your friend" (sorry, Japheth, but it's true!).
>
> FPC does not recommend UPX, unless it is 100% required. And usually it is
> not, see http://wiki.freepascal.org/Size_Matters

For DOS, it's perfectly fine (very small decomp stub too). For Win32, there is the "no shared pages" crudola, but that only applies if you intend to run tons of instances (e.g. make or bash). And it's plenty fast. The only time I've seen it slow down is DOS-packed stuff on Windows (only noticable when e.g. DJGPP itself is fully packed, and that may be more of an NTVDM issue) or huge (> 1 MB) LZMA-packed .EXEs on my old 486. So again, those problems are rare, and it's perfectly valid otherwise.

> > Ideally, we should be comparing something like FreeBASIC or DJGPP
> > (GCC) or GPC vs. FreePascal (using the same LIBC, I assume).
>
> FPC doesn't use any libc. Not even on Unix. It is not a Unix/C compiler in
> disguise, but a multiplatform compiler.

FreeBASIC (DOS, at least) does use DJGPP's LIBC.A although it is not a GCC frontend (although plans to dually output C are in the works). Just like FPC, the compiler proper is written in itself. It does, however, use (G)AS and LD (from BinUtils) for its dirty work. But FreeBASIC is still not quite as portable as FPC (officially only three hosts/targets).

> However FPC doesn't really train on small binary size, it just has a
> slight example, specially with benchmarky programs like "hello world" due
> to its architecture.

The real whiners about size tend to be assembly programmers because they know what can be accomplished in the comparable amount of code. Sure, nobody cares as much anymore now that multi-gigabyte HDs are universal, but some people still have the ideal that it shouldn't take 10x more space than it used to take unless there's a really good reason.

 

Complete thread:

Back to the forum
Board view  Mix view
22049 Postings in 2034 Threads, 396 registered users, 255 users online (0 registered, 255 guests)
DOS ain't dead | Admin contact
RSS Feed
powered by my little forum