From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: M Newsgroups: gmane.lisp.guile.devel Subject: RE: Minimal example of extending Guile with Rust? Date: Mon, 29 Jan 2024 16:49:27 +0100 Message-ID: <20240129164928.gfpN2B00Q2sdiUi01fpTMS@xavier.telenet-ops.be> References: <878r48jhwt.fsf@web.de> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="_576D4EEF-8C3A-4EFD-B42E-B7D816702CBE_" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33851"; mail-complaints-to="usenet@ciao.gmane.io" To: "Dr. Arne Babenhauserheide" , "guile-devel@gnu.org" Original-X-From: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Mon Jan 29 16:50:43 2024 Return-path: Envelope-to: guile-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rUTuF-0008dL-0N for guile-devel@m.gmane-mx.org; Mon, 29 Jan 2024 16:50:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rUTtM-00053p-05; Mon, 29 Jan 2024 10:49:48 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rUTtC-000521-8W for guile-devel@gnu.org; Mon, 29 Jan 2024 10:49:40 -0500 Original-Received: from xavier.telenet-ops.be ([2a02:1800:120:4::f00:14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rUTt8-0005u5-AB for guile-devel@gnu.org; Mon, 29 Jan 2024 10:49:36 -0500 Original-Received: from [IPv6:2a02:1811:8c09:9d00:b5fc:6f2d:f7e8:9fe5] ([IPv6:2a02:1811:8c09:9d00:b5fc:6f2d:f7e8:9fe5]) by xavier.telenet-ops.be with bizsmtp id gfpN2B00Q2sdiUi01fpTMS; Mon, 29 Jan 2024 16:49:27 +0100 Importance: normal X-Priority: 3 In-Reply-To: <878r48jhwt.fsf@web.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=telenet.be; s=r24; t=1706543368; bh=JGxGt4sphF6wdKKyhJ7m9g8Am7erkxOlZxY4vEfgdOk=; h=To:From:Subject:Date:In-Reply-To:References; b=Pi/vkgTjcsM9nPgLe0GRnBylcDMZntPhYPH1Qnyk8eTXli/tsPwTwwRt4fZF/e0JO egLSPQQ0mmcyHPYew0ZNwnwD9HZYwNrBiQ9tp0tmiVJXE+7tb3EufxxORtchJFPIq6 MBD6SfAqPRgWWQOZCT9q32yGqHOnZ6H94sf2DGbU4pQR40ACW0mfZZeXuYlwSer1iR bnXtfIXN7VSvKwXAcPlClOGO8kwQm39u0dV+nmSG7jiBRhOqHpgBFxfWEpiRkXd4W0 C1R3xwxrRGNIjFbQwfiAWMSkcuyxU36EnDTaA+KIAxnXbd2UA76U6Rl3UvBvaqtVo5 esLZ0JjeQjElg== Received-SPF: pass client-ip=2a02:1800:120:4::f00:14; envelope-from=maximedevos@telenet.be; helo=xavier.telenet-ops.be X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.lisp.guile.devel:22286 Archived-At: --_576D4EEF-8C3A-4EFD-B42E-B7D816702CBE_ Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" > (similar to the >native C arrays numpy exposes to C that allow getting the >speed of C). For this in particular, there is pointer->bytevector, bytevector->pointer a= nd bytevector-TYPE-ref, bytevector-TYPE-set! (it=E2=80=99s not limited to o= nly bytes, also floats are available IIRC). Don=E2=80=99t do bytevector->pointer + pointer->bytevector + =E2=80=A6 in l= ong sequences though, or else this loop will use memory proportional to the= length to this sequence. (This is intentionally undocumented (*).) Best regards, Maxime Devos (*) For its application bytevector-slice, see https://lists.gnu.org/archive= /html/guile-devel/2023-01/msg00042.html, which was ignored. --_576D4EEF-8C3A-4EFD-B42E-B7D816702CBE_ Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset="utf-8"

> = (similar to the

>native C arrays numpy exposes t= o C that allow getting the >speed of C).

&n= bsp;

For this in particular, there is pointer= ->bytevector, bytevector->pointer and bytevector-TYPE-ref, bytevector= -TYPE-set! (it=E2=80=99s not limited to only bytes, also floats are availab= le IIRC).

 

Don=E2=80=99t do bytevector->pointer + pointer->bytevector + =E2=80= =A6 in long sequences though, or else this loop will use memory proportiona= l to the length to this sequence. (This is intentionally undocumented (*).)=

 

Best reg= ards,

Maxime Devos

&nb= sp;

(*) For its application bytevector-slice,= see https://lists.gnu.org/archive/html/guile-devel/2023-01/msg00042.= html, which was ignored.

= --_576D4EEF-8C3A-4EFD-B42E-B7D816702CBE_--