<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Clemens Meier on Medium]]></title>
        <description><![CDATA[Stories by Clemens Meier on Medium]]></description>
        <link>https://medium.com/@clemens-meier?source=rss-2c13bb8cb29e------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*EoBs67fFNWy8HDfCCRjLHw@2x.jpeg</url>
            <title>Stories by Clemens Meier on Medium</title>
            <link>https://medium.com/@clemens-meier?source=rss-2c13bb8cb29e------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 21 Nov 2026 10:14:36 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@clemens-meier/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Spec-Driven Development Gets Your Spec Wrong — Part 1]]></title>
            <link>https://clemens-meier.medium.com/spec-driven-development-gets-your-spec-wrong-part-1-2efd3b641358?source=rss-2c13bb8cb29e------2</link>
            <guid isPermaLink="false">https://medium.com/p/2efd3b641358</guid>
            <category><![CDATA[vibe-coding]]></category>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[compilers]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Clemens Meier]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 12:01:01 GMT</pubDate>
            <atom:updated>2026-09-03T13:21:57.111Z</atom:updated>
            <content:encoded><![CDATA[<h4>Once the intended behaviour has been specified precisely, why ask a probabilistic model to interpret it again — and then test whether that interpretation was correct?</h4><blockquote>In this article, by spec-driven development (SDD) I mean the current AI-oriented workflows in which a natural-language specification is progressively turned into plans, tasks, code, and tests assisted by large language models (LLMs).</blockquote><blockquote><strong>AI disclosure:</strong> I used AI assistance while editing and refining the English in this article. The ideas, arguments, technical concepts, and conclusions are my own.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*pNQkKA_3L9_clnU-jVk9fg.jpeg" /><figcaption>That’s what SDD looks like to me. And I’m quite sure an AI system would represent it in much the same way. This image is AI generated.</figcaption></figure><p>AI has changed software development faster than anything I have seen in my career. A capable coding agent can now turn an idea into working software at astonishing speed.</p><p>But the difficult part often comes later: requirements change, existing behaviour has to be preserved, and we need to know whether the generated software still does exactly what was intended. No matter how fast the code was generated, someone still has to establish that.</p><h4>That makes two old questions more important than ever:</h4><blockquote>What exactly should the software do?</blockquote><p>and</p><blockquote>How do we know that the software actually does exactly that?</blockquote><p>These questions are not new. Software engineers have always filled gaps in requirements, made assumptions, misunderstood intentions and forgotten to update specifications after changing the code.</p><h4>SDD Does Not Close the Semantic Gap</h4><p>Many current AI-oriented SDD workflows resemble the old development process with AI inserted into the translation steps.</p><p>Traditionally, humans would read an incomplete specification, interpret what it probably meant, and turn that interpretation into code.</p><p>AI does the same, but faster and at a much greater scale.</p><p>SDD puts much more emphasis on answering the first question:<br><strong>What exactly should the software do?</strong></p><blockquote>But then, when we are finally satisfied with what the software should do… <br>… we hand the specification to a blazing-fast probabilistic model and ask it to translate the specification into code.</blockquote><p>So the second question remains:</p><p><strong>How do we know that the software actually does exactly what the specification says?</strong></p><p>SDD also tries to address the second through tests, reviews, guardrails and consistency checks, but that is not enough.</p><h4>Why More SDD Artifacts Don’t Close the Gap</h4><p>GitHub Spec Kit and Kiro are examples of current workflows that progressively derive plans or designs and implementation tasks from specifications before generating code.</p><p>A simplified version looks like this: <br>Specification → Plan/Design → Tasks → Implementation</p><p>Modern SDD tools try to control this uncertainty with clarification steps, checklists, consistency analyses, acceptance criteria, reviews and tests. These mechanisms can reduce ambiguity and semantic drift, but they also create more artifacts to generate, inspect and maintain.</p><p>And whenever an LLM transforms one representation into another, it still has to interpret what the previous representation means. That requires additional inference, tokens and computation.</p><p>If the intended behaviour has already been defined precisely, why keep spending effort checking whether repeated interpretations preserve the same meaning? A deterministic translation could preserve that meaning directly.</p><blockquote>The model providers may not mind the extra inference. <br>Our planet and your wallet probably do.</blockquote><h3>How Important Are Specifications Anyway?</h3><p>For any particular piece of behaviour, consider three simplified cases:</p><ul><li>We Don’t Care About the Behaviour</li><li>The Specification Is Incomplete</li><li>The Specification Is Precise</li></ul><p>These cases can coexist within the same application. Some behaviour may be deliberately left open, some may still be underspecified, and some may need to be defined precisely.</p><p>So let’s look at each case in more detail.</p><h4>1. We Don’t Care About the Behaviour</h4><p>Then we can just vibe code.</p><blockquote>“Hey Claude! How are you? Write me a 3D snake game — please— if you have time — or whatever.”</blockquote><p>AI might produce an entertaining 3D snake game. Nobody cares exactly how it works, and perhaps it even becomes the next viral game on the internet.</p><p>There is nothing fundamentally wrong with that.</p><p>Vibe coding can work perfectly well when we are happy to look at the result and decide afterwards whether we like it.</p><p>But would you accept the same approach for software managing transactions in your bank account?</p><blockquote>You cannot expect even the smartest AI to implement exactly what you intended if you never expressed exactly what you intended.</blockquote><p>Humans were never fundamentally better at this. A lot of existing software was “specified” through emails, meetings and conversations — the historical version of vibe coding.</p><p>But for software that increasingly controls our daily lives, the question is no longer simply: <strong>Do we care enough about the behaviour to specify it?</strong></p><p>The difference is scale. AI can now generate software much faster than humans can inspect it, making line-by-line review increasingly unrealistic as the final mechanism for deciding what a system actually does.</p><p>And as AI becomes more capable, this question becomes more important, not less:</p><blockquote><strong>Which decisions are we willing to let AI infer — and which must remain explicitly defined by humans?</strong></blockquote><p>This is ultimately a philosophical question. AI may eventually make many decisions better than we do. But if we also let AI decide what the software should do, humans stop being the authors of that behaviour.</p><p>Software already controls our money, critical infrastructure and even weapons systems.</p><blockquote>At some point, the question is no longer whether AI can implement our decisions. It is whether we still want the decisions to be ours.</blockquote><p>And:</p><blockquote>If we decide that we no longer need to know exactly what such software is supposed to do, we are not merely delegating programming — we are delegating the decisions themselves.</blockquote><p><strong>That </strong>is why I strongly believe <strong>specifications matter more than ever.</strong></p><h4>2. The Specification Is Incomplete</h4><p>Then somebody has to decide what the missing behaviour should be.</p><p>A junior developer may make that decision. An AI system can make that decision too — perhaps even better in some cases.</p><p>But it is still a guess.</p><p>And then someone has to check what was generated.<br>But against what can it be checked?</p><blockquote>We cannot establish that software matches an intended business behaviour that was never defined.</blockquote><p>So during implementation, missing behaviour often ends up being defined through tests written by the developer — human or AI.</p><p>I have seen many tests that clearly state what the system should do, but nobody can point to the business specification from which that behaviour was derived.</p><p>In many SDD workflows, tests and guardrails have quietly become part of the specification — hidden inside technical artifacts that the domain expert responsible for the behaviour may never read.</p><blockquote>When the specification is incomplete, tests can become an accidental hidden specification.</blockquote><h4>3. The Specification Is Precise</h4><p>Now the situation changes.</p><p>If the specification precisely defines the required behaviour, then the implementation has one primary obligation:</p><p><strong>Conform to the behaviour defined by the specification.</strong></p><p>There may still be many valid implementations. The specification can define the functional behaviour and domain data structures, while leaving technical implementation choices open — for example which sorting algorithm to use, how persistence is realised, or how the user interface is rendered. Non-functional requirements can further constrain those choices through measurable goals such as performance.</p><p>But most current AI development workflows still ask an LLM to interpret that specification and generate the implementation.</p><p>And because we do not fully trust that translation, we add tests, reviews and guardrails to check whether the generated business behaviour still matches what we intended — much as we do when humans write the code.</p><p>Tests, reviews and guardrails are still valuable for catching regressions, integration failures and measurable technical problems. Here, however, I am specifically talking about tests whose purpose is to check whether the business code behaves as specified.</p><p>That raises another question:</p><blockquote><strong>Who or what verifies that the tests themselves express what the specification says?</strong></blockquote><p>When implementation and tests are independently derived from the specification, agreement between them does not by itself establish conformance to the specification. We would still need to know that both derivations preserve its meaning correctly.</p><p>In other words, agreement between implementation and tests is not the same as demonstrated conformance to the specification.</p><p>I call this <strong><em>unverified verification.</em></strong></p><p>This leads to a simple conclusion:</p><blockquote>If the specification already defines the intended behaviour precisely, there should be nothing left to interpret.</blockquote><p>By “precisely” I do not mean merely well-written natural language. I mean that the relevant statements are expressed in a language whose valid constructs have defined semantics, so that the same statement cannot legitimately acquire a different meaning during implementation.</p><p>Any valid implementation should <strong>preserve that meaning</strong>.</p><p>So why do we ask an LLM to reinterpret the specification into code — and then build tests, reviews and guardrails to check whether that interpretation was correct?</p><blockquote>At that point, interpretation is no longer a strength.</blockquote><blockquote>It is the problem.</blockquote><ul><li><strong>If the specification leaves a required decision unspecified, someone has to guess— the human or the model.</strong></li><li><strong>If the specification defines the required behaviour exactly, there is nothing left to guess.</strong></li></ul><p>That is the semantic gap that current AI-oriented SDD still has to bridge.</p><h3>Can We Make Probabilistic Translation Reliable Enough?</h3><h4><strong>What about reviews?</strong></h4><p>Human or AI review can reduce risk by checking traceability, contradictions and observable behaviour. But review cannot create an authoritative meaning that the specification itself does not define.</p><h4>What About Better AI?</h4><p>Some people have already asked me: <br><strong>“But what if future AI becomes completely deterministic?”</strong></p><p>Determinism does not solve ambiguity. If a specification leaves room for interpretation, there may be no single correct interpretation to find.</p><p>Current AI-oriented SDD still depends on sufficiently capable agents, combined with validation and guardrails, to make specification-to-code translation reliable enough in practice.</p><p>The real problem is not merely the quality of the translation.</p><p>Ordinary natural language does not come with formally defined semantics that assign each well-formed statement a precisely defined meaning. A deterministic translator cannot preserve a meaning that was never formally defined in the first place.</p><p>Once the specification is expressed in a language with formally defined semantics, however, there is no need for an LLM to infer what it means.</p><blockquote>To translate a language with formally defined semantics, we already have a technology. It is called a compiler.</blockquote><p>A compiler does not make the trust problem disappear. The compiler toolchain itself must be trusted to preserve the semantics defined by the language. But that is a fundamentally different problem from repeatedly asking a probabilistic model to infer the meaning of each specification.</p><p><strong>LLMs are good at interpreting ambiguity. <br>Compilers are good at preserving defined meaning.</strong></p><blockquote>Once a specification gives the required behaviour a precisely defined meaning, probabilistic interpretation is the wrong semantic bridge.</blockquote><p>Better LLMs alone cannot remove this semantic gap.</p><blockquote>If we can define behaviour precisely, why ask AI to guess what it means again?</blockquote><h3>What Should AI Decide?</h3><p>There is a big difference between:</p><blockquote><strong><em>what </em></strong><em>behaviour the system must guarantee</em></blockquote><p>and</p><blockquote><strong><em>how </em></strong><em>that behaviour is implemented.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/1*CDlv2aEm5gpBOTmfOavvVA.jpeg" /><figcaption>What decisions should we leave to AI? - This image is AI generated.</figcaption></figure><p>Functional requirements define the behaviour of the system: its business rules, decisions and state transitions. If that behaviour matters, it should have precise semantics.</p><p>The technical implementation can remain open. Persistence, integration, deployment and even UI rendering can be designed and implemented in many different ways by AI, humans or other tools.</p><p>Non-functional requirements can constrain those implementation choices through measurable goals such as performance, availability, durability, technical security properties or cost.</p><p>Open implementation choices do not imply unrestricted or unreviewed AI generation. Some areas — especially security-critical infrastructure — may require stricter constraints, specialist review, approved components or independent verification.</p><p>What matters is that the requirements define the guarantees the infrastructure has to provide without unnecessarily prescribing how it provides them.</p><p>If an account balance must survive a restart, that durability requirement tells the infrastructure what it must guarantee. Whether it is realised with PostgreSQL, an event store or something else remains an implementation decision.</p><p>If only a certain role may approve a payment, that authorization rule defines required behaviour. Whether it is enforced through an identity provider, signed claims, access-control policies or another authorization mechanism remains an implementation decision.</p><p>The same distinction applies to the user interface. How an interface looks and is rendered can remain an implementation choice. But how application state changes in response to a user action is functional behaviour and therefore belongs to the specification.</p><p><strong>Functional behaviour is specified semantically. Infrastructure is constrained by the guarantees and measurable goals it has to satisfy.</strong></p><p>So the boundary is not between software that AI may or may not write. It is between decisions that have already been made and implementation choices that remain open.</p><blockquote>AI is extremely useful for finding good ways to implement the guarantees that have already been defined, but we do not have to leave those guarantees themselves for AI to decide.</blockquote><h3>Does the Right Architecture Solve It?</h3><p>Clean Architecture, Onion Architecture, and Hexagonal Architecture already separate business behaviour from technological mechanisms.</p><p>That is exactly the boundary we need for AI:</p><blockquote>Required behaviour should not be reinterpreted, while the surrounding technical implementation can remain flexible within its defined constraints.</blockquote><p>AI can be very effective at implementing infrastructure around a protected business core. And the source code itself can serve as the specification — but that comes with an important consequence:</p><blockquote>That source code has become the only source of truth for that behaviour.</blockquote><p>That is not necessarily a problem if the person responsible for the business behaviour can understand the complete implementation well enough to review it directly.</p><p>But that knowledge is then closely tied to the people who understand the implementation. If they leave, the organisation may be left with code that still runs, but without a clear shared understanding of why it behaves the way it does.</p><p>An LLM can of course explain the code to the next person. But that explanation is again a probabilistic interpretation of the implementation. It may help us understand the code, but it does not give us an authoritative statement of what the software is supposed to do.</p><p>And once the people who define or approve the behaviour cannot reliably understand the implementation, we need another representation they can review.</p><p>Then we are back to maintaining two representations of the same behaviour — specification and code — and the original problem returns:</p><blockquote>How do we know that the code still behaves exactly as the specification requires?</blockquote><h3>What If We Compile Specifications?</h3><p>What if the specification could be written in constrained, natural-language-like sentences that domain experts can read without learning a modelling notation — and still compile directly?</p><p>Not ordinary English. Natural language depends heavily on context. In a face-to-face conversation with a domain expert, we can ask questions, notice uncertainty and clarify what was meant. Written requirements often lose much of that context.</p><p>And many perfectly normal words are simply not precise enough to compile. What is a “large” withdrawal? $1,000? $10,000? Half of the account balance? Humans can use words like “large”, “recent” or “significant” without defining their exact boundaries. An LLM might just guess. A compiler cannot.</p><blockquote>A specification needs definitions, not impressions.</blockquote><blockquote>And so does a compiler.</blockquote><p>In his 1978 note on “natural language programming”, Dijkstra argued against replacing the precision of formal symbolism with unrestricted natural language.</p><p>But natural language can be restricted to a defined vocabulary and grammar, with formally defined semantics for every well-formed construct. Controlled natural languages such as <a href="https://attempto.ifi.uzh.ch/site/pubs/papers/doctoral_thesis_kuhn.pdf">Attempto Controlled English</a> have explored this idea for decades.</p><p>A recurring challenge for controlled natural languages has been usability. A language that looks like English invites people to write ordinary English — only for the compiler to reject perfectly understandable sentences. This mismatch between apparent familiarity and actual grammatical restrictions can be frustrating.</p><p>This is where LLMs change the equation.</p><p>Formal semantics are not new. But LLMs may make formally constrained languages much more practical to use, because humans do not need to learn every syntactic restriction before expressing their intent.</p><p>An LLM can help translate fuzzy human intent into valid controlled language. But it does not get the final say. The developer or domain expert reads the precise result and decides whether it expresses what was intended.</p><blockquote>The LLM may propose the specification. It does not decide the required behaviour, and it does not define the language semantics.</blockquote><p>Once that precise form has been accepted, probabilistic interpretation should stop for the behaviour it defines.</p><blockquote>The specification becomes the authoritative source for the business behaviour it defines — a shared language between the people who define that behaviour and the people who implement the system.</blockquote><h3>Can Compiled Specifications Reduce the Verification Burden?</h3><p>Tests can show that an implementation behaves as the tests expect, but not necessarily that it conforms to the specification — unless the tests themselves are known to represent that specification correctly.</p><p>If the specification is executable and deterministically translated, that extra correspondence no longer has to be reconstructed through independently written tests, reviews and guardrails — provided that the compiler toolchain can be trusted to preserve the language semantics.</p><p>For high-assurance systems, that trust can go beyond testing: projects such as CompCert demonstrate that semantic preservation can be formally and machine-checked.</p><p>Tests still matter for integration, measurable technical requirements and validating whether the specification expresses the intended behaviour.</p><p>But:</p><blockquote>Tests no longer need to compensate for a probabilistic translation of already-defined business behaviour.</blockquote><h3>Conclusion</h3><p>AI has made software generation dramatically faster. That makes it even more important to know which decisions we are delegating and which ones we are not.</p><p>If behaviour matters enough to specify precisely, we should not ask a probabilistic model to rediscover its meaning every time we implement it.</p><p>The principle is simple:</p><blockquote><em>Let AI interpret what is still open.<br>Compile what has already been decided.</em></blockquote><p>The challenge is not inventing executable specifications. They have existed for decades.</p><p>The challenge is making them practical enough for everyday software development: precise enough to compile, natural enough to read, and easy enough to write with AI assistance.</p><p>That is the idea I want to explore next with SPEX: a controlled natural language that compiles specifications into an executable business core.</p><p>If you disagree, think I am missing something, or have run into the same problem, leave a comment or send me a message.</p><blockquote>In <a href="https://medium.com/@qfzpbztvg/804903d775db">Part </a>2, I introduce SPEX as a concrete implementation of that idea:<br><a href="https://medium.com/@qfzpbztvg/804903d775db">SPEX: Executable Specifications for AI-Assisted Development — Part </a>2</blockquote><p>References:<br><a href="https://github.github.com/spec-kit/">GitHub Spec Kit — Documentation</a><br><a href="https://kiro.dev/docs/specs/quick-spec">Kiro Specs — Documentation</a><br><a href="https://thoughtworks.medium.com/spec-driven-development-d85995a81387">Thoughtworks — Spec-driven development. Unpacking one of 2025’s key new engineering practices</a><br><a href="https://medium.com/activated-thinker/spec-driven-development-isnt-broken-it-will-collapse-c00609f72496">Kapil Viren Ahuja — Spec-Driven Development Isn’t Broken. It will collapse</a>.<br><a href="https://attempto.ifi.uzh.ch/site/">Attempto project resources</a><br><a href="http://compcert%20documentation/">CompCert documentation</a><br><a href="https://www.cs.utexas.edu/~EWD/transcriptions/EWD06xx/EWD667.html">E.W.Dijkstra Archive: On the foolishness of “natural language programming”. (EWD 667)</a><br><a href="https://www.thoughtworks.com/insights/blog/programming-languages/should-still-design-code-humans">Valentina Servile — Should we still design code for humans?</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2efd3b641358" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[SPEX: Executable Specifications for AI-Assisted Development— Part 2]]></title>
            <link>https://clemens-meier.medium.com/spex-executable-specifications-for-ai-assisted-development-part-2-804903d775db?source=rss-2c13bb8cb29e------2</link>
            <guid isPermaLink="false">https://medium.com/p/804903d775db</guid>
            <category><![CDATA[spec-driven-development]]></category>
            <category><![CDATA[software-architecture]]></category>
            <category><![CDATA[compilers]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[software-engineering]]></category>
            <dc:creator><![CDATA[Clemens Meier]]></dc:creator>
            <pubDate>Wed, 26 Aug 2026 12:01:01 GMT</pubDate>
            <atom:updated>2026-08-27T09:16:49.596Z</atom:updated>
            <content:encoded><![CDATA[<h4>SPEX: A Specification Language, a Compiler, and a New AI Development Workflow</h4><blockquote><strong>AI disclosure:</strong> I used AI assistance while editing and refining the English in this article. The ideas, arguments, technical concepts, and conclusions are my own.</blockquote><p>At OST — Eastern Switzerland University of Applied Sciences — we are working on a research project that explores an alternative approach to AI-assisted software development.</p><p>We call it <strong>SPEX </strong>— executable specifications.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ZLYNXlJm1MLCH7k_7zmcoA.jpeg" /><figcaption>This image is AI generated.</figcaption></figure><p>The problem SPEX addresses is this: current AI-oriented spec-driven development can improve requirements elicitation, structure and traceability, but it still relies on probabilistic translation between specification and implementation.</p><p>SPEX explores whether the functional core of an application can instead be expressed in a readable language with formally defined semantics and compiled directly into production behaviour.</p><p>AI may help turn ambiguous human intent into a precise specification.</p><p>But here is the key idea:</p><blockquote>Once the behaviour has been defined precisely, there is no reason to ask AI to guess it again.</blockquote><p>This applies to the functional business core covered by SPEX. Infrastructure, persistence, integration, rendering, and other implementation choices remain outside that deterministic boundary and can still be implemented by AI or conventional software engineering.</p><blockquote>Read <a href="https://medium.com/@clemens-meier/spec-driven-development-gets-your-spec-wrong-part-1-2efd3b641358">Part 1</a> for the reasoning behind that approach:<br><a href="https://medium.com/@clemens-meier/spec-driven-development-gets-your-spec-wrong-part-1-2efd3b641358">Spec-Driven Development Gets Your Spec Wrong — Part 1</a></blockquote><h4>A DSL in Controlled Natural English</h4><p>SPEX is a domain-specific language designed to <strong>read </strong>like natural English.</p><p>Its purpose is to provide a<strong> common language</strong> for domain experts and software developers:</p><blockquote>Readable enough for people without a programming background, but restricted enough that every valid construct has defined semantics.</blockquote><p>A valid SPEX specification can therefore be translated deterministically into executable business behaviour.</p><p>SPEX is embedded in Markdown, so specifications can be stored, reviewed and versioned using ordinary documentation tools and source repositories.</p><h4>Compiler and Specification Tooling</h4><p>The SPEX compiler translates a valid specification into an executable business core.</p><p>The compiler toolchain is designed to detect syntax and type errors, invalid references, incomplete constructs, and classes of missing or contradictory cases that can be determined from the language semantics. It can also suggest examples or questions that may help uncover missing business requirements.</p><p>Where deterministic tooling cannot safely derive a valid formulation, an LLM may be used to propose a reformulation in SPEX.</p><p>The important boundary is:</p><blockquote>An LLM may help create or refine a specification, but it does not determine the meaning of a domain-approved SPEX statement. That meaning is defined by the language semantics.</blockquote><h4>Specification Loop</h4><p>SPEX supports an iterative specification workflow.</p><p>An author may begin with ordinary, potentially ambiguous natural language. Where possible, deterministic tooling can transform or suggest valid SPEX directly. Where more interpretation is required, an LLM can propose one or more SPEX formulations.</p><p>The developer or domain expert then reviews the resulting SPEX statement and decides whether it expresses the intended behaviour.</p><p>The LLM may also act as a discussion partner by asking clarification questions, identifying possible missing cases, suggesting examples or drafting larger parts of a specification.</p><p>However, anything inferred or invented by the LLM remains <strong>unapproved </strong>until a human accepts it.</p><p>This creates a deliberate boundary between probabilistic interpretation and deterministic semantics:</p><blockquote>AI may assist before the specification is accepted. Once accepted, the meaning of the specification is no longer inferred by AI.</blockquote><p>The accepted SPEX statement remains in the source repository as the authoritative representation of that behaviour; it is not merely an intermediate prompt or generation artifact.</p><h4>Domain Approval and Traceability</h4><p>Individual rules or other parts of a SPEX specification can be assigned an approval state.</p><p>Once the responsible domain expert confirms that a rule expresses the intended business behaviour, that rule can be marked as domain-approved.</p><p>If domain-approved behaviour is changed, its approval is invalidated and the changed behaviour must be reviewed again.</p><p><strong>Unapproved </strong>parts may remain editable by developers or AI agents during development. This allows SPEX to distinguish explicitly between:</p><ul><li>behaviour proposed by an AI or developer;</li><li>behaviour reviewed by a software developer;</li><li>behaviour explicitly accepted by the domain expert responsible for defining it.</li></ul><p>These states are part of the development workflow rather than comments on the side. They make it explicit which behaviour is still being proposed or explored and which behaviour has become an authoritative requirement that should not be changed without renewed domain approval.</p><p>For high-assurance systems, the goal is that all behaviour considered business-critical ultimately reaches the appropriate domain-approved state.</p><h4>Infrastructure Agnosticism</h4><p>I want to quote one of my favorite lines from my former boss, Luc Bläser, who planted the seeds for SPEX in my head:</p><blockquote>Did you ever think about which core your thread is running on?<br>Why are you coding HTTP requests?<br>Why are you writing persistence code?<br>Why are you deciding where a piece of code runs?</blockquote><p>All of this should be taken care of automatically.<br>We are not quite there yet — but AI can take care of most of it.</p><p>Strip away the infrastructure, and most application code is either a type or data structure definition, an algorithm, or a specification of behaviour.</p><p>SPEX specifies <strong>required system behaviour</strong>, not the technical mechanisms used to implement that behaviour.</p><p>SPEX therefore does not directly open files, access databases, make HTTP calls, create threads or invoke framework-specific APIs.</p><p>This restriction is deliberate.</p><p>A SPEX specification defines what the system must guarantee. It does not prescribe which database, framework, communication protocol or infrastructure technology must be used to provide that guarantee.</p><h4>Infrastructure Implementation</h4><p>Infrastructure is connected to the SPEX-generated business core from the outside.</p><p>Human developers or AI agents can implement persistence, communication, user-interface rendering, and other technical mechanisms against interfaces and contracts derived from the specified behaviour.</p><p>For example, SPEX may define that the system remembers an Account. This means that the Account forms part of system state and must remain available to later behaviour for the lifetime defined by the specification. SPEX does not prescribe how that state is stored.</p><p>If state must survive a restart or failure, that durability requirement must be specified explicitly and satisfied by the infrastructure.</p><p>The same principle applies to other technical concerns. Requirements such as latency, availability, technical security properties, deployment constraints or resource limits can be stated and measured separately without becoming part of SPEX’s executable business semantics.</p><p>This produces two complementary forms of automated system validation:</p><ul><li><strong>Behavioural validation:</strong> examples derived from or written alongside the SPEX specification can be executed against the integrated system to check that infrastructure preserves the behaviour defined by SPEX.</li><li><strong>Technical validation:</strong> measurable implementation requirements such as performance, availability or security constraints can be tested directly against the running system.</li></ul><h4>The Key Architectural Principle of SPEX</h4><p>SPEX defines the functional behaviour whose meaning must be precise and compiles that behaviour deterministically into the production business core. AI and conventional software engineering remain useful before this semantic boundary and for implementation choices outside it, as long as the surrounding infrastructure preserves the behaviour and guarantees defined by SPEX.</p><p>This does not eliminate validation, integration testing or the need to establish separately that the compiler and runtime preserve the defined SPEX semantics. It aims to remove one specific source of semantic drift: probabilistic reinterpretation of business behaviour that has already been defined precisely.</p><p>SPEX is therefore not intended primarily as a separate model against which another business implementation is checked. For the behaviour covered by SPEX, the accepted specification is intended to be the source language of the production business core itself.</p><p>This includes not only decisions and calculations, but also typed domain concepts, events, state and state transitions. The generated core exposes contracts to the surrounding infrastructure, while persistence, communication, rendering and other technical mechanisms remain outside it.</p><p>The SPEX source remains the authoritative representation of that behaviour. AI may help humans author and refine it, but accepted statements are retained, versioned and compiled rather than regenerated from natural-language requirements whenever the software changes.</p><h3>Language Features</h3><p>SPEX is still under development. The current prototype implements only part of the language, but the following examples illustrate some of the concepts we are exploring.</p><h4>Terms:</h4><p>Terms define domain concepts, their structure and their constraints. They effectively form SPEX’s type system from the specification perspective.</p><p>Primitive values can carry semantic constraints:</p><pre>## Terms<br><br>- Money is a Decimal Number with at most 2 decimal places.<br>- Dollars is Money with prefix &quot;$&quot;.</pre><p>Domain concepts can be composed from other terms, constrained, and expressed as alternatives:</p><pre>## Terms<br><br>- A Customer has an Account.<br>- An Account has a Balance of Dollars.<br><br>- A Withdrawal Request has a Customer<br>  and a Requested Amount of Dollars greater than zero.<br><br>- An Outcome is either successful or declined.<br>- A Withdrawal has an Outcome and a Balance of Dollars.</pre><p>The language is intended to support strongly typed domain concepts, relationships, constraints and alternatives while keeping their representation readable to domain experts. Relationship words such as has have precisely defined cardinality semantics in SPEX rather than relying on ordinary-English interpretation.</p><h4>Rules:</h4><p>Rules define behaviour.</p><p>Structured input is evaluated according to explicit business rules and produces a defined result.</p><pre>## Rules</pre><pre><br>When a Withdrawal Request occurs, the result is a Withdrawal:</pre><pre>- Provided that<br>    its Requested Amount does not exceed<br>    the Customer&#39;s Account&#39;s Balance:</pre><pre>  - The resulting Outcome is successful.<br>  - The resulting Balance is the Customer&#39;s Account&#39;s Balance minus its Requested Amount.</pre><pre>- Otherwise:</pre><pre>  - The resulting Outcome is declined.<br>  - The resulting Balance is the Customer&#39;s Account&#39;s Balance.</pre><pre>- The Customer&#39;s Account&#39;s Balance becomes the resulting Balance.</pre><p>Conditions such as Provided that and Otherwise define explicit branches whose meaning is determined by the language rather than inferred by an LLM.</p><p>The planned keyword becomes expresses a <strong>state transition</strong>: it defines how system state changes as a consequence of a rule without defining how that state change is persisted technically.</p><h4>State:</h4><p>State is part of observable system behaviour and can therefore also be specified explicitly:</p><pre>- The System remembers an Account.</pre><p>This means that an Account forms part of the system state and can be used by later behaviour.</p><p>The same model can apply to both long-lived state, such as persistent business data, and short-lived state, such as the state of a user interface.</p><p>The keyword becomes defines an atomic state transition: either all resulting state changes take effect or none do. For the current runtime model, the compiler generates the locking and concurrency control required to evaluate such transitions against a consistent current state. The infrastructure only needs to commit the resulting transition and report whether that commit succeeded.</p><p>The infrastructure implementing that state transition must preserve this guarantee.</p><h4>Examples:</h4><p>Examples serve a different purpose from tests whose purpose is to check whether an LLM correctly translated a specification.</p><p>Because SPEX business behaviour is compiled deterministically, examples are primarily used to check whether the specification itself expresses the intended behaviour.</p><p>Inspired by Gherkin and Cucumber, SPEX uses its own typed example syntax. An example may look like this:</p><pre>  Scenario: Successful withdrawal within balance<br>    Alice is a Customer<br>    Given Alice&#39;s Account&#39;s Balance is $234.56<br>    When a Withdrawal Request occurs<br>      whose Customer is Alice<br>      and whose Requested Amount is $200.00<br>    Then the Withdrawal&#39;s Outcome is successful<br>    And the Withdrawal&#39;s Balance is $34.56<br>    And the Account&#39;s Balance is $34.56<br><br>  Scenario: Declined withdrawal exceeding balance<br>    Hamza is a Customer<br>    Given Hamza&#39;s Account&#39;s Balance is $100.00<br>    When a Withdrawal Request occurs<br>      whose Customer is Hamza<br>      and whose Requested Amount is $150.00<br>    Then the Withdrawal&#39;s Outcome is declined<br>    And the Withdrawal&#39;s Balance is $100.00<br>    And the Account&#39;s Balance is $100.00</pre><p>Type declarations such as Alice is a Customer are part of SPEX and are required so that examples can be type-checked like the rest of the specification.</p><p>Examples are compiled and evaluated using the same semantics as the specification. Their purpose is to validate the intended behaviour, not to establish correctness of the compiler itself.</p><p>If an example does not produce its expected result, either the specification or the example must be corrected.</p><p>The same examples can later be executed against the integrated application to check that persistence, communication, user-interface code and other infrastructure still preserve the behaviour defined by SPEX.</p><p><strong>More Concepts:<br></strong>The broader SPEX design is intended to include additional typed domain constructs such as relationships and cardinalities, constrained numbers and units, dates and time, alternatives, <strong>derived values, preconditions and postconditions</strong>, workflows, events and state transitions. <strong>The same approach can also be applied to behavioural user-interface state.</strong> These constructs follow the same principle: their syntax remains business-readable while their semantics are defined by the language rather than inferred by an LLM.</p><p>The current prototype compiles SPEX business behaviour into TypeScript that is intended to serve directly as the application’s production business core, together with executable examples. Other target languages or representations could be supported by replacing only the final code-generation stage of the compiler. The architectural principle remains the same: the specified behaviour is compiled rather than independently reimplemented.</p><h3>Potential Benefits of SPEX</h3><h4>Better Specifications</h4><p>If SPEX can become a common language between developers and domain experts, it could reduce misunderstandings and make specified behaviour directly reviewable by the people responsible for it.</p><p>Whether domain experts can actually read and review SPEX efficiently is one of the key questions we still need to validate.</p><h4>Faster and Cheaper Development</h4><p>Once behaviour is expressed as valid SPEX, generating the executable business core becomes a compiler task.</p><p>There is no need to repeatedly regenerate the same business logic with an LLM. And provided that the compiler toolchain can be trusted to preserve SPEX semantics, application-level tests no longer need to duplicate business rules merely to check whether generated business code still matches the specification.</p><p>This could reduce development time, maintenance effort and inference cost.</p><h4>Less LLM Inference</h4><p>Domain-approved behaviour no longer needs to be repeatedly interpreted by a large language model.</p><p>The compiler performs that translation directly, while the LLM can concentrate on tasks where interpretation is useful: helping formulate SPEX, resolving unclear input and implementing infrastructure around the compiled business core.</p><p>This should require substantially less computation and may allow smaller models to handle a larger part of the development process. The actual energy and cost savings still need to be measured.</p><h4>Privacy and Digital Sovereignty</h4><p>If specification assistance and infrastructure generation can increasingly be handled by local or on-premise models, both source code and sensitive business rules can remain within the organisation.</p><p>That could improve confidentiality and reduce dependence on frontier-model providers such as Anthropic or OpenAI.</p><h3>What’s the Future of SPEX?</h3><p>SPEX is still a small research project. We have a working language concept and compiler prototype, but there is a large difference between proving that an idea works and building a language and toolchain that companies can trust for real software.</p><p>SPEX explores whether a domain-expert-readable, domain-approved specification can serve directly as the source language for the production business core — eliminating a separately interpreted or generated implementation for precisely specified behaviour, while leaving the surrounding technical implementation open to AI.</p><p>The next step is to test SPEX on realistic projects: whether domain experts can efficiently review and approve the specifications, and whether SPEX actually reduces ambiguity, development effort and LLM usage.</p><p><strong>If the results are positive</strong>, our intention is to develop SPEX as an open-source language and ecosystem.</p><p>The principle is simple:</p><blockquote><strong>Let AI interpret what is still open.<br>Compile what has already been decided.</strong></blockquote><blockquote>And if we can specify exactly how the software should behave:<br>Why should we ever ask an AI to guess again?</blockquote><p>If this idea resonates with you, challenge it, try it, contribute to it, help us test it on real software — or <strong>help fund the next step</strong>.</p><p>Leave a comment or send me a message. And don’t forget to clap!</p><p>References:<br><a href="https://github.com/cmeierost/spex">SPEX — GitHub Repository</a> (Brainstorming about SPEX)<br><a href="https://cucumber.io/docs/gherkin/reference/">Cucumber — Gherkin Reference</a><br><a href="https://attempto.ifi.uzh.ch/site/">Attempto Controlled English — Project Resources</a></p><p>Related Work and Similar Approaches:</p><p>SPEX is not the first approach to making software behaviour precise, executable or model-driven. Related ideas exist in business-rule systems, executable process models, formal methods, model-driven engineering, domain-specific languages and language workbenches. <br>SPEX explores a particular combination of these ideas for AI-assisted development: a domain-readable source language with defined semantics that compiles directly into the production business core.</p><p><a href="https://www.robenglander.com/writing/cse-compiling-intent">Robert Englander — “Conversational Software Engineering: Compiling Intent” — 2026</a><br>Conversational Software Engineering explores a closely related workflow in which human intent is progressively transformed into structured specifications, validated artifacts, tests and implementations. It also draws a clear boundary between probabilistic AI assistance and deterministic validation.</p><p><a href="https://quint.sh/">Quint — Executable Specifications</a><br>Quint is a formal executable specification language for modelling and verifying system behaviour. Specifications can be simulated, model-checked and used for model-based testing, while the production implementation remains separate.</p><p><a href="https://www.ijcai.org/proceedings/2024/0685.pdf">NL2ASP</a> — Natural Language to Answer Set Programs through Controlled Natural Language<br>NL2ASP uses probabilistic language translation to transform natural language into a controlled intermediate language, followed by deterministic translation into Answer Set Programs. This is closely related to SPEX’s idea of using AI before a formal boundary and deterministic tooling after it.</p><p><a href="https://github.com/ymm-oss">FSL AI-Native Formal Specification Lanugage</a><br>FSL combines AI-assisted specification authoring with deterministic formal verification, including techniques such as SMT solving, bounded model checking and refinement. Humans confirm that the generated specifications capture the intended business rules, while implementation conformance can be checked separately.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=804903d775db" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Native JavaScript Signals are Coming: But are They Good Enough?]]></title>
            <link>https://clemens-meier.medium.com/native-javascript-signals-are-coming-but-are-they-good-enough-341809916630?source=rss-2c13bb8cb29e------2</link>
            <guid isPermaLink="false">https://medium.com/p/341809916630</guid>
            <category><![CDATA[reactive-programming]]></category>
            <category><![CDATA[tc39]]></category>
            <category><![CDATA[signal]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Clemens Meier]]></dc:creator>
            <pubDate>Fri, 26 Jul 2024 09:47:32 GMT</pubDate>
            <atom:updated>2024-07-31T06:40:14.844Z</atom:updated>
            <content:encoded><![CDATA[<p>It looks like finally integrated Signals have almost reached the JavaScript world. No need to reimplement the “<em>Modern Observer Pattern</em>” in an unfinished way over and over again! :)</p><p><a href="https://github.com/tc39/proposal-signals">TC39 Proposal for Signals</a>: A proposal to add signals to JavaScript.</p><h3>My attempt to explain a signal in a few sentences:</h3><p>A <strong>signal</strong> is a value, that can change over time. Like with a plain old observer pattern, we can subscribe handlers, that are called every time the value of the <strong>signal </strong>changes. But <strong>signals</strong> are also notifying a global context, when they are read.</p><p>Functions that notify that context when they are running, are called effects. They are automatically subscribed to the signals, that are read during the runtime of that effect. Automatically subscribing the effect to all signals read during its execution, makes it run again, if the value of a read signal changes.</p><p>A <strong>computed</strong> works similar to an <strong>effect, but </strong>returns a value. That value is stored in an encapsulated <strong>signal</strong>, that holds the return value of the last execution of the <strong>computed</strong>. We can subscribe to a computed, like we can subscribe to a signal.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MxfY2ZpT6v09WTBcWuTZUg.jpeg" /><figcaption>ChatGPT: Fragwoms, Repact, Recact, SolictJS ;)</figcaption></figure><p>The reactive concepts <strong>Signals</strong>, <strong>Computed</strong> and <strong>Effects</strong> make fine-grained re-renders of UI components (and other things) possible without having to write a 1000 lines of code over and over again.</p><h3>Back to the Proposal</h3><p>So a TC39 Proposal wants to integrate signals into the ECMA Script standard, which i strongly support. It makes no sense at all, that the same thing is written over and over again.</p><p>I know a standard like ECMAScript can’t change over night. It is a very heavy lift to introduce a new concept into JavaScript and doing it right. So no offense to the people that started the TC39 signal proposal. They are doing a great job! And criticizing is easy without offering a working solution and that’s obviously what i am doing in the rest of this article. So please don’t feel offended. I am sharing my thoughts and i am not saying, that i can write a better proposal.</p><h3><strong>Lets get to the point:</strong></h3><p>I am a bit <strong>worried</strong> about the proposed API. Or should I just say “disappointed”?</p><p><strong>That API won’t help us with old code.</strong></p><p>If we want to use signals in our old code, it is all about being able to place a <strong>signal</strong> where we normally place a <strong>primitive</strong> <strong>value</strong>. A string, a number, a boolean. Period.</p><p>The</p><pre>signal.get();</pre><p>method will be the uninvited party killer of our future JavaScript signals. 😢</p><p>And no: I don’t know how i could integrate „primitive signals“ while completely fulfilling the requirements considering backwards compatibility without causing the internet to collapse.</p><p>The only thing i am asking is: Can we not sit back and think for a while and then sit back together at the table and make this work?</p><h3>My unfinished ‘Dream Proposal’</h3><p>Here is what i feel JavaScript signals should be some time in the far future.</p><p>Creating a signal:</p><pre>sig a = 10; // or const a = signal(10); <br>// i know: nobody wants a new keyword :/</pre><p>Assigning a callback:</p><pre>const unsubscribe = a.subscribe(() =&gt; console.log(&quot;a was changed&quot;));</pre><p>Changing the value of a Signal:</p><pre>// changing the value<br>a = 5; <br>// or maybe better a.value = 5; or a.set(5) <br>// changing just somewhere where we don&#39;t know it&#39;s a signal<br>// is most of the time not a good idea anyways</pre><p>Assigning a signal to a property:</p><pre>obj.b = a; // b will be a reference to the signal a! and cause no read!<br><br><br>obj.c = a + 5; // a will dereference, register a read and c is a value.</pre><p>Assigning the signal to another variable<strong>:</strong></p><pre>const b = a; // b will pass the signal<br>let c = a; // will dereference</pre><p>Dereferencing a signal fires a read, but handles everything else like a simple value type.</p><p>Notice that there is no a.get() like it is suggested in the tc39 proposal!</p><pre>sig a = 5;<br>const c = a + 5; // c = 13 (number)</pre><p>Assigning a calculation to a sig creates a computed.</p><pre>sig a = 5;<br>const b = 10;<br>sig c = a + b; // c = computed(() =&gt; a + b)</pre><p>An effect keyword for syntactic sugar? Oh yes! ;)</p><pre>effect render = myVoidFunction;<br>// equals const render = effect(myVoidFunction)</pre><p>Using a signal as a closure in a void function automatically wraps an effect around it. That would not be necessary, but just a dream!</p><pre>sig a = 5;<br><br>function logTheSignal() {<br>  console.log(a);<br>}<br><br>// =&gt; logTheSingal = effect(() =&gt; console.log(a))</pre><p>Calling a traditional nested function:</p><pre><br>// my old code (yes.. that&#39;s why we use IOC and DIP):<br><br>function someOtherFunction(a: number){<br>  console.log(&#39;called child with a=&#39;,a);<br>}<br>function parent(a: number, child: (x: number) =&gt; void ){<br>  console.log(&#39;called parent&#39;);<br>  child(a); <br>}<br><br>// my new code:<br><br>sig a = 30;<br><br>parent(a, (x) =&gt; effect(() =&gt; someOtherFunction(x)));<br>// logs: <br>// called parent<br>// called child with a=30<br><br>a = 2000;<br>// logs:<br>// called child with a=2000;<br><br>// parent was not called again. ;)</pre><p><strong>We did not touch the old code</strong> but made it fine-grained reactive!</p><h3>WHY?</h3><p>Think of porting React APPS. Almost 60% (depending on sources) of all major web apps use React!</p><pre>// Like this?<br><br>function ParentComponent({ a, b }: { a: number, b: number }) {<br>  const c = a + 8;<br>  return &lt;ChildComponent b={b} c={c} /&gt;<br>}<br><br>function ChildComponent({ c, d}: { c: number, d: number }) {<br>  if (c === 10) {<br>    return &lt;h1&gt;Hello number 10 :)&lt;/h1&gt;<br>  }<br>  return &lt;p&gt;Don&#39;t say anything but you gave me a {b}.&lt;/p&gt;;<br>}</pre><p>Remember that JSX is a form of DI (Dependency Injection). We can use the JSX createElement function (like React.createElement) to put all kinds of decorators around our components! <br>Think of the reactive effect function!</p><p>Now, we want to use signals:</p><p>By <strong>not changing the API</strong> of these components and using a signal instead of a primitive type, the point of the signal is gone. We would dereference the signal in<strong> the parent of the parent</strong>! It rerenders <strong>the parent of the parent </strong>if we change the signals value. That’s not reactivity! That’s plain old useState() with prop drilling where we need a VDOM to avoid terrible performance, flickering effects and “focus lost”.</p><p>Are you changing all legacy components your app is using? Sorry, I won’t. And your boss won’t be happy about it.</p><p>Or do we just not care that the VDOM does all the work? Why use signals then? No point! Let’s drop the proposal!</p><p>Sorry “Signal Proposal,” you’ve lost my support! Even though I’ve waited so long for it, these .get() signals won’t change the world!</p><p><strong>You might say:</strong> Just use SolidJS instead of React. <br>Good point! SolidJS is great! No VDOM needed. All based on signals. <br>But: Are you migrating all ~400,000 React apps written in your country to SolidJS in a few hours?</p><p>Hell NO! It costs the world economy billions and billions!</p><p><strong>Let’s spend that money on saving our planet or helping those in need!</strong></p><h3>A view on React:</h3><p>Some people might say that simulated always-rerendering-everything in React is an advantage for debugging and devtools. <br>Sorry: No, it is not.</p><p>React is, in my opinion, the strongest framework on the market for component composition (except for some derivatives like SolidJS — but they are React with new ideas).</p><p>What React lacks is a framework-agnostic ViewModel in the background. A ViewModel that is independent of the UI structure, or what some might call a “Headless GUI,” makes it possible to be completely “UI framework-independent”!</p><p>Once we have signals that don’t break our legacy code, we are almost there. Just focus on your business again. No state container like Redux or MobX needed. Just use signals in your view models.</p><p>Let’s go there!</p><h3>Solution:</h3><p>We change the internals of React:</p><p>The API of the useState hook stays the same, but will return a signal (without a .get() but with dereferencing on read) and a setState function that hides the signal.set(newValue) .</p><p>Passing the signal to the child function does not dereference the signal. So a change of the state in the parent does not cause a re-render of the parent.</p><p><strong>AND we change the React.createElement function to wrap child components with a reactive effect.</strong></p><h3><strong>Result: BAM! THE NEED OF THE VDOM IS GONE! </strong><br>Performance x 5, Reacts bundle size / 5!</h3><p>No changes to your React apps except: npm update react@future!</p><p>The world would save billions and could spend it in other ways.</p><p>OK, I might have to do some performance statistics with real React apps to show and remove the VDOM concepts in React myself to prove it is really faster.</p><h3><strong>Further Requirements</strong></h3><p>Further requirements for treating signals as primitives:</p><pre><br>sig a = 1;<br>console.log(a === 1) // true<br>console.log(typeof a === &#39;number&#39;); // true<br><br>// we need a way dynamically detect a signal <br>// before dereferencing it<br>console.log(a instanceof signal); // true <br></pre><p>It might be that there are other cases, that need to be handled, but these are the first ones that come to mind.</p><h3>The Problem: No Polyfill</h3><p>No possible polyfill is not the only but unfortunately a very big problem.</p><p>The keyword sigcan’t be polyfilled, but down compiled. Like we did with async/await.</p><p>But a signal without .get() replacing primitives would only work in future browsers integrating it. No way older browsers could do it without unexpected side effects.</p><p>Why?<br>The <strong>===</strong> and the <strong>typeof</strong> operator can’t be overloaded to dereference before executing.</p><p>There might be more.</p><p>But how can we hide a signal in a (almost) primitive value already now?</p><pre>// I am using my own signals at the moment that have this method, <br>// The same concept could be used with the proposed signal polyfill.<br> <br>simulateLateDereference(): T {<br>  return new Proxy(this, {<br>    get(target, prop) {<br>      return () =&gt; {<br>        return target.value;<br>      };<br>    },<br>  }) as any as T; // cheating typescript here<br>}</pre><p>Hiding the signal in a proxy with an arrow function that is calling the getter of the signals value, dereferences the value only, if it is used in calculation or toString(). It works already out of the box. <br>It is enough in most cases <strong>except for the mentioned operators</strong>.</p><p>Unfortunately I can’t tell my teammates not to use <strong>typeof</strong> and even less not to use <strong>===</strong>.</p><h3>HELP Wanted!</h3><p>Please write in the comments if you know a solution how to solve the operator problems.</p><p>They are killing me!</p><p>And they are the only reason why I am not louder… 🥴</p><p>To the TC39 signal proposal Team: I hope you all know, that i don’t want to lower your work. I am just sharing my unfinished ideas. I admire your work.</p><p>Thanks for reading 🤗</p><p>Clemens</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=341809916630" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>