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
[-- Attachment #1 --] 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… For personal projects, I’ve 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’s 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’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’d love to see written mostly in Lua, David [-- Attachment #2 --] <html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body style="overflow-wrap: break-word; -webkit-nbsp-mode: space; line-break: after-white-space;">On 4 Sep 2024, at 10:09, Mark Delany <x9k@charlie.emu.st> wrote:<br><div><blockquote type="cite"><br class="Apple-interchange-newline"><div><span style="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="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="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="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="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…</span></div></blockquote></div><div><br></div>For personal projects, I’ve 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’s 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’d 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). 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.</div><div><br></div><div>There are lots of control-plane things that I’d love to see written mostly in Lua,</div><div><div><br></div><div>David</div><div><div><br></div></div></div></body></html>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?65ED39B7-099F-43FD-9F53-68286125A65E>
