From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-x232.google.com (mail-lj1-x232.google.com [IPv6:2a00:1450:4864:20::232]) by sourceware.org (Postfix) with ESMTPS id DC6FF3858D34 for ; Tue, 14 Jul 2020 21:10:46 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org DC6FF3858D34 Received: by mail-lj1-x232.google.com with SMTP id q7so237957ljm.1 for ; Tue, 14 Jul 2020 14:10:46 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=5Pwu2JTOOPdnJbWluCRBCqkM/XeRhZ2Z9Ha8mGopskE=; b=ctzUCCniOaUCQcQ2p81bX9kizsY0Ezv2Js5tov5d2sJu0ay9gGtdhMWuZU/a+KvIwh k3IeFdrIqKgnI5xin2YHahWrcCdfDR7wHk8T91jcAVmYkL384uCbVsEgfjYspg81gKLI EpFMfqu+qm+GopPFsURSsV4J9TY8CxuqKb3tuhCapfDsPOXksTNvep5gdi6ysy4HSSbk iNK4ebUAs3MQ1I9t9KbfTiRfviK5ZSYvYM69Id+Nxb9hhY9JGOe2Os4Vnkm0gev2pwCK Scby3nZUjHHCmFw0sug7drYpj5ozJT4KmNUMPtvZLNggmKSL+G/Lu1JCXIQhskyG7g7j 1+Ag== X-Gm-Message-State: AOAM532sZj4w4ktidYW5nMxWSYSFxb7UvKMWJiLZGgTCuy30B4Qco78i n2MnxbP2wGy3atVz8PRg0/HTNR/U6PujNLiEIgf27m+V X-Google-Smtp-Source: ABdhPJw958b3ZUUZ5WRqUQR73xwgCaQZHxHv4tDUe+u/u68Ztfe7zci0++hjB7t98WG1XPVUDFu46rd8HtFdsJhLmcU= X-Received: by 2002:a2e:9908:: with SMTP id v8mr3079325lji.186.1594761045082; Tue, 14 Jul 2020 14:10:45 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Duncan Mak Date: Tue, 14 Jul 2020 17:10:09 -0400 Message-ID: Subject: Re: SRFI 170 (POSIX API) for Kawa To: Per Bothner Cc: Lassi Kortela , kawa mailing list , srfi-170@srfi.schemers.org X-Spam-Status: No, score=-2.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, HTML_MESSAGE, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 X-BeenThere: kawa@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Kawa mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 14 Jul 2020 21:10:48 -0000 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 wrote: > On Sat, Feb 22, 2020 at 4:46 AM Lassi Kortela 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.