<?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 Stephen Turner on Medium]]></title>
        <description><![CDATA[Stories by Stephen Turner on Medium]]></description>
        <link>https://medium.com/@slturner?source=rss-a250cfb8d94a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*6hAB_uWi7SaO7SQO</url>
            <title>Stories by Stephen Turner on Medium</title>
            <link>https://medium.com/@slturner?source=rss-a250cfb8d94a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 29 Nov 2026 08:52:05 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@slturner/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[LLMs Use Python Like Bash]]></title>
            <link>https://medium.com/@slturner/llms-use-python-like-bash-c090d5a79938?source=rss-a250cfb8d94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/c090d5a79938</guid>
            <category><![CDATA[software-engineering]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[testing]]></category>
            <category><![CDATA[system-design-concepts]]></category>
            <dc:creator><![CDATA[Stephen Turner]]></dc:creator>
            <pubDate>Fri, 23 Jan 2026 05:43:57 GMT</pubDate>
            <atom:updated>2026-01-23T05:43:57.782Z</atom:updated>
            <content:encoded><![CDATA[<h3>Everything Is a Function Until You Say Otherwise</h3><p>LLMs use Python like Bash.</p><p>Everything is a function.<br>Everything is callable.<br>Everything is disposable.</p><p>Until you say otherwise.</p><p>That one idea explains an enormous amount of thrash in modern LLM-driven systems.</p><p>And yes — <strong>the thrash is dead</strong>, but only if you stop feeding it.</p><h3>How LLMs “Think” in Python</h3><p>Ask an LLM to generate a system in Python and the shape is immediately familiar:</p><ul><li>Free-floating functions</li><li>Implicit state</li><li>Optional types</li><li>Boundaries that exist only by convention</li></ul><p>That’s not a model failure.</p><p>It’s because to an LLM, Python isn’t a system language.</p><p>It’s a <strong>shell</strong>.</p><p>Pipe this.<br>Call that.<br>Glue it together.<br>Hope it works.</p><p>Exactly like Bash.</p><h3>This Works — Until You Want a System</h3><p>This model is fantastic for:</p><ul><li>ML workflows</li><li>Research</li><li>Orchestration</li><li>Prototyping</li><li>Library-driven problems</li></ul><p>Python shines here. I use it constantly when it makes sense and shines.</p><p>But the moment you say:</p><ul><li>“This needs to live”</li><li>“This needs to be refactored”</li><li>“Other humans need to touch this”</li><li>“We need guarantees”</li></ul><p>The tradeoff flips.</p><p>Because everything is still a function.<br>And nothing is enforcing meaning.</p><h3>If You’ve Written Large Node.js Without TypeScript, You Already Know This</h3><p>Anyone who has built a large Node.js application <em>without</em> TypeScript understands exactly what I’m describing.</p><p>It starts fine.<br>Fast iteration.<br>Flexible code.<br>Minimal friction.</p><p>Then the system grows.</p><p>Refactors get scary.<br>Runtime errors multiply.<br>Tests balloon to catch shape mismatches.<br>Confidence drops even when everything is green.</p><p>TypeScript didn’t win because JavaScript was bad.</p><p>It won because <strong>runtime discovery doesn’t scale</strong>.</p><p>Once you’ve lived through that pain, the value of enforced structure stops being theoretical.</p><h3>Where the Time Actually Goes</h3><p>Runtime errors don’t feel expensive individually.</p><p>They look like:</p><ul><li>A stack trace</li><li>A quick fix</li><li>A rerun</li></ul><p>But add:</p><ul><li>LLM-generated code</li><li>Refactors</li><li>Multiple contributors</li><li>Evolving assumptions</li></ul><p>And suddenly you’re not building.</p><p>You’re debugging.</p><p>This is where you start paying in the <strong>only currency that actually matters</strong>:</p><p><strong>Time.</strong></p><p>Lost flow.<br>Lost context.<br>Lost intent.</p><p>That’s the real cost of runtime discovery.</p><h3>Skip Design and Entropy Wins</h3><p>And God-forbid you don’t write READMEs or design docs <em>before</em> generating code.</p><p>Without explicit intent:</p><ul><li>The LLM invents structure</li><li>Assumptions multiply</li><li>Interfaces drift</li><li>“Helpful” abstractions appear out of nowhere</li></ul><p>Now you’re not debugging code.</p><p>You’re debugging <strong>misunderstood architecture</strong>.</p><p>Tests and comments are no longer validating intent — they’re trying to invent it retroactively.</p><p>That’s not a tooling problem.<br>That’s missing design, amplified by a permissive language.</p><h3>Tests Start Covering for Runtime Deficiencies</h3><p>So you do the responsible thing.</p><p>You add tests.</p><p>Eventually you realize something uncomfortable:</p><p>You’re writing tests to cover deficiencies where a compiler would have saved you immediately.</p><p>Not business logic.<br>Not invariants.</p><p>But:</p><ul><li>Missing fields</li><li>Broken interfaces</li><li>Shape mismatches</li></ul><p>That’s not rigor.</p><p>That’s doing compiler work by hand.</p><h3>And Then Come the E2E Tests</h3><p>When unit tests aren’t enough, the next move is predictable.</p><p>You add end-to-end tests.</p><p>Not to validate user behavior — <br>but to verify wiring and structure a compiler already understands.</p><p>E2E tests are the <strong>most unreliable and time-consuming tests you can write</strong>.</p><p>They’re slow.<br>They’re flaky.<br>They fail for reasons unrelated to your change.</p><p>And now, because you chose the wrong tool, you’re paying in the most valuable currency you have.</p><p><strong>Time.</strong></p><h3>The CTO’s Only Move</h3><p>At this point, there’s really only one lever left.</p><p>The CTO can spend more money.</p><p>More CI minutes.<br>More environments.<br>More parallel runners.<br>More retries.</p><p>You don’t fix the problem — you <strong>outspend it</strong>.</p><p>E2E tests get slower, so you buy more machines.<br>They get flakier, so you rerun them “just in case.”<br>Pipelines stretch from minutes to hours, so you throw more compute at the fire.</p><p>Eventually the architecture is held together by:</p><ul><li>Cloud credits</li><li>Test retries</li><li>And the quiet hope that green means correct</li></ul><p>It’s not engineering anymore.</p><p>It’s infrastructure-backed optimism.</p><p>The irony is brutal:<br>the most expensive tests exist to validate things a compiler would have rejected instantly — <em>for free</em>.</p><p>So the org doesn’t get more confident.</p><p>It just gets better at paying the bill.</p><h3>The Test Coverage Leaderboard Problem</h3><p>At some point, you tell the LLM to <em>increase test coverage</em>.</p><p>And it does.</p><p>Coverage climbs.<br>Charts go up and to the right.<br>Dashboards turn green.</p><p>You even show up near the top of the test coverage leaderboard.</p><p>And instead of feeling proud…<br>you feel a quiet sense of shame.</p><p>Because you know what’s actually happening.</p><p>The tests aren’t protecting behavior.<br>They’re validating wiring.<br>They’re asserting shapes.<br>They’re locking in accidental structure.</p><p>Coverage went up.<br>Confidence didn’t.</p><p>High coverage starts to feel less like an achievement and more like an admission:<br>the system needs tests to explain itself.</p><p>That’s not safety.<br>That’s documentation written in code — and reviewed by almost no one.</p><h3>The Unit Test Illusion</h3><p>To avoid E2E pain, teams lean harder on unit tests — often generated by LLMs.</p><p>The result:</p><ul><li>Massive test files</li><li>Dozens of mocks</li><li>Hundreds of lines asserting wiring</li></ul><p>In practice, almost no developer does a thorough review of these tests in a PR.</p><p>They’re too large.<br>Too noisy.<br>Too detached from intent.</p><p>The tests exist.<br>The confidence is performative.</p><h3>When Tests Become the Authority, You’ve Already Lost</h3><p>At some point, something subtle happens.</p><p>Tests stop validating behavior<br>and start defining truth.</p><p>Not because anyone chose that — <br>but because there’s nothing else enforcing structure.</p><p>So when a test and the implementation disagree, the question becomes:</p><p><strong>Which one is correct?</strong></p><p>And that’s the failure state.</p><p>Because if you’re asking that question, the system has already drifted.</p><p>Tests were never meant to be the spec.</p><p>That only happens when the compiler has been sidelined.</p><h3>Pydantic and the Family Reckoning</h3><p>Pydantic is the great-great-grandchild who showed up saying,<br>“I’ll fix it,”<br>after the family spent decades pretending structure was optional.</p><p>It wants to do the right thing.</p><p>And to be clear: it’s useful. It’s saved a lot of people from a lot of pain.</p><p>But it’s also a tell.</p><p>When you need a heavyweight runtime framework to enforce basic shapes, contracts, and invariants, you’re not being rigorous.</p><p>You’re paying late.</p><p>You’re rebuilding compile-time guarantees at runtime — which is expensive, fragile, and incomplete by design.</p><h3>Why I Eventually Listened to the Old Man</h3><p>I’ve written a lot of C and C++.</p><p>I’ve felt that pain.</p><p>The verbosity.<br>The up-front cost.<br>The discipline it demands.</p><p>There’s no pretending in those languages.<br>No “we’ll catch it later.”</p><p>You either decide what something is — or you don’t ship.</p><p>At the time, it felt slow.</p><p>But years later, something became obvious.</p><p>That code still runs.<br>It still compiles.<br>It still tells you exactly what broke when you touch it.</p><p>It <em>lives forever</em> because the structure was never optional.</p><p>That’s when the compiler started sounding less like friction<br>and more like wisdom.</p><h3>The Forgotten Wisdom</h3><p>The compiler is the old man everyone ignores — <br>right up until they realize he’s been right the whole time.</p><p>In compiled systems:</p><ul><li>You’re forced to be explicit</li><li>You’re forced to decide what things <em>are</em></li><li>You’re forced to confront structure early</li></ul><p>And in return:</p><ul><li>Refactors are mechanical</li><li>Breakage is explicit</li><li>Feedback is immediate</li></ul><p>The thrash is dead because the arguments end early.</p><p>The compiler doesn’t negotiate.<br>It doesn’t accept vibes.<br>It doesn’t care that “it worked before.”</p><p>It just tells you the truth — as early as possible.</p><h3>The Point</h3><p>Python is powerful.<br>Bash is powerful.</p><p>They are incredible tools for the right jobs.</p><p>I use Python when it makes sense and shines — especially in ML, research, and orchestration.</p><p>But when:</p><ul><li>Structure is implied</li><li>Tests replace guarantees</li><li>Unit tests become unreadable artifacts</li><li>E2E tests validate interfaces</li><li>Runtime errors become your feedback loop</li></ul><p>The problem isn’t the language.</p><p>It’s where — and how — you’re using it.</p><p><strong>Just like Bash, Python is powerful — until you rely on tests to tell you what the structure should have been.</strong></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c090d5a79938" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OpenSSL 3.x and FIPS. What I learned.]]></title>
            <link>https://medium.com/@slturner/openssl-3-x-and-fips-what-i-learned-13e062333dc?source=rss-a250cfb8d94a------2</link>
            <guid isPermaLink="false">https://medium.com/p/13e062333dc</guid>
            <category><![CDATA[fips140]]></category>
            <category><![CDATA[openssl]]></category>
            <dc:creator><![CDATA[Stephen Turner]]></dc:creator>
            <pubDate>Thu, 27 Jul 2023 18:07:15 GMT</pubDate>
            <atom:updated>2023-07-27T18:07:15.651Z</atom:updated>
            <content:encoded><![CDATA[<p>OpenSSL 3.x introduced the concept of being able to dynamically load FIPS compliance as a provider. In a nutshell, FIPS compliance means the algorithms being used for cryptography are in compliance with what the security experts recommend. Since OpenSSL 3.x FIPS module is certified, we get the benefit of FIPS compliance “if” we load it properly into our application.</p><p>OpenSSL 3.x introduced the concept of dynamic modules. Simply put, you can declare a module inside your “openssl.cnf” configuration and then tell it where the path to your module is at runtime. You can load/unload functionality into OpenSSL using a configuration file without having to write code. Seems easy right? Well no. Paths are great when you’re using a desktop machine like MacOS or Windows. But what happens when you are using it inside apps that run inside a sandbox like iOS or Android? Suddenly all these “paths” to specified locations don’t make sense anymore. The FIPS module in particular uses a MAC to verify the binary executable matches the configuration. So we need to match up the FIPS configuration with the correct binary executable or it won’t load.</p><p>The Android platform can be tricky. For each architecture, you need to have a separate FIPS module configuration specifying the correct MAC for that binary executable. The approach I took was storing a “fipsmodule.cnf” asset for each architecture. During compile-time, you can determine the architecture and fetch the correct “fipsmodule.cnf” asset. Ok now we need to know where the binary executable is. My first approach was just storing “fips.so” as a blob in assets. This approach felt dirty for obvious reasons. Pulling a blob out of assets and then telling it to run should NEVER work. It’s not signed as an executable and could be potentially dangerous. However, Android did allow it to run with a warning saying it was untrusted. Should that be a warning or a runtime error? Maybe I just tipped off Google and they can determine the response to this. My next approach was the final approach. If “fips.so” was installed just like any other Android native library then when OpenSSL tries to use it using “dlopen” there should be no warning since it is “trusted”. Here’s where things get complicated. When you install an application on Android it puts the native libraries in some generated directory each time. How do we make the association between a module defined inside “openssl.cnf” and the module binary executable path? The Android API allows you to find that native library directory at runtime via <a href="https://developer.android.com/reference/android/content/pm/ApplicationInfo#nativeLibraryDir">ApplicationInfo</a>. Since OpenSSL modules were clearly never designed with mobile in mind, we have to be more clever to make paths work. OpenSSL expects “fips.so” to be in some specified module directory so that when the configuration calls for “fips” it knows how/where to load the module. This is where the usage of symbolic links makes everything easier. During runtime, create a known directory inside the app’s files or cache directory that is the module directory. Now we can create symbolic links to “fips.so” pointing the the native library directory where the original binary was installed. This makes Android happy and no more warnings about untrusted code. Now we need to include the contents of “fipsmodule.cnf” based on the correct architecture into “openssl.cnf”. To put on the finishing touches, use the OpenSSL API “OSSL_PROVIDER_set_default_search_path” to point to the module directory that contains a symbolic link to “fips.so”. Now when we call “OSSL_PROVIDER_load(libCtx, “fips”)” it will use the module path specified and will be able to find/load “fips.so” via symbolic link.</p><p>Next, make sure you enable the FIPS provider by default. You should use “EVP_default_properties_enable_fips(nullptr, 1)”. This will enable FIPS globally throughout the entire application. There are situations however where strict FIPS is undesirable. For example, you might use SHA-1 to generate a file name, or read a CMS/SMIME payload from an old email or load a PKCS12 store. In that case, we will need to temporarily disable FIPS for just that operation. OpenSSL allows you to define more than one contexts and/or configurations. Create an instance “OSSL_LIB_CTX” and tell it to be “strict”. OpenSSL allows you to set the “OSSL_LIB_CTX” on the current thread using “OSSL_LIB_CTX_set0_default”. Now you can spawn a new thread and set the “OSSL_LIB_CTX” that is using FIPS mode and call all the OpenSSL APIs knowing they are FIPS-compliant.</p><p>For iOS, the concept is the same as Android except you will use bundles which inherently support paths. The biggest challenge is getting the Apple Store to accept “fips.dylib” inside XC framework. To be continued….</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=13e062333dc" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>