Reddit Programming
201 subscribers
1.22K photos
126K links
I will send you newest post from subreddit /r/programming
Download Telegram
“Falsehoods Programmers Believe About Time” still the best reminder that time handling is fundamentally broken
https://www.reddit.com/r/programming/comments/1rejwmj/falsehoods_programmers_believe_about_time_still/

<!-- SC_OFF -->“Falsehoods Programmers Believe About Time” is a classic reminder that time handling is fundamentally messy. It walks through incorrect assumptions like: Days are always 24 hours Clocks stay in sync Timestamps are unique Time zones don’t change System clocks are accurate It also references real production issues (e.g., VM clock drift under KVM) to show these aren’t theoretical edge cases. Still highly relevant for backend, distributed systems & infra work. <!-- SC_ON --> submitted by /u/Digitalunicon (https://www.reddit.com/user/Digitalunicon)
[link] (https://infiniteundo.com/post/25326999628/falsehoods-programmers-believe-about-time) [comments] (https://www.reddit.com/r/programming/comments/1rejwmj/falsehoods_programmers_believe_about_time_still/)
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/)