On Wed, Mar 10, 2021 at 09:58:19PM +0800, Qian Yun wrote:
> I was checking "sb-ext::run-program", when I found this in
> src/interp/nlib.lisp:
>
> #+:sbcl
> (defun delete-directory (dirname)
> #-:win32 (sb-ext::run-program "/bin/rm" (list "-r" dirname) :search t)
> #+:win32 (obey (concat "rmdir /q /s " "\"" dirname "\""))
> )
>
> First, the win32 case doesn't run before or after my recent "OBEY" fix.
>
> Second, we have our own in-house |remove_directory| implemented in C.
> Are there systems that this C implementation is rejected by 'configure'?
I do not know. The above used to work reasonably well on Unix
systems, but there were troubles on Windows. Also, using external
program is slow.
Basically, the Lisp code above is/was to ensure that there are
no regression due to say 'configure' test failing for some
weird reason. We probably can remove it now and simply fail
in 'configure' if it can not detect directory operations.
> Third, should we really supply our own C implementation, which may be buggy?
Our implementation is really glue code to system interface. Glue
code may be buggy, but IMO risk is lower when we use stable,
low level interfaces compared to higher level ones (there are
more magic at higer level and such interfaces tend to be less
stable).
> It's a pity that filesystem operations are not part of Common Lisp
> standard, but there are third party library that aggregates
> implementation dependent functions. Shall we use that Lisp library
> or a portable C library?
Profiling shows that we spent non-negligable amount of time
due to convertions forced by impedance mismatch between Lisp
and C (C uses seqence of bytes as filename, Lisp has "abstract"
pathnames and seqences of 32-bit codes). Staying with C names
(which I would like to do) could save some build time.
Of course, there are bigger time sinks, but if we manage to
eliminate them, then pathname handling can get significant
for build time.
--
Waldek Hebisch
--
You received this message because you are subscribed to the Google Groups
"FriCAS - computer algebra system" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/fricas-devel/20210328004638.GA17420%40math.uni.wroc.pl.