For any non-trivial script, writing it in C or C++ will have lower size than in a scripting language, when you include the scripting runtime's size.
The C libs are also needed for the system, but PHP/Lua/etc only for your script; so if size is the goal, don't use a scripting lang.