Posts

Showing posts from January, 2026

SQL Server 2025 NEWS: Enhanced T-SQL Syntax for Query Modularity

Image
Enhanced T-SQL Syntax for Query Modularity One of the most interesting directions for SQL Server 2025 is the evolution of T-SQL towards more modular, readable, and composable queries . The goal is not to replace stored procedures or functions, but to allow developers to structure complex queries into logical blocks , very much like local functions or expressions, while keeping everything inside a single SQL statement. The Problem: Complex Queries Become Hard to Read Consider a simple table: ARTICO ( CODICE INT, DESCR VARCHAR(100) ) Even with a small table like ARTICO , real-world queries often grow in complexity: filters, derived columns, joins, business rules, and conditional logic all accumulate. Traditionally, we rely on deeply nested subqueries or long WITH chains, which quickly become hard to read and maintain. Traditional Approach (Classic CTE) Using today’s T-SQL, we might write: WITH ArticoliFiltrati AS ( SELECT CODICE, DESCR F...

Using Constraint Logic Programming to Formally Optimize 6502/6510 Assembly Code

Image
Introduction This post is an experiment . A first step, a proof of concept, and also a personal exploration. The idea is to start talking not only about SQL Server and Database , but also about Artificial Intelligence , constraint solving , and data-driven reasoning applied to real, concrete technical problems. In this case, the problem comes from an old but fascinating domain: the MOS 6502 / 6510 CPU . Project Overview and Motivation This code represents the first concrete step of a broader project whose goal is to build a code optimizer for the MOS 6502 / 6510 CPU using Constraint Logic Programming , specifically ECLiPSe CLP(FD) . The long-term vision of the project is to explore whether formal constraint-based reasoning can be used to automatically discover provably optimal instruction sequences for real hardware, instead of relying on hand-written heuristics, pattern matching, or empirical benchmarks. Rather than simulating execution or enumerating progra...