[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: cc65 competition?
On Apr 12, 8:26 pm, Harry Potter <maspethro...@aol.com> wrote:
> Do you include *every* function in a library, or just the necessary
> ones? cc65 seems to include justb the necessary ones, although some
> fat (i.e. the initmainargs assembler function, which processes the
> command line, shortened to pushing two NULLs on the stack) could still
> be cut.
No, just the ones you reference, directly or indirectly.
The killer with the modern desktops was calling a function, which
itself calls five functions, which themselves call twenty functions,
yadda yadda yadda, and the program is massive. That was fixed with
dynamic linking libraries, which can share the same library code. But
then one dynamic link library (.dll or .so) calls another one, and you
are off to the races again.
One of the ongoing developments in support of floppy disk and other
Tiny Linuxen is developing C libraries that are more fine grained in
terms of what is dragged in with the functions that you use.
The main thing for your situation is, if you call a function that can
also cook dinner and wash dishes afterward, like printf, then *even if
you don't ask it to do that*, the capability comes along for the ride.
So as a rule of thumb, use the function call that does the least in
addition to what you need, and it is likely to pull less additional
stuff in with it.