<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: 0xenx</title>
    <description>The latest articles on DEV Community by 0xenx (@thereplacemind).</description>
    <link>https://dev.to/thereplacemind</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4199130%2F9ec8c2b7-350a-4c25-9e1c-85e932014ac1.png</url>
      <title>DEV Community: 0xenx</title>
      <link>https://dev.to/thereplacemind</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/thereplacemind"/>
    <language>en</language>
    <item>
      <title>I simulated 20 years of AI taking jobs. The rich countries lose first.</title>
      <dc:creator>0xenx</dc:creator>
      <pubDate>Thu, 22 Oct 2026 16:11:45 +0000</pubDate>
      <link>https://dev.to/thereplacemind/i-simulated-20-years-of-ai-taking-jobs-the-rich-countries-lose-first-5fnd</link>
      <guid>https://dev.to/thereplacemind/i-simulated-20-years-of-ai-taking-jobs-the-rich-countries-lose-first-5fnd</guid>
      <description>&lt;p&gt;Most articles about AI and jobs give you one number ("300 million jobs exposed!") and no way to check it. I wanted the opposite: a model where every figure can be traced back to its data and assumptions, and where anyone can change those assumptions and see what happens.&lt;/p&gt;

&lt;p&gt;That turned into three browser simulators and a free book, &lt;em&gt;The ReplaceMind&lt;/em&gt;. This post is about how the tools are built.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5mm96bktxa1awzu79ltx.gif" class="article-body-image-wrapper"&gt;&lt;img src="https://media2.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto/https%3A%2F%2Fdev-to-uploads.s3.us-east-2.amazonaws.com%2Fuploads%2Farticles%2F5mm96bktxa1awzu79ltx.gif" alt=" " width="600" height="385"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  The economic model runs in your browser tab
&lt;/h2&gt;

&lt;p&gt;The core is a macroeconomic model in plain Python and NumPy: about 1,500 lines that simulate three regions (advanced, emerging and low-income economies) from 2026 to 2046, with AI and robot adoption curves, labor demand, wages, unemployment and public finances.&lt;/p&gt;

&lt;p&gt;I didn't want a server, so the Economy Model page loads &lt;a href="https://pyodide.org" rel="noopener noreferrer"&gt;Pyodide&lt;/a&gt; (CPython compiled to WebAssembly), installs NumPy, fetches the model's &lt;code&gt;.py&lt;/code&gt; files and imports them like a normal package:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;py&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nf"&gt;loadPyodide&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;
&lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nx"&gt;py&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;loadPackage&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;numpy&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;texts&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;await&lt;/span&gt; &lt;span class="nb"&gt;Promise&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;all&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;FILES&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;map&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nf"&gt;fetch&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;py/&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nx"&gt;f&lt;/span&gt;&lt;span class="p"&gt;).&lt;/span&gt;&lt;span class="nf"&gt;then&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;r&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="nx"&gt;r&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;text&lt;/span&gt;&lt;span class="p"&gt;())));&lt;/span&gt;
&lt;span class="c1"&gt;// write each file into Pyodide's virtual filesystem, then:&lt;/span&gt;
&lt;span class="nx"&gt;py&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;runPython&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;import sys; sys.path.insert(0, '/home/pyodide'); import dashboard&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;From there, JavaScript calls Python functions and gets JSON back. You can fix any of the 21 parameters, pick a policy (retraining, an AI dividend fund, profit-sharing, a slower rollout…) and rerun a Monte Carlo of 4,000 draws, all on your own machine. The first load is a few seconds while Pyodide downloads; after that it's fast.&lt;/p&gt;

&lt;p&gt;What I like about this setup: &lt;strong&gt;the code that produced the book's numbers is the same code you run in the page.&lt;/strong&gt; Not a JavaScript rewrite, not a summary. The same files.&lt;/p&gt;

&lt;h2&gt;
  
  
  A world map of social tension
&lt;/h2&gt;

&lt;p&gt;The third tool asks a question the model doesn't answer directly: where will replacing human work create the most social pressure?&lt;/p&gt;

&lt;p&gt;The rule is deliberately simple and written on the page:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;work taken by AI and robots in a region, from 19 professions weighted by employment;&lt;/li&gt;
&lt;li&gt;split among countries by how much each adopts AI and robots;&lt;/li&gt;
&lt;li&gt;multiplied by &lt;code&gt;1 + 0.5 × starting risk / 100&lt;/code&gt;, where starting risk comes from the World Bank's political stability index;&lt;/li&gt;
&lt;li&gt;growing at a quarter of the speed until robots take 3 points of work, at full speed after.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It's drawn with d3 and topojson: 207 countries, the 50 US states plus DC weighted by their own job mix (BLS data), and large cities for China, Russia, Canada, Australia, Brazil and India.&lt;/p&gt;

&lt;p&gt;The result surprised me. The biggest increases are not in fragile states but in rich ones, where machines replace the most work:&lt;/p&gt;

&lt;p&gt;[IMMAGINE: social_tension_2046_US_EN.png]&lt;/p&gt;

&lt;p&gt;It's an index, not a forecast of riots, and the page says so. But it makes a point that single headline numbers hide: &lt;strong&gt;the effect depends on where the machines actually go.&lt;/strong&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  One source of truth
&lt;/h2&gt;

&lt;p&gt;The part that took the most discipline: the book, the simulators and the analysis all read the same JSON files produced by the same Python module. If I change an assumption, I regenerate the outputs, and the book's tables, the job simulator and the map all change together. No numbers typed by hand into a chapter.&lt;/p&gt;

&lt;h2&gt;
  
  
  The boring but useful parts
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Static site on &lt;strong&gt;Cloudflare Workers&lt;/strong&gt; with static assets; a tiny Worker only for downloads.&lt;/li&gt;
&lt;li&gt;The download counter is a &lt;strong&gt;Durable Object&lt;/strong&gt; that stores one number per file and per day: no IP, no cookies. Search engines and AI assistants (GPTBot, ChatGPT-User, Claude-User…) are counted apart from readers, which on day one turned out to be about a third of all downloads.&lt;/li&gt;
&lt;li&gt;Bilingual (Italian and English) with a 60-line i18n helper instead of a framework.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  What I'd like feedback on
&lt;/h2&gt;

&lt;p&gt;The model has assumptions I'm not sure about, and I'd rather hear criticism now:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;the adoption curves for AI and robots, by region;&lt;/li&gt;
&lt;li&gt;how much of each profession's work can actually be replaced;&lt;/li&gt;
&lt;li&gt;the social-tension rule, which is a choice, not an estimated coefficient.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Try it:&lt;/strong&gt; &lt;a href="https://thereplacemind.com" rel="noopener noreferrer"&gt;thereplacemind.com&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;The book&lt;/strong&gt; (free, PDF and EPUB, Italian and English): &lt;a href="https://thereplacemind.com/book?lang=en" rel="noopener noreferrer"&gt;thereplacemind.com/book&lt;/a&gt;&lt;br&gt;
&lt;strong&gt;Code and data:&lt;/strong&gt; &lt;a href="https://github.com/0xENX/aimodel_replication" rel="noopener noreferrer"&gt;github.com/0xENX/aimodel_replication&lt;/a&gt;&lt;/p&gt;

</description>
      <category>showdev</category>
      <category>python</category>
      <category>ai</category>
      <category>webassembly</category>
    </item>
  </channel>
</rss>
