惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Martin Fowler
Martin Fowler
J
Java Code Geeks
博客园 - 【当耐特】
宝玉的分享
宝玉的分享
腾讯CDC
D
DataBreaches.Net
Microsoft Azure Blog
Microsoft Azure Blog
Engineering at Meta
Engineering at Meta
V
V2EX
F
Fortinet All Blogs
MyScale Blog
MyScale Blog
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
T
Tailwind CSS Blog
Jina AI
Jina AI
GbyAI
GbyAI
大猫的无限游戏
大猫的无限游戏
A
About on SuperTechFans
酷 壳 – CoolShell
酷 壳 – CoolShell
爱范儿
爱范儿
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
U
Unit 42
B
Blog
M
MIT News - Artificial intelligence
N
Netflix TechBlog - Medium

DEV Community

Authentication Security Deep Dive: From Brute Force to Salted Hashing (With Java Examples) Why AI Systems Don’t Fail — They Drift Spilling beans for how i learn for exam😁"Reinforcement Learning Cheat Sheet" I Replaced Chrome with Safari for AI Browser Automation. Here's What Broke (and What Finally Worked) How Python Borrows Other People's Work The $40 Architecture: Processing 1 Billion API Requests with 99.99% Uptime Vibe Coding: A Workflow Guide (From Zero to SaaS) Most webhook security guides protect the wrong side. The scary part is delivery. Headless CMS for TanStack Start: Build a Blog with Cosmic EU Age Verification App "Hacked in 2 Minutes" — What Actually Happened Comfy Cloud’s delete function does not actually remove files Running AI Models on GPU Cloud Servers: A Beginner Guide Event-driven media intelligence with AWS Step Functions and Bedrock I scored 500 AI prompts across 8 quality dimensions — here's what broke How to Call Google Gemini API from Next.js (Free Tier, No Backend Needed) The Portal Protocol: Reclaiming Human Connection in the Age of AI How to Fix Your Team's Scattered Knowledge Problem With a Self-Hosted Forum Intro to tc Cloud Functors: A Graph-First Mental Model for the Modern Cloud Designing Multi-Tenant Backends With Both Ownership and Team Access I Built a Neumorphic CSS Library with 77+ Components — Here's What I Learned PostgreSQL Performance Optimization: Why Connection Pooling Is Critical at Scale Cómo construí un SaaS multi-rubro para gestionar expensas en Argentina con FastAPI + Vue 3 🚀 I Built an Ethical Hacking Scanner Tool – Open Source Project I Replaced /usage and /context in Claude Code With a Single Statusline A Pythonic Way to Handle Emails (IMAP/SMTP) with Auto-Discovery and AI-Ready Design I Collected 8.9 Million Polymarket Price Points — Here's What I Found About How Markets Really Move EcoTrack AI — Carbon Footprint Tracker & Dashboard Everyone's Using AI. No One Agrees How. 5 self-hosted ebook managers worth trying in 2026 Building Your First AI Agent with LangChain: From Chatbot to Autonomous Assistant
Dev Log: The milestone where Build() stops lying
Ernesto Herrera Salinas · 2026-06-21 · via DEV Community

I’m reviving Munchausen, a C# NuGet package I started 9 years ago. This is part 6 of an 8-part series documenting both the development process and the engineering decisions behind bringing the project back to life.

This is the Dev Log: the practical work, cleanup, implementation steps, and day-to-day progress behind this part of the project.

For three milestones, Build() has been a method that throws
NotImplementedException. M5 is where it finally earns its name. This is the compiler: take everything the builder captured, plus everything inference decided, and assemble it into one frozen plan, or fail with a tidy list of every reason it couldn't.

Errors are first-class citizens

While designing Build(), I kept returning to one question: what would make a failed definition easy to fix? My answer was to avoid bare exceptions. Every failure gets a stable code, LIE001 through LIE005 for the v1.0 cases, and Build() collects all of them before throwing. If your definition has a bad expression, a rule conflict, and an empty name, you get one exception listing all
three instead of discovering them one at a time.

I built each diagnostic with a deliberately triggerable test:

  • LIE001: With(c => c.Owner.FirstName, ...) (nested path, illegal target)
  • LIE002: With(...) and Ignore(...) on the same member (contradiction)
  • LIE003: a required member of an interface type (can't be resolved)
  • LIE004: two equally-resolvable constructors, no tiebreaker
  • LIE005: WithName(" ") (empty/whitespace)

There's something satisfying about writing tests whose job is to provoke
failure and then checking that the failure is well labeled. Good error messages
are a feature. Keeping the code registry and expected diagnostic table in sync
through a conformance test makes that feature difficult to erode accidentally.

Recursion, without the headache

The scary part, on paper, was the recursive-type graph. Employee has a Manager that's an Employee; compile that naively, and you recurse forever. My original architecture used a two-phase "allocate empty shells, then fill them" dance.
While implementing it, I found a simpler route: keep a visited set of types and a worklist, and have nested members reference their child by type rather than a direct plan pointer. The runtime looks the plan up in a dictionary later.
Compiling Employee now completes in a single pass and records a friendly LIE009 Info note. The implementation improved the architecture.

The deferral I had to make peace with

Here's the uncomfortable bit. The compiler wants to bind a generator to each inferred member, but the actual generators (the thing that produces "Anthony" for a FirstName) are datasets, and datasets are two milestones away in M7. Classic ordering tension.

The pragmatic answer was to emit a placeholder delegate that throws "bound in M7." Since generation itself is still stubbed, those placeholders are never called, while everything I can verify, the plan structure, constructor choices, diagnostics, and recursive termination, is real. It nagged at me to add deliberate throws, but this let me preserve the milestone boundary without pretending the leaves were finished. I left the IOUs explicit for future-me in M7.

A tooling mystery

This is also the milestone when my beloved dotnet format trick for generating the public API file suddenly stopped working; it complained about a "duplicate source file" and refused to populate anything. I hand-wrote the new exception-type entries instead and moved on, but it bugged me. (Spoiler: I finally diagnosed it in M7, and the fix was embarrassingly simple. Foreshadowing.)

Where it leaves things

Lie.Define<Car>().Build() now works end to end. It returns an immutable
LieDefinition<Car> holding a complete, frozen plan: a constructor choice, every
member's value source, derivations, the reachable child plans, retained
Info/Warning diagnostics. Generate() still throws, there's no runtime, but the
compile is real, validated, and recursion-safe.

What's next

M6: actually running the thing. The generation runtime, lifecycle, cancellation, exception wrapping, depth, and cycle handling. It also forces me to revisit the milestone plan: with the real generators still in M7, what can the runtime honestly produce?