- Edited
tl;dr: is there in the GDScript APIs the ability to launch a sub-process and then read its stdout and write to its stdin?
While I'm still doing some newb tutorials and toy projects, I already know I'll soon move to a more sizable scenario I have in mind.
There'll be plenty of simulatings / calculations on world and character states and events and flows and everything that I'm clearly seeing in their totality and concurrency and inter-connectedness shouldn't be in GDScript (big fan of it though! unlike Python or Lua... it hits the spot) or C++ (really don't wanna go there — wouldn't mind C with just structs and funcs, but not ++) — either Go / Golang or Zig would be my cup of tea for this "engine" / backend.
Well for Go or Zig (or even potentially Nim) — since I'll neither whip up a custom GDExtension nor use an existing, likely-WIP 3rd-party/FOSS one (albeit super-neat, over time that kind of stuff is most often playing laggy catch-up, then going unmaintained — I mean at a pace faster than Godot will, ie. a-few-years instead of a-decade-or-two =), I'd have to client-server with my backend code. We're talking same-machine though, inter-process communication.
Even UDP is a bit of overhead compared to the leanness of 2 processes talking bytes to each other via stdin and stdout. Though not applicable/supportable/feasible for non-desktop OS platforms such as web, mobile, consoles (other than Deck I guess =), for "desktop" OSes from Linux to Mac to Win it's always the very same sort of APIs really, and with Godot's (likely-already-existing) libc dependency it's even identical across all targets IIRC. It'd be a great "user API" to have in Godot, like popen
or similar in the likes of NodeJS, PHP etc (and really anywhere that has a libc loaded under the hood) and so I searched the docs but nada.
UDP would be the alternative but yeah, for local inter-process bytes -pushing, kinda over the top. (Although at least I'd hope there should be no packet loss from localhost to localhost...)
(Either way, we're not talking about every-frame stuff here, perhaps every-few-seconds stuff. But as we know, "it all adds up" so I like to go as lean&mean as the scenario/requirements allows..)