Reddit Programming
201 subscribers
1.22K photos
126K links
I will send you newest post from subreddit /r/programming
Download Telegram
Keystone Desktop – Native + Web desktop framework: C# host, Bun runtime, WebKit renderer
https://www.reddit.com/r/programming/comments/1rf36vi/keystone_desktop_native_web_desktop_framework_c/

<!-- SC_OFF -->Hi — This is my open source project. Keystone-Desktop, a desktop application framework that runs as three OS processes: a C# host (AppKit/Metal on macOS, GTK4/Vulkan on Linux, Win32/D3D12 on Windows), a Bun subprocess (TypeScript services, web component bundling, WebSocket bridge), and a WebKit content process per window. Why another desktop framework? Existing frameworks force a choice. Electron and Tauri give you web rendering — great for UI, but if you need native GPU rendering (Metal/Vulkan), you're out of luck. Qt and SwiftUI give you native rendering but no web ecosystem. Keystone lets you use either or both: a single window can composite GPU/Skia-rendered content alongside WebKit content. Build your whole app in web tech, build it entirely in native C# with GPU rendering, or mix them per-window. Three ways to build: - Web-only:
TypeScript UI + Bun services, zero C# code. Declare windows in config, implement as web components. Built-in APIs cover file dialogs, window management, shell integration. - Native-only:
Pure C# with GPU/Skia rendering and Flex layout via Taffy (Rust FFI). No browser overhead. - Hybrid:
GPU-rendered canvas for performance-critical content, WebKit for rich UI — composited together in the same window. The interesting technical decisions: - Each IPC direction uses a purpose-chosen transport. Browser -> C# goes through WKScriptMessageHandler (direct, zero network hops). C# <-> Bun uses NDJSON over stdin/stdout (reliable, synchronous with process lifetime). Browser <-> Bun uses WebSocket (async, pub/sub, live data). - Hot-reloadable .NET plugins via collectible AssemblyLoadContext. The runtime builds a dependency graph from assembly references — when a shared library plugin reloads, all its dependents cascade-reload in topological order. State is serialized before unload and deserialized into the new instance. Sub-second native code iteration without restarting the app. - Per-window render threads synced to DisplayLink. Idle windows suspend their vsync subscription. During live resize, drawable size freezes and the compositor scales — avoids the frame-drop issue most Metal apps have during resize. - A dual rendering path: retained scene graph (diffed between frames, layout via Taffy/Rust FFI) for UI chrome, and immediate-mode Skia for custom visualization. Composable via CanvasNode — embed an immediate-mode region inside the retained scene graph. Current state:
v1.0.2 ~24k lines of framework code. macOS is the most tested path. Built by one person over ~3 months, extracted from a monolith app into a standalone framework over ~1 week. MIT licensed. Happy to answer architecture questions. <!-- SC_ON --> submitted by /u/hayztrading (https://www.reddit.com/user/hayztrading)
[link] (https://github.com/khayzz13/keystone_desktop) [comments] (https://www.reddit.com/r/programming/comments/1rf36vi/keystone_desktop_native_web_desktop_framework_c/)
I have devised a factorization algorithm.The source is written in C and uses the GMP and ECM libraries. Would anyone with a decent computer like to test this?
https://www.reddit.com/r/programming/comments/1rf4cjr/i_have_devised_a_factorization_algorithmthe/

<!-- SC_OFF -->I have devised a factorization algorithm that: Given M, a number to be factored, From M, generates an N of the order of magnitude of M^2. Starts the complete factorization of N using trial division, H_special, ECM, and Pollard–Rho. Each time it finds a new factor, it updates the current factorization. At each TIMEOUT expiration, it checks whether a given value S is valid. If S is valid, it is sent to the main program via. The main program checks whether S produces a factorization of M; otherwise, it generates another N and restarts. The source is written in C and uses the GMP and ECM libraries. ECM uses B1 = 50000, 250000, 1000000, with 200 curves for each B1, for a total of 600 ECM curves, with standard GMP-ECM parameters and a timeout of 1800 seconds. Optimal case: N is factored in a few seconds S is valid S produces a factorization of M Would anyone with a decent computer like to test this? lepore_factorization_nr_00 https://github.com/Piunosei/lepore_factorization_nr_00 <!-- SC_ON --> submitted by /u/Acrobatic_Tadpole724 (https://www.reddit.com/user/Acrobatic_Tadpole724)
[link] (https://github.com/Piunosei/lepore_factorization_nr_00) [comments] (https://www.reddit.com/r/programming/comments/1rf4cjr/i_have_devised_a_factorization_algorithmthe/)
Open vs Closed Loop: A Benchmarking Crime
https://www.reddit.com/r/programming/comments/1rfjr3w/open_vs_closed_loop_a_benchmarking_crime/

<!-- SC_OFF -->This post explains in relatively simple terms what an open loop benchmark is and why it can be vital to get this right. I am hardly the first person to write about this topic, but I suspect that I am not the only one who hadn't thought about the details of their benchmarking setup enough. <!-- SC_ON --> submitted by /u/curly_droid (https://www.reddit.com/user/curly_droid)
[link] (https://notpeerreviewed.com/blog/tail-latency/) [comments] (https://www.reddit.com/r/programming/comments/1rfjr3w/open_vs_closed_loop_a_benchmarking_crime/)
Rust in Production: JetBrains
https://www.reddit.com/r/programming/comments/1rfl42t/rust_in_production_jetbrains/

<!-- SC_OFF -->This interview explores JetBrains’ strategy for supporting the Rust Foundation and collaborating around shared tooling like rust-analyzer, the rationale behind launching RustRover, and how user adoption data shapes priorities such as debugging, async Rust workflows, and test tooling (including cargo nextest). <!-- SC_ON --> submitted by /u/Hefty-Necessary7621 (https://www.reddit.com/user/Hefty-Necessary7621)
[link] (https://serokell.io/blog/rust-in-production-jetbrains) [comments] (https://www.reddit.com/r/programming/comments/1rfl42t/rust_in_production_jetbrains/)