Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 4 Sep 2024 10:25:37 +0100
From:      David Chisnall <theraven@FreeBSD.org>
To:        Mark Delany <x9k@charlie.emu.st>
Cc:        freebsd-hackers@freebsd.org
Subject:   Re: Rust: kernel vs user-space
Message-ID:  <65ED39B7-099F-43FD-9F53-68286125A65E@FreeBSD.org>
In-Reply-To: <0.2.0-final-1725440949.866-0xb4bb20@qmda.emu.st>
References:  <202409031532.483FW0If007252@critter.freebsd.dk> <7533543.20240904114624@yahoo.com> <0.2.0-final-1725440949.866-0xb4bb20@qmda.emu.st>

next in thread | previous in thread | raw e-mail | index | archive | help

--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 <x9k@charlie.emu.st> 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

<html><head><meta http-equiv=3D"content-type" content=3D"text/html; =
charset=3Dutf-8"></head><body style=3D"overflow-wrap: break-word; =
-webkit-nbsp-mode: space; line-break: after-white-space;">On 4 Sep 2024, =
at 10:09, Mark Delany &lt;x9k@charlie.emu.st&gt; =
wrote:<br><div><blockquote type=3D"cite"><br =
class=3D"Apple-interchange-newline"><div><span style=3D"caret-color: =
rgb(0, 0, 0); font-family: SourceCodePro-Regular; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none; float: none; =
display: inline !important;">As for user-space, I find the rationale for =
Rust as the one-true-language-after-C far less</span><br =
style=3D"caret-color: rgb(0, 0, 0); font-family: SourceCodePro-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none;"><span style=3D"caret-color: rgb(0, 0, 0); font-family: =
SourceCodePro-Regular; font-size: 12px; font-style: normal; =
font-variant-caps: normal; font-weight: 400; letter-spacing: normal; =
text-align: start; text-indent: 0px; text-transform: none; white-space: =
normal; word-spacing: 0px; -webkit-text-stroke-width: 0px; =
text-decoration: none; float: none; display: inline =
!important;">compelling as many CLIs and server programs can just as =
well be written in more accessible</span><br style=3D"caret-color: =
rgb(0, 0, 0); font-family: SourceCodePro-Regular; font-size: 12px; =
font-style: normal; font-variant-caps: normal; font-weight: 400; =
letter-spacing: normal; text-align: start; text-indent: 0px; =
text-transform: none; white-space: normal; word-spacing: 0px; =
-webkit-text-stroke-width: 0px; text-decoration: none;"><span =
style=3D"caret-color: rgb(0, 0, 0); font-family: SourceCodePro-Regular; =
font-size: 12px; font-style: normal; font-variant-caps: normal; =
font-weight: 400; letter-spacing: normal; text-align: start; =
text-indent: 0px; text-transform: none; white-space: normal; =
word-spacing: 0px; -webkit-text-stroke-width: 0px; text-decoration: =
none; float: none; display: inline !important;">languages such as go or =
perl or java or=E2=80=A6</span></div></blockquote></div><div><br></div>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. &nbsp;It=E2=80=99s fantastic for wrapping =
some low-level things in C++ and then writing all of the important logic =
in Lua. &nbsp;Given that C++ and Lua are already in the base system, =
I=E2=80=99d love to see something like this used.<div><br></div><div>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). &nbsp;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. &nbsp;Unfortunately, the author of ImTui and ImGUI-WS =
moved on to writing llama.cpp and so I gave up hoping that this would =
happen. &nbsp;I could tidy up the core bits if anyone is interested =
though.</div><div><br></div><div>There are lots of control-plane things =
that I=E2=80=99d love to see written mostly in =
Lua,</div><div><div><br></div><div>David</div><div><div><br></div></div></=
div></body></html>=

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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65ED39B7-099F-43FD-9F53-68286125A65E>