I think we would welcome the facility you propose (easy conversion between J arrays and npy binary format).
At least at this stage we would be reluctant to accept it as a direct addition to the J source. It is better packaged as a separate shared library. It should be possible to package it as an addon. The addon would include shared libraries for the platforms of interest (windows/linux/macos) and simple cover functions that did the cd calls to the libraries. This is how Jd/lapack/etc provide extensions like this. We would be very happy to see an addon for this. On Thu, Sep 24, 2020 at 1:33 PM 'Zhihao Yuan' via Source < [email protected]> wrote: > On Thu, Sep 24, 2020 at 12:24 PM Henry Rich <[email protected]> wrote: > > > A list of bytes is internal to J and is a known type. A file is > > foreign. If I want to send an npy datastream over a socket, why should > > I have to write/read a file? > > > > The new primitive should deal with bytes rather than files for the same > > reason (":) does. > > > > For information about J forums see http://www.jsoftware.com/forums.htm > > > > I would suggest writing it to a file first, then send it > via sendfile(2) system call. Staging giga bytes of > data in memory doesn't make it transfer faster. > Serialize the object in small pieces while sending > is more appropriate from a industrial-quality > software's point of view. > > -- > Zhihao > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
