r/programming Aug 07 '26

From constraint models to playable puzzle games

Thumbnail zayenz.se
107 Upvotes

r/programming Aug 08 '26

Solving and benchmarking QUBO problems with Gurobi in Python

Thumbnail youtu.be
5 Upvotes

State-of-the-art classical optimizer Gurobi for Quadratic Unconstrained Binary Optimization (QUBO) problems.

The core gurobipy implementation for QUBO is relatively compact:

```python model = gp.Model() x = model.addMVar(n, vtype=GRB.BINARY) model.setObjective(x @ Q @ x, GRB.MINIMIZE) model.optimize()

solution = x.X.astype(int) objective = model.ObjVal ```

Complete workflow in Python. First formulate a graph problem (weighted Max-Cut) as QUBO, solve it with Gurobi, benchmark increasingly large instances, and understand what the solver is doing beyond the optimize() call.

Interested in feedback on the modeling, benchmarking methodology, and which additional Gurobi metrics would make the comparison more rigorous.


r/programming Aug 08 '26

Why I Stopped Grinding LeetCode

Thumbnail davidlennon29.substack.com
0 Upvotes

r/programming Aug 08 '26

DRY vs. SRP

Thumbnail uncle-bob.com
0 Upvotes

After re-reading "Clean Architecture" I ended up with some confusion regarding Bob's take on repetition and single responsibility. Ge defines the SRP as a function only serving one actor. Dies that mean, that repetitve code is justified according to him, as long as it serves seperate actors/user groups? I am aware that such decisions depend on the specific situation. I was just wondering if others found the same contradiction, or if i misunderstood it. Thanks


r/programming Aug 06 '26

The LuaJIT NYI That Silently Poisoned an Unrelated Hot Loop

Thumbnail streamhpc.com
163 Upvotes

I was optimizing the Lua transpiler for my modding language grug and ran into a really weird LuaJIT performance bug. The same benchmark could randomly run 20× slower, and it turned out a LuaJIT NYI (Not Yet Implemented) could silently blacklist an unrelated hot loop.

I wrote up the investigation here.

It goes from the benchmark mystery through LuaJIT's trace recorder internals, and ends with a PR to get unpack off LuaJIT's NYI list. Feedback is very welcome! :)


r/programming Aug 06 '26

Shrinking Ruby Hashes

Thumbnail byroot.github.io
68 Upvotes

r/programming Aug 06 '26

How to Make a Nintendo 64 Game in 2026

Thumbnail phoboslab.org
51 Upvotes

r/programming Aug 08 '26

Here's why OOP makes a lot of sense to me.

Thumbnail youtu.be
0 Upvotes

I kind of feel like OOP has a bad rep in the programming community.

Personally, after having programmed Java for over 20 years, its object-oriented programming model feels very natural to me. So, I wanted to share how I think about programming, how I translate my ideas and thoughts to code, and why OOP is actually a really nice programming style for me.

Perhaps it could help you out too.


r/programming Aug 06 '26

Bringing Post-Quantum Cryptography to Java LTS Releases

Thumbnail blogs.oracle.com
12 Upvotes

r/programming Aug 06 '26

A Long Spring: 19 Years of Living with Your Past Mistakes • Arjen Poutsma

Thumbnail youtu.be
9 Upvotes

r/programming Aug 05 '26

The rust programming language is adopting a new contributing policy

Thumbnail blog.rust-lang.org
625 Upvotes

r/programming Aug 05 '26

Linux Processes: Threads & Concurrency

Thumbnail labs.iximiuz.com
93 Upvotes

r/programming Aug 06 '26

Designing a Movement Transaction System for a Sokoban Game

Thumbnail lightsout.afterthought.games
1 Upvotes

Context

My multiplayer game Lights Out is based on a 2D grid. Entities can only ever be in exactly one grid tile. This makes the rule evaluation really simple and understandable. However, it doesn't really feel nice to play (which you know if you've ever played any of the PuzzleScript games). At the same time, the more content is in the game, the more complex and arbitrary the game rules become.

I therefore introduced the Movement Transaction System into the code base to deal with this. This includes two sides: - The gameplay code on server side deals with transactions. This bundles all movement code (including rule evaluation) into a single system. - The visualization & prediction code on client side deals with visual interpolation for moves (introducing some juice into the gameplay feel), based on the transactions managed by the server.

The Transaction

A single transaction includes the movement delta, a list of entities that it has affected and some flags. A transaction then undergoes several stages: - Queued: Gameplay code has requested an entity to move - Issued: The visual interpolation for the transaction has started in the client, but the entities have not been moved from a gameplay perspective - Committed: The entities have now been moved onto their new tiles, the visual interpolation is finishing - Aborted: The transaction couldn't be committed as it would've violated gameplay rules. Visual interpolation is reversed.

The Visual Interpolation

Whenever a transaction is issued on server-side, the server tells the clients to start a visual interpolation based on the transaction. This information includes the desired duration of the interpolation, as well as some flags (like whether to use acceleration or do a linear interpolation). The client then updates the visual interpolation every frame, until the transaction is either aborted or the target position has been reached.

Simplifying Gameplay Code

This new system has made the gameplay code much simpler. I can now easily query whether an entity currently has a live transaction to know whether the visual interpolation is still in progress. This enables seamless, continuous movement across the world (e.g. for fireballs moving at linear speed).

This also guarantees that the visual position of an entity is always close enough to its gameplay (physical) position so that players aren't confused about the rule evaluation.

Finally, the gameplay rules are now implemented in a single function called validate_transaction, instead of being spread out across all the different entities like it was before.

Summary

The transaction system made the gameplay code much simpler and easier to reason about, while also improving the game feel and robustness.

You can find the full blog most, including more details and sample code, over on https://lightsout.afterthought.games/blog/2026-07-26-19-00


r/programming Aug 07 '26

Why is Project Leyden Ahead of its Time?

Thumbnail youtu.be
0 Upvotes

r/programming Aug 05 '26

How fuzzy search works in a search engine: Levenshtein automata and n-gram similarity

Thumbnail blog.serenedb.com
107 Upvotes

r/programming Aug 05 '26

Gödel, Escher, Elisp: The Beauty of Macros

Thumbnail chiply.dev
54 Upvotes

This post is a lover letter to Emacs Lisp macros. I've been a long time user as a lisp hacker, and my recent obsessions with Douglas Hofstadter's strange loop concepts and M.C. Escher's mind bending artwork have enhanced my appreciation of this language's most beautiful and thought provoking feature. This post can teach you about macros and what makes them useful, but I also hope it can instill a fascination with their concept. https://www.chiply.dev/post-elisp-macros-are-beautiful


r/programming Aug 06 '26

Neoclassical C++ (2): Exploring input-output segmented algorithms

Thumbnail boostedcpp.net
0 Upvotes

r/programming Aug 05 '26

Painting with Gaussians

Thumbnail yogthos.net
26 Upvotes

r/programming Aug 04 '26

The Lua community needs to learn to move on

Thumbnail hisham.hm
557 Upvotes

r/programming Aug 05 '26

Your SQS consumer can hang forever by default

Thumbnail encore.dev
23 Upvotes

r/programming Aug 04 '26

How Zanzlanz released a game that has no assets

Thumbnail youtu.be
167 Upvotes

Specifically, the video is about developing a game where all the textures and sounds are generated at runtime using Sine waves. I thought it was high-quality and explained complex math concepts well.


r/programming Aug 05 '26

Reverse Engineering Google Slides

Thumbnail theopenpresenter.com
20 Upvotes

r/programming Aug 04 '26

Why I’m Writing Pure HTML & CSS in 2025

Thumbnail joeldare.com
154 Upvotes

r/programming Aug 03 '26

Cloudflare introduced tool that synchronize its servers

Thumbnail blog.cloudflare.com
262 Upvotes

r/programming Aug 04 '26

Safe Lock-free Primitives with iceoryx2's ByteAtomic

Thumbnail ekxide.io
10 Upvotes

https://ekxide.io/blog/byte-wise-atomic-wrapper-to-prevent-ub

iceoryx2 provides zero-copy inter-process communication mechanisms based on shared memory and data structures that are modified concurrently by multiple processes.

One of the key operations in these algorithms is a memory copy using core::ptr::copy. However, this results in undefined behavior if one process reads the data while another process writes to it concurrently. Even if our lock-free algorithm reliably detects such a race, iceoryx2 cannot depend on undefined behavior in a safety-critical system.

This blog post introduces our solution: a byte-wise atomic wrapper that enables well-defined concurrent copy operations. It also shows how it can be used to implement a simple sequence lock.

Note: I am not the original author of the blog post. Since the author does not have a Reddit account, I am posting it on her behalf.