public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Duncan Mak <duncanmak@gmail.com>
To: Per Bothner <per@bothner.com>
Cc: Lassi Kortela <lassi@lassi.io>,
	kawa mailing list <kawa@sourceware.org>,
	srfi-170@srfi.schemers.org
Subject: Re: SRFI 170 (POSIX API) for Kawa
Date: Tue, 14 Jul 2020 17:10:09 -0400	[thread overview]
Message-ID: <CABgWrqpf7aUCNBof38oKKyudkgda1HG00uHH+YRhv6g+sf1B6Q@mail.gmail.com> (raw)
In-Reply-To: <db57ec24-ffed-c71d-eac5-82caa989c56d@bothner.com>

Hello all,

The other weekend, I took on Per's suggestion and began typing up parts of
the SRFI 170 API using Kawa Scheme.

It's still WIP, but you can see what I have here:
https://github.com/duncanmak/srfi-170/blob/kawa/srfi/kawa/lib/srfi/170/170.scm

From the module listing, you can see which Java classes I'm using:

(define-library (srfi 170)
  (import (kawa base)
          (srfi 9)
          (class java.lang ProcessHandle UnsupportedOperationException)
          (class java.util EnumSet Iterator)
          (class java.nio.file DirectoryStream DirectoryStream$Filter Files
Path Paths)
          (class java.nio.file.attribute
                 BasicFileAttributeView
                 FileAttribute
                 PosixFileAttributeView
                 PosixFilePermission
                 PosixFilePermissions)
          (class java.nio.channels FileChannel))

I haven't gotten around to hooking up with the test code, so there might be
some mistakes there.

it's pretty clear that we won't be able to support the entirety of the SRFI
170 API using just Java classes. If we want to achieve that, we'll probably
have to use JNR-Posix.

With JNR-Posix, Per's comments about shipping native code will become a
thing.

If there's interest in seeing this work completed, I can look at finishing
up the patch and try to write something back to tally which of the APIs can
be implemented with just Java, and which would require jnr-posix.

If there's even more interest, I could also look into doing a jnr-posix
implementation as well.


Duncan.

On Sat, Feb 22, 2020 at 11:40 AM Per Bothner <per@bothner.com> wrote:

> On Sat, Feb 22, 2020 at 4:46 AM Lassi Kortela <lassi@lassi.io> wrote:
>
> > Is anyone working on implementing SRFI 170 for Kawa yet? Since Kawa is
> > Java-based instead of C-based, and uses pathname objects as well as a
> > per-thread parameter object to store the current directory, it would
> > make for a good test case.
>
> It might be interesting to see how much could be implemented in portable
> Java,
> without digging into native (C/C++) code.  Kawa currently does not contain
> native code, which means we can make a single cross-platform "binary
> release".
>
> That doesn't mean I'll rule out having optional features that depend
> on native code, but I would prefer to stick to no native code in the
> default build.
>
> There are no doubt large parts of SRFI-170 that could be implemented
> without native code, but I haven't done the effort to see what the issues
> are.
> If someone wants to look into to what extent SRFI-170 can be mapped into
> Java APIs that would be interesting, but I'm not planning to do that
> study myself.
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/
>


-- 
Duncan.

  reply	other threads:[~2020-07-14 21:10 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-22  9:46 Lassi Kortela
2020-02-22 16:08 ` Duncan Mak
2020-02-22 16:40   ` Per Bothner
2020-07-14 21:10     ` Duncan Mak [this message]
2020-07-15  4:16       ` Per Bothner
2020-07-15  6:59         ` Arvydas Silanskas
2020-07-16  0:02         ` Jamison Hope
2020-07-16  4:58           ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CABgWrqpf7aUCNBof38oKKyudkgda1HG00uHH+YRhv6g+sf1B6Q@mail.gmail.com \
    --to=duncanmak@gmail.com \
    --cc=kawa@sourceware.org \
    --cc=lassi@lassi.io \
    --cc=per@bothner.com \
    --cc=srfi-170@srfi.schemers.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).