编译晚餐
Compiling Dinner

原始链接: https://gist.github.com/breadchris/5877d1ab8381526bb81b551ffd5d1768

## 代码之外:一种新的视角 遵循食谱的行为与计算机执行代码出奇地相似——食材是输入,动作是指令,厨师是处理器。这种类比揭示了食谱*是*一种语言,而烹饪是一种编译形式,涉及解析指令并实现期望的输出。 大型语言模型(LLM)现在正在 democratize 这个过程。 传统上,构建编译器需要专业知识,但 LLM 允许任何人使用纯语言定义规则并快速生成代码来处理它们——从食谱创建购物清单,或优化烹饪时间表。 这种“编译器视角”远远超出了厨房的范围。 锻炼、业务流程,甚至音乐都可以被视为具有潜在语法的程序。 LLM 赋能人们在任何领域探索这些结构,将重点从*构建*完美系统转移到*理解*意图如何转化为行动。 虽然人类判断在定义期望结果(例如,食谱中的速度与营养)方面仍然至关重要,但 LLM 使所有人都可以绘制和试验这些系统。

Hacker News 新闻 | 过去 | 评论 | 提问 | 展示 | 工作 | 提交 登录 编译晚餐 (gist.github.com) 11 分,由 breadchris 发表于 1 天前 | 隐藏 | 过去 | 收藏 | 3 条评论 swiftcoder 1 天前 | 下一个 [–] 即使在 LLM 之前,简单的解析器也很简单。讽刺的是,使用 LLM 编写简单的解析器会失去 LLM 最好的部分:它将自然语言解析成某种结构的能力。将 LLM 本身作为解析器前端似乎更有趣...回复 mpalmer 1 天前 | 上一个 | 下一个 [–] “它不仅仅用于_____,它实际上是_____” 无法摆脱这种被过度使用的 LLM 模式,尤其是在这种情况下,几乎每隔一段就会使用一次。回复 arjvik 1 天前 | 上一个 [–] 这本身就是由 LLM 编写的,对吧?回复 指南 | 常见问题 | 列表 | API | 安全 | 法律 | 申请 YC | 联系 搜索:
相关文章

原文

Compiling Dinner

When you read a recipe, you’re already programming. Ingredients are inputs. Actions—chop, stir, simmer—are instructions. The kitchen is your runtime environment, and you, the cook, are the processor. If you follow the recipe to the letter, you get the expected output: a finished dish. Miss a step, and you’ve introduced a bug. Burn the onions, and you’ve hit a runtime error.

Seen this way, recipes are languages, and cooking is compilation.

Recipes as Grammar

A recipe might say: “Sauté onions in butter until golden.” Even without thinking, you break it down: • Action: sauté • Ingredient: onions • Resource: butter • Condition: until golden

That’s parsing. You’ve taken natural language and structured it into a sequence the kitchen can execute. If you were to formalize it, you could even describe recipes in a simple grammar:

Recipe ::= Ingredients Steps
Step ::= Action Ingredient (Condition)?

The idea isn’t to make cooking robotic. It’s to notice that the same mental steps compilers use to translate source code are happening every time you follow instructions in the real world.

What LLMs Add

Traditionally, building a compiler—even for toy programming languages—required deep expertise and a lot of patience. You had to design the grammar, write the parser, build analyzers, and construct an interpreter. Most people never tried.

But large language models change that. You can describe the rules in plain English—“I want a recipe language where steps look like ‘Bake chicken at 350°F for 40 minutes’”—and the model will sketch out the code to tokenize, parse, and execute it. You can ask for a shopping list generator, and it will show you how to transform recipe text into structured data. You can ask for optimizations, and it will suggest ways to reorder steps so multiple dishes finish at the same time.

It won’t give you a Michelin-starred compiler. But it will give you a sketch, a scaffold. Enough to start playing.

Compilers Everywhere

Once you see cooking this way, you notice the pattern elsewhere. • A workout routine is a program: sets, reps, rest periods—compiled into physical execution. • A business process is a program: approvals, conditions, escalations—compiled into organizational action. • Even music can be compiled: notes into MIDI, instructions into sound.

BNF, the formal notation once reserved for programming languages, becomes a way to articulate structure in any symbolic domain. And LLMs make it easier than ever to draft those grammars and sketch the pipelines that run them.

Why It Matters

This shift matters because it changes who gets to experiment. Before, compilers were a niche reserved for specialists. Now, anyone can sketch one for their domain of interest—food, fitness, finance, music—and immediately see the connections between intent and execution.

It’s not about building perfect systems. It’s about learning to see the world through a compiler’s lens: as layers of grammar, structure, transformation, and action. That literacy makes everyday systems—from recipes to workflows—feel less like mysteries and more like programmable environments.

The Engineer’s Role

LLMs don’t replace rigor. They hand us outlines. It’s still up to humans to decide what values to encode in the compiler. A recipe compiler could optimize for speed, nutrition, or flavor—each choice shaping the output in a different way. A workflow compiler could prioritize efficiency, fairness, or resilience.

But the horizon has shifted. For the first time, you don’t need to be a specialist to imagine a compiler for your corner of the world. You just need to ask: what’s the grammar of this domain, and how do I want to execute it?

Compilers are no longer just for code. They’re for cooking, for coordination, for any place where structured intent becomes action. And with LLMs, sketching them has never been easier.

联系我们 contact @ memedata.com