Reddit Programming
206 subscribers
1.22K photos
123K links
I will send you newest post from subreddit /r/programming
Download Telegram
How I Doubled My Lookup Performance with a Bitwise Trick
https://www.reddit.com/r/programming/comments/1m0tcd6/how_i_doubled_my_lookup_performance_with_a/

<!-- SC_OFF -->Hey folks, While working on a Cuckoo Filter implementation, I originally used a simple byte array to store 4-slot buckets, each holding 1-byte fingerprints. Then it hit me—those 4 bytes fit perfectly into a 32-bit integer. So why not treat the whole bucket as a single uint? That small insight led to a few evenings of playing with bitwise operations. Eventually, I replaced loops and branching with a compact SWAR (https://en.wikipedia.org/wiki/SWAR). Here's what it is in one line: ((bucket ^ (fp * 0x01010101U)) - 0x01010101U) & ~(bucket ^ (fp * 0x01010101U)) & 0x80808080U) != 0 Over 60% faster positive lookups and more than 2× faster negative lookups. I liked the result enough to write up the whole journey in an article: the idea, the math, step-by-step explanation, and the benchmarks. If that one-liner looks scary, don't worry—it's not as bad as it seems. And it was fun stuff to explore. <!-- SC_ON --> submitted by /u/axel-user (https://www.reddit.com/user/axel-user)
[link] (https://maltsev.space/blog/012-simd-within-a-register-how-i-doubled-hash-table-lookup-performance) [comments] (https://www.reddit.com/r/programming/comments/1m0tcd6/how_i_doubled_my_lookup_performance_with_a/)
Are self maintained language frameworks worth it?
https://www.reddit.com/r/programming/comments/1m17sde/are_self_maintained_language_frameworks_worth_it/

<!-- SC_OFF -->I recently joined a company that uses Haskell for its backend. On top of that, they’ve built their own custom framework for it. Since I’m new to both Haskell and this in-house setup, I’ve been wondering: Was it really necessary to build a whole new framework? What kind of circumstances make maintaining your own framework worthwhile? Are the trade-offs—like developer ramp-up time and maintainability—justified in the long run? Curious to hear your experiences or opinions—especially if you’ve worked with in-house frameworks in lesser-used languages. <!-- SC_ON --> submitted by /u/Willing-Bookkeeper75 (https://www.reddit.com/user/Willing-Bookkeeper75)
[link] (https://github.com/juspay/euler-hs) [comments] (https://www.reddit.com/r/programming/comments/1m17sde/are_self_maintained_language_frameworks_worth_it/)
Generative Geometry and CLACL Language: Key Concepts
https://www.reddit.com/r/programming/comments/1m1chwk/generative_geometry_and_clacl_language_key/

<!-- SC_OFF -->Theory of a new non-Cartesian logical geometry and CLACL programming language <!-- SC_ON --> submitted by /u/Maga565 (https://www.reddit.com/user/Maga565)
[link] (https://g.co/gemini/share/ade981b05669) [comments] (https://www.reddit.com/r/programming/comments/1m1chwk/generative_geometry_and_clacl_language_key/)
Show: ggc – A terminal Git client with both CLI and interactive UI
https://www.reddit.com/r/programming/comments/1m1eiu1/show_ggc_a_terminal_git_client_with_both_cli_and/

<!-- SC_OFF -->Hi all, I recently built ggc (https://github.com/bmf-san/ggc), a Git client that runs entirely in the terminal — offering both traditional subcommands and a fuzzy-search-based interactive UI. It started as a personal need: my Git aliases and shell scripts were growing out of control. I wanted something fast, lightweight, and shareable. So I wrote it in Go. 🔹 Highlights: - Run ggc to launch an interactive Git UI (branch checkout, staging, stashing, etc.) - Or run ggc for familiar subcommands - Built-in workflows like addcommitpush and stashpullpop - No external dependencies — just Go stdlib + x/term It’s open source, and I’d love to hear what you think — especially if you’ve built CLI tools or worked on similar ideas. Repo: https://github.com/bmf-san/ggc <!-- SC_ON --> submitted by /u/bmf_san (https://www.reddit.com/user/bmf_san)
[link] (https://github.com/bmf-san/ggc) [comments] (https://www.reddit.com/r/programming/comments/1m1eiu1/show_ggc_a_terminal_git_client_with_both_cli_and/)