From nobody Wed Sep 4 09:25:37 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4WzHCx6sLvz5TW7m for ; Wed, 04 Sep 2024 09:25:49 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "smtp.freebsd.org", Issuer "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4WzHCx64gZz4jv0; Wed, 4 Sep 2024 09:25:49 +0000 (UTC) (envelope-from theraven@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725441949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5cbwOJ2WZX/8e/PvEU783MmW5/ckrM5wTIp9SKaXICg=; b=cK2EcrCdDjiywZPRViUTXVsEOiJjrBfqu2zgyfMfMae0KPBjIxoKniPXNBilp/sEbTkA+Y Hg8gS/AFcfuU9GhDRtGTfnW9ej8r2NVusRWmPG/nLYnTv4EY+F2v9U0GWc/nvPmeprVODa Nnv3vdYkYXcZu/XlqHYhRisIdMghmq0jm511Kwn28NUyDcmXRxHMTBoHBEhLcOoGKqALb3 qp++ak24HjdG2MClGIp/TRM0A0UQvGEIkJ6ANspqWQA/o96ocRdFRBq7QZUjeOQPDo4pi1 8h382jdSnC+oTXf/I8i4MfsKAk8Fw3lC6Wpe/dDvKq3JR4dXixXmll78HxCsxw== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1725441949; a=rsa-sha256; cv=none; b=EHTu2+uhw/EFUx/F5sWjGmz+n03ADfDpL3XwxA7xqwty95K+v5RpSvWudqSLr9VXhRskHd AAeJTgFoP0LxzkEar1PSZZGAvTMo6YL7RxC37MOph6OIAIzcEgqFQEr6WQbAHAI++mSh2E olSjxa8BAYvpEhf51azv428d0WjQDAzLJc+aaEy9g231mNayl8viLnt1lclMdiz4AgSxrT UrBMZjwWTh3USVrkTYCL1uQmdD4f7z7zkJxg2oFvlL2PuLQR+kP5HcyaqXHbt1jc+M3myo XPAE7x4PRS8xwbW5F5kf3bYDxbefMi8E6H6o2gN+IRCyNAo9a9o/pqJ5shS4fQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1725441949; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=5cbwOJ2WZX/8e/PvEU783MmW5/ckrM5wTIp9SKaXICg=; b=R+83rk3/SCxFvUF11w1QVeDBptbphjVY3Dabl5i/7g2UkmQapK9AUDYURTHHYrSL8wc3Gf wy+VS7N+Y7wxtCKSkolx5BojHB4TgVFIvc/6sBRgrj9YcSfTSJuq+iwoW+l3KNf7/Kn/g6 qHJaGE8C0w5oOheDtgfEITmn44aAT2WplPfX0MgeTMf6wvK0LeWeFjLO8HrV+vx6n9eeH/ 1mkIEACFHr6WaWXtgLgEyjkCX93sA2kQv082o+5f+gin3wYMdqDceBXXh0v1uGazMtppUQ DFuJo8zSgFfguWGZ5o8YjoqQsEWtVzsGnXBmUgFsPJHbgtDNGRTtD7LDAtWEjw== Received: from smtp.theravensnest.org (smtp.theravensnest.org [45.77.103.195]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) (Authenticated sender: theraven) by smtp.freebsd.org (Postfix) with ESMTPSA id 4WzHCx5TDyzK2R; Wed, 4 Sep 2024 09:25:49 +0000 (UTC) (envelope-from theraven@FreeBSD.org) Received: from smtpclient.apple (host109-155-136-107.range109-155.btcentralplus.com [109.155.136.107]) by smtp.theravensnest.org (Postfix) with ESMTPSA id 05CE150FB; Wed, 04 Sep 2024 10:25:48 +0100 (BST) From: David Chisnall Message-Id: <65ED39B7-099F-43FD-9F53-68286125A65E@FreeBSD.org> Content-Type: multipart/alternative; boundary="Apple-Mail=_32030E2D-359B-47E5-99E7-236CC5A6E140" List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3776.700.51\)) Subject: Re: Rust: kernel vs user-space Date: Wed, 4 Sep 2024 10:25:37 +0100 In-Reply-To: <0.2.0-final-1725440949.866-0xb4bb20@qmda.emu.st> Cc: freebsd-hackers@freebsd.org To: Mark Delany References: <202409031532.483FW0If007252@critter.freebsd.dk> <7533543.20240904114624@yahoo.com> <0.2.0-final-1725440949.866-0xb4bb20@qmda.emu.st> X-Mailer: Apple Mail (2.3776.700.51) --Apple-Mail=_32030E2D-359B-47E5-99E7-236CC5A6E140 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=utf-8 On 4 Sep 2024, at 10:09, Mark Delany wrote: >=20 > As for user-space, I find the rationale for Rust as the = one-true-language-after-C far less > compelling as many CLIs and server programs can just as well be = written in more accessible > languages such as go or perl or java or=E2=80=A6 For personal projects, I=E2=80=99ve been using Sol3, which is a C++ = library that (via a lot of slightly terrifying metaprogramming) makes it = trivial to expose bindings to Lua. It=E2=80=99s fantastic for wrapping = some low-level things in C++ and then writing all of the important logic = in Lua. Given that C++ and Lua are already in the base system, I=E2=80=99= d love to see something like this used. I did some prototyping a few years ago exposing Dear ImGui with the = ImTui back end to Lua, for writing rich TUIs (with a little kqueue-based = event loop so that I/O could all be exposed to Lua as non-blocking = coroutines and you could yield to the scheduler to write cooperatively = multithreaded Lua). My hope was that ImTui and ImGui-WS would be = upstreamed to Dear ImGui so that it would be easy to write TUIs that = could also give X11 / Wayland GUIs or in-browser GUIs that you could = tunnel over SSH. Unfortunately, the author of ImTui and ImGUI-WS moved = on to writing llama.cpp and so I gave up hoping that this would happen. = I could tidy up the core bits if anyone is interested though. There are lots of control-plane things that I=E2=80=99d love to see = written mostly in Lua, David --Apple-Mail=_32030E2D-359B-47E5-99E7-236CC5A6E140 Content-Transfer-Encoding: quoted-printable Content-Type: text/html; charset=utf-8 On 4 Sep 2024, = at 10:09, Mark Delany <x9k@charlie.emu.st> = wrote:

As for user-space, I find the rationale for = Rust as the one-true-language-after-C far less
compelling as many CLIs and server programs can just as = well be written in more accessible
languages such as go or = perl or java or=E2=80=A6

For= personal projects, I=E2=80=99ve been using Sol3, which is a C++ library = that (via a lot of slightly terrifying metaprogramming) makes it trivial = to expose bindings to Lua.  It=E2=80=99s fantastic for wrapping = some low-level things in C++ and then writing all of the important logic = in Lua.  Given that C++ and Lua are already in the base system, = I=E2=80=99d love to see something like this used.

I = did some prototyping a few years ago exposing Dear ImGui with the ImTui = back end to Lua, for writing rich TUIs (with a little kqueue-based event = loop so that I/O could all be exposed to Lua as non-blocking coroutines = and you could yield to the scheduler to write cooperatively = multithreaded Lua).  My hope was that ImTui and ImGui-WS would be = upstreamed to Dear ImGui so that it would be easy to write TUIs that = could also give X11 / Wayland GUIs or in-browser GUIs that you could = tunnel over SSH.  Unfortunately, the author of ImTui and ImGUI-WS = moved on to writing llama.cpp and so I gave up hoping that this would = happen.  I could tidy up the core bits if anyone is interested = though.

There are lots of control-plane things = that I=E2=80=99d love to see written mostly in = Lua,

David

= --Apple-Mail=_32030E2D-359B-47E5-99E7-236CC5A6E140--