lua-users home
lua-l archive

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


Jay Carlson wrote:
[...]
Gratuitous war story: I remember finding out that referencing just about
anything in glibc called in assert, which then called in localization (since
you need to print "assertion failed" in the correct language), which then
called in multibyte character support.   Oof.

You think that's bad?

I was once writing a boot loader for an embedded OS I was working on. The OS was very fine-grained and was eminently suitable for writing the boot loader itself; provided I didn't use any exotic features, the entire OS would basically vanish.

So my boot loader contained a noddy device driver that talked to the BIOS, a tiny C program that was the boot loader, and pretty much nothing else. It worked fine, with a footprint of under 64kB.

Then one day I used sprintf.

sprintf, of course, wanted to convert floats. So it pulled in the floating point library. Which pulled in the floating point emulator. Which, in order to handle division by zeroes, pulled in the signal handling mechanism, which in turn pulled in the scheduler, the timer, the process management system, the root process, the run-time linker, a bunch of standard device drivers and some daemons. I think the final footprint was over half a megabyte.

What does this message have to do with Lua? When dealing with dependencies, be careful what you ask for --- you may get a lot more than you expect.

--
[insert interesting .sig here]