On 8/6/07, Luís Oliveira luismbo@gmail.com wrote:
On 28/07/07, Nikodemus Siivola nikodemus@random-state.net wrote:
OSICAT: something very much like now, including pathname functions like NATIVE-NAMESTRING and PARSE-NATIVE-NAMESTRING. Nice and lispy, portable across multiple platforms -- either using interfaces that are flexible enough, or staying clear of platform specific hair even when it means missing functionality.
WIN32-SYS & POSIX-SYS: low-level APIs. Should be possible to use without thinking about "CFFI", or "Alien", or whatever the FFI layer is. As high-level as possible while remaining an accurate mapping and as low-level as it needs to be for the needs of accuracy and efficiency.
Here's a first shot at that. Includes texinfo documentation, tests and a few new functions mostly stolen from cl-fad:
git clone http://common-lisp.net/~loliveira/soc07/osicat.git
(Converted the CVS history to Git.)
The posix module works, compiles and passes all tests on windows but I haven't tested the high-level bits yet or thought about how to handle the missing functionality there at all.
I don't have any immediate plans to work much more on it at least until August 20th except for perhaps updating the Osicat webpage if/when you (Nikodemus and the others) feel this branch is OK.
I managed to spend a _very_ short while looking at it. Looking good.
The only things I'm unhappy about are grabbing package names like MACH. On one hand, I fully see the motivation for terse (and descriptive!) names, since those packages are liable to contain symbols named directly after the native interfaces available -- so they are going to be mostly used with explicit package prefixes, but...
Few options come to mind:
(a) Use names like OSIX, OSMACH, OSWIN -- compromise between putting them in the OSICAT "namespace" and using something terse.
(b) Prefix the symbol names. I'm not suggesting prefixing them with "OSICAT-", but rather possibly "-" or "_". Ugly, but practically speaking allows the packages to be USE-PACKAGE'd, so having a long package name like OSICAT-POSIX is ok.
(c) Reader macro magic.
I'm inclined towards (a), but can live with others as well.
Other stuff (aka directions to move in): while I'm OK with having OSICAT-POSIX / OSIX on Windows, in the long term the Windows side should probably not build on it. (Ditto if there are things that are more naturally done using the mach interfaces on Darwin.) So things like USER-INFO should be calling GetUserName (or whatever) on Windows, not getpwnam &co. So that everything doesn't become a huge #+foo mess, there should be src/windows.lisp, which implements the nonportable contents of src/osicat.lisp for Windows, etc.
Cheers,
-- Nikodemus