[including all the header files]
But this is not necessarily a good idea, so there is a case to be made for
having this diagnosed as if the header were included.
ok might be sensible for a small library likes C's runtime but would
you want to do that C++? or Python? or Perl? I'm not even sure it's
clear what /is/ the standard library for some of those. I suppose
referencing a namespace could automatically import the correct
identifiers and do the moral equivalent of linking. presumably you'd
have to obey some sort of convention on where files were kept. or use
a database.
in my language, importing a "package" (essentially a namespace, using
the Java/ActionScript term) may trigger the VM to try to load a module
of the same name (the package name is treated as a path-name, and is
searched along the VM's known library paths, technically inside of a VFS).
once imported, a delegation link is made between the current lexical
scope and the packages' object (internally, imports' are actually
variable declarations, and the VM uses a delegation system similar to
the one in Self, likewise: packages are objects).
side note:
organizing things like in Java essentially requires creating another
module who's sole purpose is to (manually) import all of the per-class
modules (could be changed, but for now it works, note that nothing
prevents putting multiple classes in a given module, nor prevents
putting variable and function declarations directly into packages or at
the toplevel).
annoyingly, there are a bunch of modifiers which may be needed on import
and package declarations in my language to influence the semantics
("import" vs "extern import" vs "abstact import" vs "native import" vs
"static import" vs "delegate import" vs ...).
OTOH, the C FFI basically just loads in a bunch of databases (the DBs
have names matching the loaded DLLs, so seeing any loaded DLL will
trigger loading a DB of the same name). these DB's are built by
"compiling" the headers associated with the DLL (tool parses header,
spits out a DB of everything it saw along the way).
the result is that presently the C FFI has visibility of nearly all of C
land at once. this is in-fact kind of annoying, as one sort of expects
the ability to import *particular* C headers or libraries, rather than
trying to import anything from C land, and having the entire rest of the
C toplevel coming with it (but, this is not really a sufficient issue to
bother trying to fix it).
note that the command for importing C modules, as-is, may trigger
loading DLLs (in the current incarnation, the native package names are
inferred to be potential DLL or SO names).
there is a system for aliases though, so trying to import "C.stdio" may
redirect to internally importing "C.msvcrt" or similar instead (mostly
so that ideally code doesn't need to depend on OS-specific DLL/SO
names). side note: the "C." prefix is mandatory, and magic...
as-is, the language doesn't really have much of a "standard library"
though, since most stuff thus far has either been via built-in
functionality, or via calling C code via the FFI.
yes, probably all a bit crufty and nasty seeming...