Reddit Programming
211 subscribers
1.22K photos
124K links
I will send you newest post from subreddit /r/programming
Download Telegram
[Release] virtualshell: Python PowerShell bridge with C++ backend (async, long-lived sessions)
https://www.reddit.com/r/programming/comments/1ntzy1r/release_virtualshell_python_powershell_bridge/

<!-- SC_OFF -->I've released the first version of virtualshell, a Python package that embeds a long-lived PowerShell process behind a C++17 / pybind11 extension. Why it matters: Normal subprocess.run(["pwsh", "-c", ...]) has cold-start overhead (~150–400 ms). This keeps a single PowerShell instance alive, so you can reuse modules, $env:*, and functions between calls. Async API: fire thousands of commands concurrently, results delivered via Futures or callbacks. Thin Python wrapper: all process and pipe I/O is handled in C++ for performance. Benchmarks (Win11, Python 3.13, single pwsh): Latency (tiny cmd): ~20 ms avg Throughput (async, window=64): ~175 cmd/s Heavy OUT (200×512B): ~84 cmd/s Sustained: 5000 async cmds in 54 s (0 errors, no hangs) Install (Windows x64, Python 3.8–3.13): pip install -i https://test.pypi.org/simple/ virtualshell==0.0.0 Code sample: from virtualshell import Shell with Shell(timeout_seconds=3) as sh: res = sh.execute("Write-Output 'hello world'") print(res.output.strip()) Repo: github.com/Chamoswor/virtualshell (https://github.com/Chamoswor/virtualshell) Linux build matrix exists but hasn’t been tested yet. Feedback / benchmarks on other systems would be very welcome. <!-- SC_ON --> submitted by /u/Chamoswor (https://www.reddit.com/user/Chamoswor)
[link] (https://github.com/Chamoswor/virtualshell) [comments] (https://www.reddit.com/r/programming/comments/1ntzy1r/release_virtualshell_python_powershell_bridge/)
Organic Growth vs. Controlled Growth: What Kind of Garden Is Your Codebase?
https://www.reddit.com/r/programming/comments/1nufdu6/organic_growth_vs_controlled_growth_what_kind_of/

<!-- SC_OFF -->I wrote down some thoughts on organic growth vs. controlled growth. Please let me know if you have any feedback :) <!-- SC_ON --> submitted by /u/teivah (https://www.reddit.com/user/teivah)
[link] (https://www.thecoder.cafe/p/organic-growth-vs-controlled-growth) [comments] (https://www.reddit.com/r/programming/comments/1nufdu6/organic_growth_vs_controlled_growth_what_kind_of/)