Re: Rust: kernel vs user-space

From: David Chisnall <theraven_at_FreeBSD.org>
Date: Wed, 04 Sep 2024 09:25:37 UTC
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