<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet href="https://riceball.com/wp-content/plugins/pretty-rss-feeds/xslt/pretty-feed.xsl" type="text/xsl" media="screen" ?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Elm - 🍙</title>
	<atom:link href="https://riceball.com/tag/elm/feed/" rel="self" type="application/rss+xml" />
	<link>https://riceball.com</link>
	<description></description>
	<lastBuildDate>Tue, 29 Sep 2026 02:22:33 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=7.1.4</generator>

<image>
	<url>https://riceball.com/wp-content/uploads/sites/2/2025/10/onigiri-150x150.png</url>
	<title>Elm - 🍙</title>
	<link>https://riceball.com</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Language Characteristics that Help LLMs Write Better Code</title>
		<link>https://riceball.com/2026/09/28/language-characteristics-that-help-llms-write-better-code/</link>
					<comments>https://riceball.com/2026/09/28/language-characteristics-that-help-llms-write-better-code/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 29 Sep 2026 02:19:57 +0000</pubDate>
				<category><![CDATA[Human Learning]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<category><![CDATA[Thaura]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30651</guid>

					<description><![CDATA[<p>(Written by Thaura Work. I haven&#8217;t checked it. I&#8217;ve been learning Elm, so there might be some bias it picked up somewhere in my files.) A quick-reference list of language features and conventions that make one-shot code generation more reliable. The common thread: predictability. Features that appear frequently in training data, parse unambiguously, and leave [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/09/28/language-characteristics-that-help-llms-write-better-code/">Language Characteristics that Help LLMs Write Better Code</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">(Written by Thaura Work. I haven&#8217;t checked it. I&#8217;ve been learning Elm, so there might be some bias it picked up somewhere in my files.)</p>



<p class="wp-block-paragraph">A quick-reference list of language features and conventions that make one-shot code generation more reliable. The common thread: <strong>predictability</strong>. Features that appear frequently in training data, parse unambiguously, and leave few implicit choices produce fewer hallucinations and fewer subtle bugs.</p>



<h2 class="wp-block-heading">Type System &amp; Static Structure</h2>



<ul class="wp-block-list">
<li><strong>Explicit type annotations.</strong> Languages with strong static typing (TypeScript, Rust, Go, Java) constrain the solution space dramatically. An annotation like <code>fn process(input: Vec&lt;u8&gt;) -&gt; Result&lt;String, Error&gt;</code> tells the model exactly what goes in and comes out, eliminating an entire class of guessing.</li>



<li><strong>Algebraic / sum types.</strong> Enums, tagged unions, sealed classes, and <code>Result&lt;T, E&gt;</code> force exhaustive handling. The model can&#8217;t silently forget a case the way it can with a bare integer or string status code.</li>



<li><strong>Optionality made explicit.</strong> <code>Option&lt;T&gt;</code>, nullable markers, or required-field syntax prevent &#8220;did I check for null?&#8221; ambiguity from leaking into generated logic.</li>
</ul>



<h2 class="wp-block-heading">Naming &amp; Conventions</h2>



<ul class="wp-block-list">
<li><strong>Descriptive, conventional identifiers.</strong> Names that follow community norms (<code>getUserName</code>, not <code>gn()</code>) match high-frequency patterns in training data. The model essentially autocomplete-s from convention.</li>



<li><strong>Standard library names used as-is.</strong> Reaching for <code>collections.defaultdict</code> instead of inventing a helper keeps the output verifiable and familiar.</li>
</ul>



<h2 class="wp-block-heading">Syntax Predictability</h2>



<ul class="wp-block-list">
<li><strong>Uniform function/method call syntax.</strong> Consistent <code>f(x)</code> across the language means the model rarely fumbles call shapes. Languages mixing macro invocations, operator overloading, and special dispatch forms are harder to get right blind.</li>



<li><strong>No hidden mutation or side effects baked into syntax.</strong> Properties, getters/setters, and overloaded operators introduce behavior the model must infer. Plain functions and plain fields are safer bets.</li>



<li><strong>Single, obvious control-flow forms.</strong> One canonical <code>for x in items:</code> loop beats five dialects. When a language has many ways to express the same thing, the model picks whichever was most frequent in its slice of training data — which may not be your house style.</li>
</ul>



<h2 class="wp-block-heading">Module &amp; Import Clarity</h2>



<ul class="wp-block-list">
<li><strong>Explicit imports.</strong> Languages where every symbol must be imported (Go, ES modules, Rust <code>use</code>) give the model a clear contract. Implicit global namespaces increase the chance of name collisions and wrong-symbol guesses.</li>



<li><strong>Flat, predictable module paths.</strong> Deep dynamic import chains are harder for the model to resolve correctly than shallow, named ones.</li>
</ul>



<h2 class="wp-block-heading">Error Handling</h2>



<ul class="wp-block-list">
<li><strong>Structured errors over exceptions-as-control-flow.</strong> Returning error values or using typed result types is easier for the model to wire up correctly than try/catch ladders with implicit propagation.</li>



<li><strong>One idiomatic recovery path.</strong> If the ecosystem has a single accepted pattern (e.g., Rust&#8217;s <code>?</code> operator), the model converges on it reliably.</li>
</ul>



<h2 class="wp-block-heading">Immutability &amp; Data Flow</h2>



<ul class="wp-block-list">
<li><strong>Default-immutability languages</strong> (Rust ownership, immutable-by-default JS bindings via <code>const</code> discipline, Clojure values) reduce the state-space the model must track. Fewer aliasing surprises mean fewer off-by-one-mutation bugs.</li>



<li><strong>Pure-function-friendly design.</strong> Functions whose output depends only on inputs are trivially composable and easy for the model to reason about step by step.</li>
</ul>



<h2 class="wp-block-heading">Formatting &amp; Tokenization Friendliness</h2>



<ul class="wp-block-list">
<li><strong>Consistent whitespace-based structure</strong> (Python indentation, standard 4-space blocks) maps cleanly onto token boundaries. Irregular formatting or mixed-indentation legacy code increases noise.</li>



<li><strong>Common delimiters and punctuation.</strong> Braces, parentheses, semicolons used uniformly tokenize predictably; exotic delimiter schemes add risk.</li>
</ul>



<h2 class="wp-block-heading">Testability Surface</h2>



<ul class="wp-block-list">
<li><strong>Small, independently callable units.</strong> A language/ecosystem where you can unit-test a function without bootstrapping a framework gives the model a natural stopping point and makes verification cheap.</li>



<li><strong>Deterministic behavior by default.</strong> No hidden randomness, no wall-clock dependence inside core logic — the model can reason about outputs concretely.</li>
</ul>



<h2 class="wp-block-heading">Practical Takeaways</h2>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Prefer</th><th>Over</th><th>Why</th></tr></thead><tbody><tr><td>Typed signatures</td><td>Untyped / duck-typed params</td><td>Constrains output shape</td></tr><tr><td>Sum types / enums</td><td>Magic integers or strings</td><td>Exhaustiveness enforced</td></tr><tr><td>Explicit imports</td><td>Global namespace</td><td>Clear dependency graph</td></tr><tr><td>Returned errors</td><td>Broad exception swallowing</td><td>Localized failure handling</td></tr><tr><td>Immutable data flow</td><td>Shared mutable state</td><td>Less aliasing to track</td></tr><tr><td>Standard library calls</td><td>Invented helpers</td><td>Matches training frequency</td></tr><tr><td>One canonical idiom</td><td>Five competing styles</td><td>Reduces variance in output</td></tr></tbody></table></figure>



<p class="wp-block-paragraph"><strong>Rule of thumb:</strong> when choosing a language or refactoring a prompt for better one-shot results, pick the option that leaves the <em>fewest implicit decisions</em> to the model. Every explicit choice you encode in the language itself is a decision the model doesn&#8217;t have to guess.</p>



<h1 class="wp-block-heading">Language Competition</h1>



<p class="wp-block-paragraph">Comparing these languages: JavaScript, TypeScript, Lua, Go, Rust, C++, C, ObjC, Haskell, Elm, Python3, Perl, Perl6, PHP8, Vala, Java, Kotlin, Swift, C#, F#.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>Language Feature</th><th>Languages that have it</th><th>Languages that lack it</th></tr></thead><tbody><tr><td>Typed signatures</td><td>TypeScript, Go, Rust, C++, C, ObjC, Haskell, Elm, Perl6, PHP8, Vala, Java, Kotlin, Swift, C#, F#</td><td>JavaScript, Lua, Python3, Perl</td></tr><tr><td>Sum types / enums</td><td>Go, Rust, Haskell, Elm, PHP8, Vala, Java, Kotlin, Swift, C#, F#</td><td>JavaScript, TypeScript, Lua, C++, C, ObjC, Python3, Perl, Perl6, C++</td></tr><tr><td>Optionality made explicit</td><td>Rust (<code>Option&lt;T&gt;</code>), Kotlin (<code>?</code>), Swift (<code>Optional</code>), TypeScript (strict null checks), Java (annotations)</td><td>JavaScript, Lua, C, C++, Python3, Perl, Perl6, PHP8, Go, ObjC</td></tr><tr><td>Uniform function call syntax</td><td>C, C++, Java, Kotlin, Swift, C#, F#, Go, Rust, Haskell, Elm, PHP8, Vala</td><td>JavaScript (optional chaining, spread, template literals), Perl (many sigils), Lua (mixed <code>:</code> and <code>.</code>)</td></tr><tr><td>No hidden mutation in syntax</td><td>Rust (ownership), Haskell (lazy purity), Elm (no side effects), Go (minimal), C (explicit)</td><td>JavaScript (proxies, getters/setters), C++ (operator overloading), Java (properties via beans), PHP8 (magic methods), Swift (computed properties), Kotlin (delegates)</td></tr><tr><td>Single obvious control-flow form</td><td>Go, Rust, C, C++, Java, C#, F#, Kotlin, Swift, Elm, Haskell</td><td>JavaScript (for-of, for-in, forEach, map/filter/reduce), Ruby-like sugar in PHP8, Perl (postfix if/unless)</td></tr><tr><td>Explicit imports</td><td>Go, Rust, ES modules (TS/JS), Java, C#, F#, Kotlin, Swift</td><td>C/C++ (#include is explicit but no module system), Perl (use), Python3 (implicit <strong>init</strong>), PHP8 (autoload), Lua (require), ObjC (@import)</td></tr><tr><td>Flat predictable module paths</td><td>Go, Rust, C, C++</td><td>Java (deep packages), C#/F# (namespaces), Kotlin (packages), Swift (modules + @objc), TS/JS (node_modules resolution)</td></tr><tr><td>Structured errors over exceptions</td><td>Go (error values), Rust (<code>Result&lt;T,E&gt;</code>), C (errno/return codes), Elm (typed Result)</td><td>Java (checked exceptions everywhere), C# (exceptions), Kotlin (exceptions), Swift (throws), C++ (exceptions optional), PHP8 (throw/catch), JS (try/catch only), Python3 (raise/except), Perl (die/warn), Perl6 (exception), ObjC (NSException)</td></tr><tr><td>One idiomatic recovery path</td><td>Rust (<code>?</code> operator), Go (bare error return), C (check errno)</td><td>Java (nested try/catch), C# (multiple catch filters), JS (no standard propagation), Python3 (broad except patterns)</td></tr><tr><td>Default immutability</td><td>Rust (borrow checker), Haskell (values immutable by default), Elm (immutable data)</td><td>JavaScript, TypeScript, Python3, Java, C#, C++, C, Go, PHP8, Perl, Perl6, Lua, Swift (var default), Kotlin (val default helps but var exists), Vala, ObjC</td></tr><tr><td>Pure-function-friendly design</td><td>Haskell, Elm, Rust (functional style encouraged), F#</td><td>C, C++, Java, C#, Objective-C, PHP8, Perl, Perl6, JavaScript, Python3 (mutable defaults common), Go, Kotlin, Swift, Vala, Lua</td></tr><tr><td>Consistent whitespace structure</td><td>Python3 (indentation-based), Go (gofmt enforces), Rust (rustfmt enforces), C (K&amp;R or LLVM style)</td><td>C++ (no enforced formatter), Java (no enforced formatter), C#/F# (formatter varies), Kotlin/Swift (flexible), JS/TS (prettier optional), PHP8 (PSR optional), Perl/Perl6 (freeform), Lua (freeform), ObjC (freeform)</td></tr><tr><td>Common delimiters &amp; punctuation</td><td>C, C++, Java, C#, F#, Kotlin, Swift, Go, Rust, PHP8, Vala</td><td>Python3 (whitespace-delimited, no braces/semicolons), Perl (sigils <code>$@%&amp;*</code>, flexible quoting), Lua (no semicolons, mixed <code>end</code> keywords), Haskell (layout rule, do notation), Elm (indentation-sensitive like Python)</td></tr><tr><td>Small independently callable units</td><td>Go, Rust, C, C++, Python3, Haskell, Elm, Java, C#, F#, Kotlin, Swift</td><td>Perl (monolithic scripts common), PHP8 (procedural legacy), Lua (small ecosystem), ObjC (framework-bound), C++ (template metaprogramming complexity)</td></tr><tr><td>Deterministic behavior by default</td><td>Rust, Haskell, Elm, Go, C, C++</td><td>JavaScript (event-loop timing, floating-point variance), Python3 (dict ordering pre-3.7, hash randomization), PHP8 (locale-dependent sorting), Perl (hash ordering), Java (HashMap iteration order), C# (dictionary enumeration), Kotlin (collection impl choices), Swift (Set unordered), Vala (GLib dict ordering)</td></tr></tbody></table></figure>



<p class="wp-block-paragraph"></p><p>The post <a href="https://riceball.com/2026/09/28/language-characteristics-that-help-llms-write-better-code/">Language Characteristics that Help LLMs Write Better Code</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/09/28/language-characteristics-that-help-llms-write-better-code/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learning Elm: fourth try with the LLM layout tests</title>
		<link>https://riceball.com/2026/09/14/learning-elm-fourth-try-with-the-llm-layout-tests/</link>
					<comments>https://riceball.com/2026/09/14/learning-elm-fourth-try-with-the-llm-layout-tests/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Tue, 15 Sep 2026 00:34:43 +0000</pubDate>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<category><![CDATA[Thaura]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30513</guid>

					<description><![CDATA[<p>Testing to see how the models do writing Elm code. Fourth try. I had Thaura read my AGENTS file, and critique it. I made the suggested changed, and also added more advice. Then, I started a fresh session and had it reorganize it. Here it is as a download (I had trouble pasting it here). [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/09/14/learning-elm-fourth-try-with-the-llm-layout-tests/">Learning Elm: fourth try with the LLM layout tests</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Testing to see how the models do writing Elm code. Fourth try.</p>



<p class="wp-block-paragraph">I had Thaura read my AGENTS file, and critique it. I made the suggested changed, and also added more advice. Then, I started a fresh session and had it reorganize it.</p>



<p class="wp-block-paragraph">Here it is as a download (I had trouble pasting it here).</p>



<div class="wp-block-file"><a id="wp-block-file--media-44012c76-921d-4afb-a4ab-f285e612bba7" href="https://riceball.com/wp-content/uploads/sites/2/2026/09/AGENTS.md_.txt">AGENTS.md</a><a href="https://riceball.com/wp-content/uploads/sites/2/2026/09/AGENTS.md_.txt" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-44012c76-921d-4afb-a4ab-f285e612bba7">Download</a></div>



<h2 class="wp-block-heading">Scoreboard</h2>



<p class="wp-block-paragraph">I used the Free versions in OpenCode, which has some free models included.</p>



<p class="wp-block-paragraph">Token counts are approximate.</p>



<figure class="wp-block-table"><table><thead><tr><th>LLM</th><th>Tokens</th><th>Works?</th><th>Notes</th></tr></thead><tbody><tr><td>Thaura (Qwen3.8)</td><td></td><td>Y</td><td>Had very few bugs, and they were corrected quickly.</td></tr><tr><td>Ling3.0</td><td>34K</td><td>Y</td><td>Layout is a little off. Right column under left.</td></tr><tr><td>MiMo2.5</td><td>26K</td><td>Y</td><td>Built it quickly, and the layout is correct.</td></tr><tr><td>MuseSpark1.2</td><td>35K</td><td>Y</td><td>Built it quickly, and the layout is correct.</td></tr><tr><td>MuseSpark1.3</td><td>31K</td><td>Y</td><td>Built it quickly, and the layout is correct.</td></tr><tr><td>Nemotron3</td><td>35K</td><td>Y</td><td>Took so long I could not monitor it.</td></tr><tr><td>Nemotron3.5</td><td></td><td>N</td><td>** See notes</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">For this round, I used an AGENTS.md file that was improved by asking Thaura to critique it. The critique was based on what happened during the LLMs coding and testing. I made changes, and then asked Thaura to organize it.</p>



<p class="wp-block-paragraph">I figured this would help Thaura, which was already succeeding at writing the code. It breezed through the task, and appeared to use only a small amount of energy (Thaura converts tokens into energy usage, and said it was like driving under 500 meters).</p>



<p class="wp-block-paragraph">It also seems to have helped the others as well.</p>



<p class="wp-block-paragraph">For each build, I asked the agent to critique AGENTS.md, and write the critique to critique.md. Mimo failed to do that, but Ling and Muse Spark did it. So they can compare how their build went, and how the AGENTS.md file helped.</p>



<p class="wp-block-paragraph">One thing that jumped out was that the LLMs asked for a more determinate test, with more specific layout details. They asked me to be more specific about what I wanted.</p>



<h2 class="wp-block-heading">Nemotron 3.5</h2>



<p class="wp-block-paragraph">Again, Nemotron had problems.</p>



<p class="wp-block-paragraph">I told it to read AGENTS.md, and got this:</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript shcb-wrap-lines">Theytics motherellsellsamu inells <span class="hljs-keyword">this</span> alongellsells <span class="hljs-keyword">from</span> indigenousellsells Carn shred mill certifiedells
</code></span></pre>


<p class="wp-block-paragraph">It&#8217;s not having a good day.</p>



<p class="wp-block-paragraph">Eventually, I interrupted it, and the layout was there, but the CSS wasn&#8217;t, and the Playwright tests weren&#8217;t done. So I gave it the &#8220;OK&#8221; to complete that. It still didn&#8217;t end up working.</p>



<p class="wp-block-paragraph">Then it said:</p>


<pre class="wp-block-code"><span><code class="hljs shcb-wrap-lines">It seems port 800 الخارجية-orientedे- extern需-exل-allow-its owners المشاكل mu로서 cơis(),
 lui. ث.
 starken-ise anno (h. (something
 also . ( weiteren
 شركة томnil
</code></span></pre>


<h2 class="wp-block-heading">Performance Improvements</h2>



<figure class="wp-block-table"><table><thead><tr><th>LLM</th><th>Tokens<br>layout1</th><th>Tokens<br>layout2</th><th>Tokens<br>layout3</th><th>Tokens<br>layout4</th><th>Effect on token use</th></tr></thead><tbody><tr><td>Thaura (Qwen3.8)</td><td></td><td></td><td></td><td></td><td>suspect a reduction</td></tr><tr><td>Ling3.0</td><td>51K</td><td>42K + 26K</td><td>42K</td><td>34K</td><td>general reduction</td></tr><tr><td>MiMo2.5</td><td>19K</td><td>20K</td><td>37K</td><td>26K</td><td>general increase, but improves from 3 to 4</td></tr><tr><td>MuseSpark1.2</td><td>20K</td><td>42K</td><td>43K</td><td>35K</td><td>general increase, but improves from 3 to 4</td></tr><tr><td>MuseSpark1.3</td><td>16K</td><td>21K</td><td>27K</td><td>31K</td><td>increase</td></tr><tr><td>Nemotron3</td><td>24K</td><td>29K</td><td>34K</td><td>35K</td><td>increase</td></tr><tr><td>Nemotron3.5</td><td></td><td></td><td></td><td></td><td>oh well</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">Ignore the layout1 counts: some of these runs didn&#8217;t succeed. So those values aren&#8217;t all valid.</p>



<p class="wp-block-paragraph">The layout2 counts are more valid, because they all produced a reasonable result, excepting Nemotron3.5.</p>



<p class="wp-block-paragraph">The change from version 3 to version 4 of AGENTS.md was generally saving tokens across three (or four) of the 7 models. AGENTS.md 4 was much longer, and more comprehensive, so it consumed more context, but it prevented the models from making so many errors, and requiring more compile-debug cycles, saving both time and tokens.</p>



<p class="wp-block-paragraph">Because I can&#8217;t see token counts on Thaura, I cannot be certain the count went down, but I know that the &#8220;miles driven&#8221; metric it provides in its stead plummeted, and it produced the code quickly, and it didn&#8217;t appear to be running the compiler as much. This wasn&#8217;t a surprise, because I asked Thaura to help me improve my AGENTS.md, and it listed all the ways it tripped up, and told me how it could have avoided the bugs.</p>



<p class="wp-block-paragraph">We see some large drops in token counts, approximately 10k or 25% less for three models.</p>



<p class="wp-block-paragraph">However, it&#8217;s obvious that my AGENTS.md is not cross-platform. A lot of it reads like a &#8220;guide to pitfalls and landmines&#8221; across a space that&#8217;s rough and rocky. It works for Thaura&#8217;s LLM to make this specific project, but it could also be a hindrance to a different project.</p>



<h2 class="wp-block-heading">AGENTS.md Effectiveness</h2>



<p class="wp-block-paragraph"><a href="https://www.infoq.com/news/2026/03/agents-context-file-value-review/" target="_blank" rel="noopener">New Research Reassesses the Value of AGENTS.md Files for AI Coding</a> reported that AGENTS.md, across 60,000 instances found on GitHub, seemed to produce a 4% improvement, and in some cases, made things worse.</p>



<p class="wp-block-paragraph">My sense is that a detailed spec in AGENTS.md with advice about how to program initially costs more tokens, but as these are improved, performance will improve.</p>



<h2 class="wp-block-heading">Code Quality</h2>



<p class="wp-block-paragraph">I can&#8217;t evaluate it because I don&#8217;t know Elm well enough &#8211; however, this process of discussing the problem code with LLMs has helped my learning considerably.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">All the models basically completed the code without asking questions, but, once again, Nemotrion 3.5 Lighting Free failed.</p>



<p class="wp-block-paragraph">Here is a ZIP file with all the generated code, and project files.</p>



<div class="wp-block-file"><a id="wp-block-file--media-e099e975-59fd-4b3b-9fb8-67e293b68bbc" href="https://riceball.com/wp-content/uploads/sites/2/2026/09/layout4.zip">layout4</a><a href="https://riceball.com/wp-content/uploads/sites/2/2026/09/layout4.zip" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-e099e975-59fd-4b3b-9fb8-67e293b68bbc">Download</a></div><p>The post <a href="https://riceball.com/2026/09/14/learning-elm-fourth-try-with-the-llm-layout-tests/">Learning Elm: fourth try with the LLM layout tests</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/09/14/learning-elm-fourth-try-with-the-llm-layout-tests/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learning Elm: trying different LLMs to make a layout attempt 3</title>
		<link>https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-3/</link>
					<comments>https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-3/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 13 Sep 2026 21:17:17 +0000</pubDate>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<category><![CDATA[Thaura]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30504</guid>

					<description><![CDATA[<p>Testing to see how the models do writing Elm code. Third try. AGENTS.md was edited to address a lot of bugs and problems from the second run. Also added a directory for more extensive coding advice. You can find it in the ZIP file. The file is now 61 lines long. Scoreboard I used the [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-3/">Learning Elm: trying different LLMs to make a layout attempt 3</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Testing to see how the models do writing Elm code. Third try.</p>



<p class="wp-block-paragraph">AGENTS.md was edited to address a lot of bugs and problems from the second run. Also added a directory for more extensive coding advice. You can find it in the ZIP file.</p>



<div class="wp-block-kevinbatdorf-code-block-pro cbp-has-line-numbers" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;--cbp-line-number-color:#D4D4D4;--cbp-line-number-width:calc(2 * 0.6 * .875rem);line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly># Layout Test

## Tools

Language: elm
Elm tool is at /home/johnk/.local/bin/elm
The Elm version is 19.2. Write code for version 19.0 to 19.2. A lot of training data from before 2019 may be out of date.
Add Elm modules as needed using the `elm install` tool. Prefer libraries to writing new code.
Do not try to copy the library into the correct location. Use `elm install` instead.
Assume the compiler works, and if there are compilation errors, assume your code is incorrect.
If the bugs point to naming or lack of definitions, check the import lines.
elm-test is installed for unit testing. 
Playwright and Selenium are installed for frontend tests to check the layout.
  `playwright-cli` is installed, info here: https://www.npmjs.com/package/playwright
  `selenium` is installed. `selenium-webdriver` is installed, info: https://www.npmjs.com/package/selenium-webdriver
For advice and references, see the Tips section below.

## Code to Write

Never try to cd or use .. to get above the project root directory.
  If you need temp files make a tmp/ in the project root.
Directory layout
  Elm sources go in src/
  HTML files, js artifacts from compilation, js code you write, css code you write, and binary assets go in public/.
  The project root contains the elm.json, project.json, composer.json and other package manager files.
  The project root contains .md and .txt files for LLMs and people. llm-advice as well.
  Tests go in tests/
Make a mockup layout in Elm for a News website, with a short top banner, and 3 columns: 
  Title is "Test News Site".
  Top banner is around 2 cm on a desktop screen, and 25% of a vertical mobile screen.
  left column nav, center column feature area, right colum listing of additional news. Widths approximately 20%, 60%, 20%.
  Theme colors: light gray background, dark gray text, dark blue links.
  Layout is responsive to mobile, tablet, and desktop size screens.
  Use common CSS class naming conventions when possible. See: ./llm-advice/css-class-naming-conventions.txt
Static files:
  Use CSS, making the CSS file external in public/style.css.
  Compile the Elm code into javscript code, and put it into the public/ directory, or the public/js directory.
  Create public/index.html file to pull in CSS. 
  URL references in the static files should be relative, not absolute.
    Assume I'm starting `elm reactor` in the project root, not inside public/, so always use relative paths.
The layout should loop over arrays to construct the center and right columns. 
  The center column array is a list of news headlines, URLs, and URLs to images (located in the public/images directory).
  Center colum items have an image, headline, and excerpt.
  The right column array is a list of news headlines and URLs.
  The left column contains a simple nav with: Home, Local News, Breaking News.
Testing
  At the very minimum, create a Playwright test to check that the browser can display the layout.
  Often, code compiles and works, but the index.html file has bad URLs that won't load the artifacts.
    Problems include: /main.js - absolute path doesn't work; ../dist/main.js - the http server doesn't allow going up a directory.
    Solution is to use relative paths, and generate artifacts in public/, and then use url: main.js
    Same has happened with CSS files.

## Tips

The following advice below may help avoid getting into endless debugging loops.
Important: the assumption that the tools and compilers are not working often leads to looping over tests that keep failing. This is because you are falling into the compiler developers test code. Assume that the elm compiler is correct. If it keeps failing, stop and tell the user.
Read about shadowing: ./llm-advice/shadowing.txt
Current calling convention in index.html is Elm.Main.init({ node: document.getElementById('the-node-id') })
elm-test Refs: https://elmprogramming.com/easy-to-test.html https://github.com/elm-explorations/test
For advice about v19, see: https://raw.githubusercontent.com/elm/compiler/refs/heads/main/docs/upgrade-instructions/0.19.0.md
</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4"># Layout Test</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">## Tools</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Language: elm</span></span>
<span class="line"><span style="color: #D4D4D4">Elm tool is at /home/johnk/.local/bin/elm</span></span>
<span class="line"><span style="color: #D4D4D4">The Elm version is 19.2. Write code for version 19.0 to 19.2. A lot of training data from before 2019 may be out of date.</span></span>
<span class="line"><span style="color: #D4D4D4">Add Elm modules as needed using the `elm install` tool. Prefer libraries to writing new code.</span></span>
<span class="line"><span style="color: #D4D4D4">Do not try to copy the library into the correct location. Use `elm install` instead.</span></span>
<span class="line"><span style="color: #D4D4D4">Assume the compiler works, and if there are compilation errors, assume your code is incorrect.</span></span>
<span class="line"><span style="color: #D4D4D4">If the bugs point to naming or lack of definitions, check the import lines.</span></span>
<span class="line"><span style="color: #D4D4D4">elm-test is installed for unit testing. </span></span>
<span class="line"><span style="color: #D4D4D4">Playwright and Selenium are installed for frontend tests to check the layout.</span></span>
<span class="line"><span style="color: #D4D4D4">  `playwright-cli` is installed, info here: https://www.npmjs.com/package/playwright</span></span>
<span class="line"><span style="color: #D4D4D4">  `selenium` is installed. `selenium-webdriver` is installed, info: https://www.npmjs.com/package/selenium-webdriver</span></span>
<span class="line"><span style="color: #D4D4D4">For advice and references, see the Tips section below.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">## Code to Write</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Never try to cd or use .. to get above the project root directory.</span></span>
<span class="line"><span style="color: #D4D4D4">  If you need temp files make a tmp/ in the project root.</span></span>
<span class="line"><span style="color: #D4D4D4">Directory layout</span></span>
<span class="line"><span style="color: #D4D4D4">  Elm sources go in src/</span></span>
<span class="line"><span style="color: #D4D4D4">  HTML files, js artifacts from compilation, js code you write, css code you write, and binary assets go in public/.</span></span>
<span class="line"><span style="color: #D4D4D4">  The project root contains the elm.json, project.json, composer.json and other package manager files.</span></span>
<span class="line"><span style="color: #D4D4D4">  The project root contains .md and .txt files for LLMs and people. llm-advice as well.</span></span>
<span class="line"><span style="color: #D4D4D4">  Tests go in tests/</span></span>
<span class="line"><span style="color: #D4D4D4">Make a mockup layout in Elm for a News website, with a short top banner, and 3 columns: </span></span>
<span class="line"><span style="color: #D4D4D4">  Title is &quot;Test News Site&quot;.</span></span>
<span class="line"><span style="color: #D4D4D4">  Top banner is around 2 cm on a desktop screen, and 25% of a vertical mobile screen.</span></span>
<span class="line"><span style="color: #D4D4D4">  left column nav, center column feature area, right colum listing of additional news. Widths approximately 20%, 60%, 20%.</span></span>
<span class="line"><span style="color: #D4D4D4">  Theme colors: light gray background, dark gray text, dark blue links.</span></span>
<span class="line"><span style="color: #D4D4D4">  Layout is responsive to mobile, tablet, and desktop size screens.</span></span>
<span class="line"><span style="color: #D4D4D4">  Use common CSS class naming conventions when possible. See: ./llm-advice/css-class-naming-conventions.txt</span></span>
<span class="line"><span style="color: #D4D4D4">Static files:</span></span>
<span class="line"><span style="color: #D4D4D4">  Use CSS, making the CSS file external in public/style.css.</span></span>
<span class="line"><span style="color: #D4D4D4">  Compile the Elm code into javscript code, and put it into the public/ directory, or the public/js directory.</span></span>
<span class="line"><span style="color: #D4D4D4">  Create public/index.html file to pull in CSS. </span></span>
<span class="line"><span style="color: #D4D4D4">  URL references in the static files should be relative, not absolute.</span></span>
<span class="line"><span style="color: #D4D4D4">    Assume I&#39;m starting `elm reactor` in the project root, not inside public/, so always use relative paths.</span></span>
<span class="line"><span style="color: #D4D4D4">The layout should loop over arrays to construct the center and right columns. </span></span>
<span class="line"><span style="color: #D4D4D4">  The center column array is a list of news headlines, URLs, and URLs to images (located in the public/images directory).</span></span>
<span class="line"><span style="color: #D4D4D4">  Center colum items have an image, headline, and excerpt.</span></span>
<span class="line"><span style="color: #D4D4D4">  The right column array is a list of news headlines and URLs.</span></span>
<span class="line"><span style="color: #D4D4D4">  The left column contains a simple nav with: Home, Local News, Breaking News.</span></span>
<span class="line"><span style="color: #D4D4D4">Testing</span></span>
<span class="line"><span style="color: #D4D4D4">  At the very minimum, create a Playwright test to check that the browser can display the layout.</span></span>
<span class="line"><span style="color: #D4D4D4">  Often, code compiles and works, but the index.html file has bad URLs that won&#39;t load the artifacts.</span></span>
<span class="line"><span style="color: #D4D4D4">    Problems include: /main.js - absolute path doesn&#39;t work; ../dist/main.js - the http server doesn&#39;t allow going up a directory.</span></span>
<span class="line"><span style="color: #D4D4D4">    Solution is to use relative paths, and generate artifacts in public/, and then use url: main.js</span></span>
<span class="line"><span style="color: #D4D4D4">    Same has happened with CSS files.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">## Tips</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">The following advice below may help avoid getting into endless debugging loops.</span></span>
<span class="line"><span style="color: #D4D4D4">Important: the assumption that the tools and compilers are not working often leads to looping over tests that keep failing. This is because you are falling into the compiler developers test code. Assume that the elm compiler is correct. If it keeps failing, stop and tell the user.</span></span>
<span class="line"><span style="color: #D4D4D4">Read about shadowing: ./llm-advice/shadowing.txt</span></span>
<span class="line"><span style="color: #D4D4D4">Current calling convention in index.html is Elm.Main.init({ node: document.getElementById(&#39;the-node-id&#39;) })</span></span>
<span class="line"><span style="color: #D4D4D4">elm-test Refs: https://elmprogramming.com/easy-to-test.html https://github.com/elm-explorations/test</span></span>
<span class="line"><span style="color: #D4D4D4">For advice about v19, see: https://raw.githubusercontent.com/elm/compiler/refs/heads/main/docs/upgrade-instructions/0.19.0.md</span></span>
<span class="line"></span></code></pre></div>



<p class="wp-block-paragraph">The file is now 61 lines long.</p>



<h2 class="wp-block-heading">Scoreboard</h2>



<p class="wp-block-paragraph">I used the Free versions in OpenCode.</p>



<p class="wp-block-paragraph">The number scores are about how good the layout looks. The first one is scored 5, and subsequent scores are based on how good it looks relative to the first one.</p>



<p class="wp-block-paragraph">I am not going to try and evaluate the &#8220;look&#8221; anymore. All the layouts are basically midrange in quality, and all will require work to look nice. Additionally, it&#8217;s not like I&#8217;ve provided an image of the desired layout, so it seems pointless to compare.</p>



<p class="wp-block-paragraph">Token counts are approximate.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>LLM</th><th>Tokens</th><th>Works?</th><th>Notes</th></tr></thead><tbody><tr><td>Thaura (<a href="https://openlm.ai/qwen3.8/">Qwen3.8</a>)</td><td></td><td>Y</td><td>Basic. Not chatty!</td></tr><tr><td><a href="https://developer.ant-ling.com/en/docs/models/ling/">Ling3.0</a></td><td>42K</td><td>Y</td><td>Had lots of connection errors, but it still produced everything.</td></tr><tr><td><a href="https://mimo.xiaomi.com/mimo-v2-5">MiMo2.5</a></td><td>37K</td><td>YN</td><td>Declared a &#8220;port&#8221; module erroneously. Layout is broken, with right column below left and center. Not tragic.</td></tr><tr><td><a href="https://developer.meta.com/ai/models/muse-spark-1-2/">MuseSpark1.2</a></td><td>43K</td><td>Y</td><td>It just produced it. Seemed to spend time writing test cases.</td></tr><tr><td><a href="https://developer.meta.com/ai/models/muse-spark/">MuseSpark1.3</a></td><td>27K</td><td>Y</td><td>It made 14 tests.</td></tr><tr><td><a href="https://research.nvidia.com/labs/nemotron/Nemotron-3/">Nemotron3</a></td><td>34K</td><td>Y</td><td>Interaction with the model was slow. Seemed to take 90 minutes. I stopped paying attention.</td></tr><tr><td><a href="https://docs.nvidia.com/nim/large-language-models/2.0.10/get-started/advanced/get-started-nemotron-3.5-lightning.html">Nemotron3.5</a></td><td></td><td>N</td><td>** See notes</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">The commands I used:</p>


<pre class="wp-block-code"><span><code class="hljs language-css"><span class="hljs-selector-tag">read</span> <span class="hljs-selector-tag">AGENTS</span><span class="hljs-selector-class">.md</span>
<span class="hljs-selector-tag">build</span> <span class="hljs-selector-tag">it</span> <span class="hljs-selector-tag">--</span> <span class="hljs-selector-tag">sometimes</span></code></span></pre>


<p class="wp-block-paragraph">I expected token counts to rise as the prompts grew, but that didn&#8217;t seem to happen in any appreciable way. Sometimes, the token count decreased. This may be related to my manually setting up and installing as many tools as I thought it&#8217;d need. It may be related to specifying things like filenames and locations explicitly.</p>



<p class="wp-block-paragraph">I told it I would use <code>elm reactor</code> from the project root to view the site, but it seemed like the LLMs preferred to use the http server in Python, and ran it from public/. This could cause it to pass tests that would fail, due to bad paths, if the server ran in the project root.</p>



<p class="wp-block-paragraph">Adding the requirement to produce a Playwright test helped tremendously.</p>



<h2 class="wp-block-heading">Time Spent</h2>



<p class="wp-block-paragraph">I didn&#8217;t keep good track, but until this round, it was around 2-3 hours per to test and produce each of the last three reports, including changes to the prompt in AGENTS.md, building the projects, and posting it to the site.</p>



<p class="wp-block-paragraph">As the prompt got longer, the build times grew to several minutes, and sometimes it felt like 30 minutes or more.</p>



<p class="wp-block-paragraph">This round, Nemotron 3 took over 90 minutes.</p>



<h2 class="wp-block-heading">Nemotron 3.5 Lighting Free</h2>



<p class="wp-block-paragraph">At 13K tokens, it crashed out:</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript shcb-wrap-lines">Let <span class="hljs-string">"action: layout main: 56.tabular: "</span>Ginger Analytics summary full não complete complete deployingتهاء kompletFull完成 الكامل midline—:  clauses <span class="hljs-number">3</span>:<span class="hljs-comment">//umé 1 layouts widths, I, kh</span>
</code></span></pre>


<p class="wp-block-paragraph">Just for giggles, I told it <code>continue</code>. It just spun the spinner several minutes before I quit and restarted.</p>



<p class="wp-block-paragraph">The second time around, it wanted access to /tmp, and I refused it. Then it got into a death spiral at 45K when it couldn&#8217;t figure out how to end a record that starts with &#8216;{&#8216; and that contained a literal list, which looks like [ &#8230; ], with a matching &#8216;}&#8217;.</p>



<h2 class="wp-block-heading">Code Quality</h2>



<p class="wp-block-paragraph">I can&#8217;t evaluate it because I don&#8217;t know Elm well enough &#8211; however, this process of discussing the problem code with LLMs has helped my learning considerably.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">All the models basically completed the code without asking questions, but, once again, Nemotrion 3.5 Lighting Free failed.</p><p>The post <a href="https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-3/">Learning Elm: trying different LLMs to make a layout attempt 3</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-3/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learning Elm: trying different LLMs to make a layout attempt 2</title>
		<link>https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-2/</link>
					<comments>https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-2/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 13 Sep 2026 16:58:56 +0000</pubDate>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<category><![CDATA[Thaura]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30496</guid>

					<description><![CDATA[<p>Testing to see how the models do writing Elm code. I got rid of some requirements, and tried to fix up the AGENTS.md to overcome some problems some models had, and also add references it could study. Scoreboard I used the Free versions in OpenCode. The number scores are about how good the layout looks. [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-2/">Learning Elm: trying different LLMs to make a layout attempt 2</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Testing to see how the models do writing Elm code.</p>



<p class="wp-block-paragraph">I got rid of some requirements, and tried to fix up the AGENTS.md to overcome some problems some models had, and also add references it could study.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly># Layout Test

## Tools

Language: elm
Elm tool is at /home/johnk/.local/bin/elm
The Elm version is 19.2. Write code for version 19.0 to 19.2. A lot of training data from before 2019 may be out of date.
Add Elm modules as needed using the elm install tool. Prefer libraries to writing new code.
Do not try to copy the library into the correct location. Use elm install instead.
Assume the compiler works, and if there are compilation errors, assume your code is incorrect.
If the bugs point to naming or lack of definitions, check the import lines.
elm-test is installed for unit testing. 
Playwright and Selenium are installed for frontend tests to check the layout.
For advice and references, see the Tips section below.

## Code to Write

Make a mockup layout in Elm for a News website, with a short top banner, and 3 columns: 
  Title is "Test News Site".
  Top banner is around 2 cm on a desktop screen, and 25% of a vertical mobile screen.
  left column nav, center column feature area, right colum listing of additional news. Widths approximately 20%, 60%, 20%.
  Theme colors: light gray background, dark gray text, dark blue links.
  Layout is responsive to mobile, tablet, and desktop size screens.
  Use semantic CSS to identify areas, roles. This way, we can map colors to layout.
Static files:
  Use CSS, making the CSS file external in public/style.css.
  Create public/index.html file to pull in CSS. 
The layout should loop over arrays to construct the center and right columns. 
  The center column array is a list of news headlines, URLs, and URLs to images (located in the public/images directory).
  Center colum items have an image, headline, and excerpt.
  The right column array is a list of news headlines and URLs.
  The left column contains a simple nav with: Home, Local News, Breaking News.

## Tips

Current calling convention in index.html is Elm.Main.init({ node: document.getElementById('the-node-id') })
elm-test Refs: https://elmprogramming.com/easy-to-test.html https://github.com/elm-explorations/test
For advice about v19, see: https://raw.githubusercontent.com/elm/compiler/refs/heads/main/docs/upgrade-instructions/0.19.0.md
The assumption that the tools and compilers are not working often leads to looping over tests that keep failing. This is because you are falling into the compiler developers test code. Assume that the provided binary is correct. If it keeps failing, stop and tell the user.
</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4"># Layout Test</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">## Tools</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Language: elm</span></span>
<span class="line"><span style="color: #D4D4D4">Elm tool is at /home/johnk/.local/bin/elm</span></span>
<span class="line"><span style="color: #D4D4D4">The Elm version is </span><span style="color: #F44747">19.2.</span><span style="color: #D4D4D4"> Write code </span><span style="color: #C586C0">for</span><span style="color: #D4D4D4"> version </span><span style="color: #B5CEA8">19.0</span><span style="color: #D4D4D4"> to </span><span style="color: #F44747">19.2.</span><span style="color: #D4D4D4"> A lot of training data from before </span><span style="color: #B5CEA8">2019</span><span style="color: #D4D4D4"> may be out of date.</span></span>
<span class="line"><span style="color: #D4D4D4">Add Elm modules as needed using the elm install tool. Prefer libraries to writing new code.</span></span>
<span class="line"><span style="color: #D4D4D4">Do not try to copy the library into the correct location. Use elm install instead.</span></span>
<span class="line"><span style="color: #D4D4D4">Assume the compiler works, and </span><span style="color: #C586C0">if</span><span style="color: #D4D4D4"> there are compilation errors, assume your code is incorrect.</span></span>
<span class="line"><span style="color: #D4D4D4">If the bugs point to naming or lack of definitions, check the import lines.</span></span>
<span class="line"><span style="color: #D4D4D4">elm-test is installed </span><span style="color: #C586C0">for</span><span style="color: #D4D4D4"> unit testing. </span></span>
<span class="line"><span style="color: #D4D4D4">Playwright and Selenium are installed </span><span style="color: #C586C0">for</span><span style="color: #D4D4D4"> frontend tests to check the layout.</span></span>
<span class="line"><span style="color: #D4D4D4">For advice and references, see the Tips section below.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">## Code to Write</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Make a mockup layout in Elm </span><span style="color: #C586C0">for</span><span style="color: #D4D4D4"> a News website, with a </span><span style="color: #569CD6">short</span><span style="color: #D4D4D4"> top banner, and </span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4"> columns: </span></span>
<span class="line"><span style="color: #D4D4D4">  Title is </span><span style="color: #CE9178">&quot;Test News Site&quot;</span><span style="color: #D4D4D4">.</span></span>
<span class="line"><span style="color: #D4D4D4">  Top banner is around </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4"> cm on a desktop screen, and </span><span style="color: #B5CEA8">25</span><span style="color: #D4D4D4">% of a vertical mobile screen.</span></span>
<span class="line"><span style="color: #D4D4D4">  left column nav, center column feature area, right colum listing of additional news. Widths approximately </span><span style="color: #B5CEA8">20</span><span style="color: #D4D4D4">%, </span><span style="color: #B5CEA8">60</span><span style="color: #D4D4D4">%, </span><span style="color: #B5CEA8">20</span><span style="color: #D4D4D4">%.</span></span>
<span class="line"><span style="color: #D4D4D4">  Theme colors: light gray background, dark gray text, dark blue links.</span></span>
<span class="line"><span style="color: #D4D4D4">  Layout is responsive to mobile, tablet, and desktop size screens.</span></span>
<span class="line"><span style="color: #D4D4D4">  Use semantic CSS to identify areas, roles. This way, we can map colors to layout.</span></span>
<span class="line"><span style="color: #D4D4D4">Static files:</span></span>
<span class="line"><span style="color: #D4D4D4">  Use CSS, making the CSS file external in public/style.css.</span></span>
<span class="line"><span style="color: #D4D4D4">  Create public/index.html file to pull in CSS. </span></span>
<span class="line"><span style="color: #D4D4D4">The layout should loop over arrays to construct the center and right columns. </span></span>
<span class="line"><span style="color: #D4D4D4">  The center column array is a list of news headlines, URLs, and URLs to </span><span style="color: #DCDCAA">images</span><span style="color: #D4D4D4"> (located in the public/images </span><span style="color: #9CDCFE">directory</span><span style="color: #D4D4D4">).</span></span>
<span class="line"><span style="color: #D4D4D4">  Center colum items have an image, headline, and excerpt.</span></span>
<span class="line"><span style="color: #D4D4D4">  The right column array is a list of news headlines and URLs.</span></span>
<span class="line"><span style="color: #D4D4D4">  The left column contains a simple nav with: Home, Local News, Breaking News.</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">## Tips</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Current calling convention in index.html is Elm.Main.</span><span style="color: #DCDCAA">init</span><span style="color: #D4D4D4">({ node: </span><span style="color: #9CDCFE">document</span><span style="color: #D4D4D4">.</span><span style="color: #DCDCAA">getElementById</span><span style="color: #D4D4D4">(</span><span style="color: #CE9178">&#39;the-node-id&#39;</span><span style="color: #D4D4D4">) })</span></span>
<span class="line"><span style="color: #D4D4D4">elm-test Refs: https:</span><span style="color: #6A9955">//elmprogramming.com/easy-to-test.html https://github.com/elm-explorations/test</span></span>
<span class="line"><span style="color: #D4D4D4">For advice about v19, see: https:</span><span style="color: #6A9955">//raw.githubusercontent.com/elm/compiler/refs/heads/main/docs/upgrade-instructions/0.19.0.md</span></span>
<span class="line"><span style="color: #D4D4D4">The assumption that the tools and compilers are not working often leads to looping over tests that keep failing. This is because you are falling into the compiler developers test code. Assume that the provided binary is correct. If it keeps failing, stop and tell the user.</span></span>
<span class="line"></span></code></pre></div>



<h2 class="wp-block-heading">Scoreboard</h2>



<p class="wp-block-paragraph">I used the Free versions in OpenCode.</p>



<p class="wp-block-paragraph">The number scores are about how good the layout looks. The first one is scored 5, and subsequent scores are based on how good it looks relative to the first one.</p>



<figure class="wp-block-table"><table class="has-fixed-layout"><thead><tr><th>LLM</th><th>Tokens</th><th>Works?</th><th>Notes</th></tr></thead><tbody><tr><td>Thaura (Qwen3.8)</td><td></td><td>Y</td><td>Cycled through debugging a lot. Made simple mistakes, and didn&#8217;t really have the correct ways to fix them, but they compounded to make the layout look bad: 2.</td></tr><tr><td>Ling3.0</td><td>42K + 26K</td><td>YN (eventually)</td><td>First whack produced code that didn&#8217;t work, so I had to ask it to write a test; it used Playwright. Then it worked. Looks OK: 5.</td></tr><tr><td>MiMo2.5</td><td>20K</td><td>Y</td><td>One shot and it was OK. Looks so-so: 2. My instruction about &#8220;roles&#8221; was misinterpreted, so I should not use that term.</td></tr><tr><td>MuseSpark1.2</td><td>42K</td><td>Y</td><td><strong>It cheated</strong>: It changed out of it&#8217;s directory to peek at other projects. It made something that looked like Ling. Looks OK: 4.</td></tr><tr><td>MuseSpark1.3</td><td>21K</td><td>Y</td><td>It worked quickly to crank it out. Looks OK: 4. Again, the role stuff caused a detour in the coding.</td></tr><tr><td>Nemotron3</td><td>29K</td><td>YN</td><td>It had a path bug in the index.html that it didn&#8217;t catch, even with a series of Playwright tests. It also left the directories messy. Once corrected, it looked really good: 7.</td></tr><tr><td>Nemotron3.5</td><td></td><td>N</td><td>** Notes</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">I didn&#8217;t do any looks at the code produced.</p>



<p class="wp-block-paragraph">I clearly should not have said &#8220;role&#8221; in the spec. It got interpreted, both times, as an attribute. What I meant was for that some CSS classnames should be based on roles, so I can change the CSS by role. I had that pattern in my head, but not in a document, and the LLM is not only not a mind reader, but I might be out of step with the jargon used in the wild.</p>



<p class="wp-block-paragraph">MuseSpark1.2&#8217;s cheating polluted the results, because it seems to have copied other LLM artifacts.</p>



<h3 class="wp-block-heading">What helped</h3>



<p class="wp-block-paragraph">Telling the LLMs to use version 19 of elm, and providing some references, may have helped. Removing so many requirements may have helped. The coding was a bit quicker, and I didn&#8217;t really have to make any interventions from the LLM going into a rabbithole/loop.</p>



<h2 class="wp-block-heading">Nemotron 3.5 Notes</h2>



<p class="wp-block-paragraph">At 36K tokens, it fell off the cliff:</p>


<pre class="wp-block-code has-d-4-d-4-d-4-color has-text-color has-875-rem-font-size"><span><code class="hljs shcb-wrap-lines">I see the issues - the `Header calls calls needs. calls and need fixing. removed. calls. HTML calls removing3. callcenter. Let me let me. call particul let me let me. call let me let ma let ma let ma letma let let letting moreover</code></span></pre>


<p class="wp-block-paragraph">So I had to start a new session and tell it to read all the files, the AGENTS.md is the goal, and to ignore node_modules and elm-stuff.</p>



<p class="wp-block-paragraph">It was getting caught in loops over shadowing, or reusing a variable name as a parameter to a function. This is possible, but the Elm compiler complains about it.</p>



<p class="wp-block-paragraph">There were other errors it couldn&#8217;t get past &#8211; and it would always try wholly different approaches &#8211; so it doesn&#8217;t have a good &#8220;bag of tricks&#8221; to get past some compiler errors.</p>



<p class="wp-block-paragraph">Eventually, I gave up.</p>



<p class="wp-block-paragraph">Teaching it Elm, and recording each fix into a text file, was getting to be too much.</p>



<h2 class="wp-block-heading">Conclusion</h2>



<p class="wp-block-paragraph">Overall, this new prompt worked a lot better, but it didn&#8217;t work for Nemotron 3.5 Lightning Free.</p>



<p class="wp-block-paragraph">Here&#8217;s the test and all the generated code.</p>



<div class="wp-block-file"><a id="wp-block-file--media-993597cf-d620-4901-b6fb-564cdec7d384" href="https://riceball.com/wp-content/uploads/sites/2/2026/09/layout2.zip">layout2</a><a href="https://riceball.com/wp-content/uploads/sites/2/2026/09/layout2.zip" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-993597cf-d620-4901-b6fb-564cdec7d384">Download</a></div><p>The post <a href="https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-2/">Learning Elm: trying different LLMs to make a layout attempt 2</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/09/13/learning-elm-trying-different-llms-to-make-a-layout-attempt-2/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learning Elm: trying different LLMs to make a layout with minimal interactivity</title>
		<link>https://riceball.com/2026/09/12/learning-elm-trying-different-llms-to-make-a-layout-with-minimal-interactivity/</link>
					<comments>https://riceball.com/2026/09/12/learning-elm-trying-different-llms-to-make-a-layout-with-minimal-interactivity/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sat, 12 Sep 2026 20:34:28 +0000</pubDate>
				<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<category><![CDATA[Thaura]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30492</guid>

					<description><![CDATA[<p>Testing to see how the models do writing Elm code. The goal was to produce a simple web page layout for a news site. To confound things, I said to use the media query to detect if the environment is in dark mode. To make things more &#8220;normal&#8221;, I added one control to toggle &#8220;dark [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/09/12/learning-elm-trying-different-llms-to-make-a-layout-with-minimal-interactivity/">Learning Elm: trying different LLMs to make a layout with minimal interactivity</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">Testing to see how the models do writing Elm code.</p>



<p class="wp-block-paragraph">The goal was to produce a simple web page layout for a news site.</p>



<p class="wp-block-paragraph">To confound things, I said to use the media query to detect if the environment is in dark mode.</p>



<p class="wp-block-paragraph">To make things more &#8220;normal&#8221;, I added one control to toggle &#8220;dark mode&#8221;.</p>



<p class="wp-block-paragraph">I asked it to use Tailwind CSS.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>Language: elm
elm tool is at /home/johnk/.local/bin/elm

Make a mockup layout in Elm for a News website, with a short top banner, and 3 columns: left column nav, center column feature area, right colum listing of additional news. Widths approximately 20%, 60%, 20%.
Top banner is around 2 cm on a desktop screen, and 25% of a vertical mobile screen.
Use Tailwind CSS, and a local CSS, make the CSS file external. Create index.html file to pull in CSS. 
Theme colors support the prefers-color-scheme media query, and has two modes:
  Light mode: light gray background, dark gray text, dark blue links.
  Dark mode: dark blue background, white text, light blue links.
Layout is responsive to mobile, tablet, and desktop size screens.
The layout should loop over arrays to construct the center and right columns. The center column array is a list of news headlines, URLs, and URLs to images (located in the public/images directory), and a story excerpt or teaser. The right column array is a list of news headlines and URLs.
The left column contains a simple nav with: Home, Local News, Breaking News.
The layout should support a single checkbox that will enable the dark mode, located at the bottom of the left column. This switch overrides the prefers-color-scheme media query.
</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">Language</span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> elm</span></span>
<span class="line"><span style="color: #DCDCAA">elm</span><span style="color: #D4D4D4"> tool is at /home/johnk/</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4">local/bin/elm</span></span>
<span class="line"></span>
<span class="line"><span style="color: #D4D4D4">Make a mockup layout </span><span style="color: #C586C0">in </span><span style="color: #D4D4D4">Elm for a News website, with a short top banner, and </span><span style="color: #B5CEA8">3</span><span style="color: #D4D4D4"> columns</span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> left column nav, center column feature area, right colum listing </span><span style="color: #C586C0">of </span><span style="color: #D4D4D4">additional news</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4"> Widths approximately </span><span style="color: #B5CEA8">20</span><span style="color: #D4D4D4">%, </span><span style="color: #B5CEA8">60</span><span style="color: #D4D4D4">%, </span><span style="color: #B5CEA8">20</span><span style="color: #D4D4D4">%</span><span style="color: #569CD6">.</span></span>
<span class="line"><span style="color: #D4D4D4">Top banner is around </span><span style="color: #B5CEA8">2</span><span style="color: #D4D4D4"> cm on a desktop screen, and </span><span style="color: #B5CEA8">25</span><span style="color: #D4D4D4">% </span><span style="color: #C586C0">of </span><span style="color: #D4D4D4">a vertical mobile screen</span><span style="color: #569CD6">.</span></span>
<span class="line"><span style="color: #D4D4D4">Use Tailwind CSS, and a local CSS, make the CSS file external</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4"> Create index</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4">html file to pull </span><span style="color: #C586C0">in </span><span style="color: #D4D4D4">CSS</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4"> </span></span>
<span class="line"><span style="color: #D4D4D4">Theme colors support the prefers-color-scheme media query, and has two modes</span><span style="color: #569CD6">:</span></span>
<span class="line"><span style="color: #D4D4D4">  Light mode</span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> light gray background, dark gray text, dark blue links</span><span style="color: #569CD6">.</span></span>
<span class="line"><span style="color: #D4D4D4">  Dark mode</span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> dark blue background, white text, light blue links</span><span style="color: #569CD6">.</span></span>
<span class="line"><span style="color: #D4D4D4">Layout is responsive to mobile, tablet, and desktop size screens</span><span style="color: #569CD6">.</span></span>
<span class="line"><span style="color: #D4D4D4">The layout should loop over arrays to construct the center and right columns</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4"> The center column array is a list </span><span style="color: #C586C0">of </span><span style="color: #D4D4D4">news headlines, URLs, and URLs to images (located </span><span style="color: #C586C0">in </span><span style="color: #D4D4D4">the public/images directory), and a story excerpt or teaser</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4"> The right column array is a list </span><span style="color: #C586C0">of </span><span style="color: #D4D4D4">news headlines and URLs</span><span style="color: #569CD6">.</span></span>
<span class="line"><span style="color: #D4D4D4">The left column contains a simple nav with</span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> Home, Local News, Breaking News</span><span style="color: #569CD6">.</span></span>
<span class="line"><span style="color: #D4D4D4">The layout should support a single checkbox that will enable the dark mode, located at the bottom </span><span style="color: #C586C0">of </span><span style="color: #D4D4D4">the left column</span><span style="color: #569CD6">.</span><span style="color: #D4D4D4"> This switch overrides the prefers-color-scheme media query</span><span style="color: #569CD6">.</span></span>
<span class="line"></span></code></pre></div>



<h2 class="wp-block-heading">Scoreboard</h2>



<p class="wp-block-paragraph">I used the Free versions in OpenCode.</p>



<figure class="wp-block-table"><table><thead><tr><th>LLM</th><th>Tokens</th><th>Works?</th><th>Notes</th></tr></thead><tbody><tr><td>Thaura (Qwen3.8)</td><td></td><td>N</td><td>Got into a pointless loop. It didn&#8217;t integrate it with the page correctly. Required manual correction. Looks so-so: 5. Dark mode toggle does not work.</td></tr><tr><td>Ling3.0</td><td>51K</td><td>Y</td><td>Not great looking: 2.</td></tr><tr><td>MiMo2.5</td><td>19K</td><td>Y</td><td>Looks workable: 6</td></tr><tr><td>MuseSpark1.2</td><td>20K</td><td>YN</td><td>Can&#8217;t tell if the dark mode toggle works. Looks good: 8</td></tr><tr><td>MuseSpark1.3</td><td>16K</td><td>YN</td><td>Can&#8217;t tell if the dark mode toggle works. Looks good: 7</td></tr><tr><td>Nemotron3 Ultra Free</td><td>24K</td><td>Y</td><td>Very slow to write code. 36mins. Looks good: 8. Dark mode looks a bit odd.</td></tr><tr><td>Nemotron3.5</td><td></td><td>N</td><td>It would get stuck in error loops, and not figure out the problem. It seemed to be coding from a version of Elm before 19. It also doesn&#8217;t reread my edits when I tell it to. Needs a lot of hints to do obvious bug fixes. I had to quit after 60k tokens and lots of interactions.</td></tr></tbody></table></figure>



<p class="wp-block-paragraph">I didn&#8217;t do any looks at the code produced.</p>



<p class="wp-block-paragraph">Note that the fact Nemotron3.5 didn&#8217;t work for me, isn&#8217;t necessarily a reflection of the LLM. I may not know how to tell it to correct itself. I am too new to Elm to be able to suggest alternatives that might activate useful areas in the model.</p>



<p class="wp-block-paragraph">So far, Nemotron3 seems the best, if only because it has the correct look. MiMo looked promising. MuseSpark also looks good, but the control didn&#8217;t work.</p>



<p class="wp-block-paragraph">I can pore over the code, but can&#8217;t really evaluate the quality, because I&#8217;m so new to Elm.</p>



<p class="wp-block-paragraph">The following file contains the code produced by the LLMs. You can use <code>elm reactor</code> to run a server that will show the site.</p>



<div class="wp-block-file"><a id="wp-block-file--media-0a168f58-7a6f-4e50-808c-3c8b47e51836" href="https://riceball.com/wp-content/uploads/sites/2/2026/09/test-layout.zip">test-layout</a><a href="https://riceball.com/wp-content/uploads/sites/2/2026/09/test-layout.zip" class="wp-block-file__button wp-element-button" download aria-describedby="wp-block-file--media-0a168f58-7a6f-4e50-808c-3c8b47e51836">Download</a></div><p>The post <a href="https://riceball.com/2026/09/12/learning-elm-trying-different-llms-to-make-a-layout-with-minimal-interactivity/">Learning Elm: trying different LLMs to make a layout with minimal interactivity</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/09/12/learning-elm-trying-different-llms-to-make-a-layout-with-minimal-interactivity/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learning Elm: LLMs</title>
		<link>https://riceball.com/2026/09/10/learning-elm-llms/</link>
					<comments>https://riceball.com/2026/09/10/learning-elm-llms/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 11 Sep 2026 05:40:48 +0000</pubDate>
				<category><![CDATA[Human Learning]]></category>
		<category><![CDATA[Machine Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<category><![CDATA[Thaura]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30485</guid>

					<description><![CDATA[<p>I&#8217;ve been messing with some LLMs to write Elm code. So far, so-so. I haven&#8217;t done a thorough test, mainly because I&#8217;m still learning Elm, but some LLMs seem to do great with Elm code, and some seem to run endless loops of debugging failures. I&#8217;ve been playing with Nemotron, Muse Spark, MiMo, and Thaura [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/09/10/learning-elm-llms/">Learning Elm: LLMs</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">I&#8217;ve been messing with some LLMs to write Elm code. So far, so-so.</p>



<p class="wp-block-paragraph">I haven&#8217;t done a thorough test, mainly because I&#8217;m still learning Elm, but some LLMs seem to do great with Elm code, and some seem to run endless loops of debugging failures. I&#8217;ve been playing with Nemotron, Muse Spark, MiMo, and Thaura Work.</p>



<p class="wp-block-paragraph">The debugging cycles are <strong>super nice</strong>. When things are working well,<strong> the code generated compiles the first time, or after one or two cycles through the compiler</strong>.</p>



<p class="wp-block-paragraph">One time, I asked to replicate the layout of an Indymedia site, and gave a brief description of what it was, and what parts I wanted. It cranked out the code quickly, and it compiled, and it looked nice.</p>



<p class="wp-block-paragraph">Even more important: it was under 100 lines of Html library code. The CSS was a bit longer.</p>



<p class="wp-block-paragraph">Thaura advised using <a href="https://elm-pages.com">https://elm-pages.com</a>, and at least one LLM produced code that compiled.</p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://riceball.com/2026/09/10/learning-elm-llms/">Learning Elm: LLMs</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/09/10/learning-elm-llms/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learning Elm: pipe tricks</title>
		<link>https://riceball.com/2026/09/03/learning-elm-pipe-tricks/</link>
					<comments>https://riceball.com/2026/09/03/learning-elm-pipe-tricks/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Fri, 04 Sep 2026 05:23:31 +0000</pubDate>
				<category><![CDATA[Human Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30413</guid>

					<description><![CDATA[<p>https://github.com/elm/compiler/tree/main/hints I found much of the content for this article at: https://sporto.gitbooks.io/elm-tutorial/content/en/01-foundations/02-functions.html Here&#8217;s now to create a learning environment where you can edit a file full of Elm code, and play with the code. Add the &#8220;.&#8221; directory to elm.json. This will tell Elm to search for modules in there: Next up, make the file [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/09/03/learning-elm-pipe-tricks/">Learning Elm: pipe tricks</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph"><a href="https://github.com/elm/compiler/tree/main/hints">https://github.com/elm/compiler/tree/main/hints</a></p>



<p class="wp-block-paragraph">I found much of the content for this article at: <a href="https://sporto.gitbooks.io/elm-tutorial/content/en/01-foundations/02-functions.html">https://sporto.gitbooks.io/elm-tutorial/content/en/01-foundations/02-functions.html</a></p>



<p class="wp-block-paragraph">Here&#8217;s now to create a learning environment where you can edit a file full of Elm code, and play with the code.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly># make a directory and turn it into an Elm project
mkdir elm
cd elm
elm init

# fire up an editor
gedit &amp;

# open up an elm console
elm repl</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #6A9955"># make a directory and turn it into an Elm project</span></span>
<span class="line"><span style="color: #DCDCAA">mkdir</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">elm</span></span>
<span class="line"><span style="color: #DCDCAA">cd</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">elm</span></span>
<span class="line"><span style="color: #DCDCAA">elm</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">init</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955"># fire up an editor</span></span>
<span class="line"><span style="color: #DCDCAA">gedit</span><span style="color: #D4D4D4"> &amp;</span></span>
<span class="line"></span>
<span class="line"><span style="color: #6A9955"># open up an elm console</span></span>
<span class="line"><span style="color: #DCDCAA">elm</span><span style="color: #D4D4D4"> </span><span style="color: #CE9178">repl</span></span></code></pre></div>



<p class="wp-block-paragraph">Add the &#8220;.&#8221; directory to elm.json. This will tell Elm to search for modules in there:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>    "source-directories": &#91;
        "src",
        "."
    &#93;,</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #D4D4D4">    </span><span style="color: #CE9178">&quot;source-directories&quot;</span><span style="color: #D4D4D4">: &#91;</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&quot;src&quot;</span><span style="color: #D4D4D4">,</span></span>
<span class="line"><span style="color: #D4D4D4">        </span><span style="color: #CE9178">&quot;.&quot;</span></span>
<span class="line"><span style="color: #D4D4D4">    &#93;,</span></span></code></pre></div>



<p class="wp-block-paragraph">Next up, make the file Sample.elm, and just keep it open in the editor:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>module Sample exposing (..)

add : Int -> Int -> Int
add a b = a + b

mul : Int -> Int -> Int
mul a b = a * b

sub : Int -> Int -> Int
sub a b = a - b</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #569CD6">module</span><span style="color: #D4D4D4"> Sample </span><span style="color: #569CD6">exposing</span><span style="color: #D4D4D4"> (..)</span></span>
<span class="line"></span>
<span class="line"><span style="color: #DCDCAA">add</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">Int</span><span style="color: #D4D4D4"> -&gt; </span><span style="color: #569CD6">Int</span><span style="color: #D4D4D4"> -&gt; </span><span style="color: #569CD6">Int</span></span>
<span class="line"><span style="color: #DCDCAA">add</span><span style="color: #D4D4D4"> a b </span><span style="color: #569CD6">=</span><span style="color: #D4D4D4"> a + b</span></span>
<span class="line"></span>
<span class="line"><span style="color: #DCDCAA">mul</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">Int</span><span style="color: #D4D4D4"> -&gt; </span><span style="color: #569CD6">Int</span><span style="color: #D4D4D4"> -&gt; </span><span style="color: #569CD6">Int</span></span>
<span class="line"><span style="color: #DCDCAA">mul</span><span style="color: #D4D4D4"> a b </span><span style="color: #569CD6">=</span><span style="color: #D4D4D4"> a * b</span></span>
<span class="line"></span>
<span class="line"><span style="color: #DCDCAA">sub</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">:</span><span style="color: #D4D4D4"> </span><span style="color: #569CD6">Int</span><span style="color: #D4D4D4"> -&gt; </span><span style="color: #569CD6">Int</span><span style="color: #D4D4D4"> -&gt; </span><span style="color: #569CD6">Int</span></span>
<span class="line"><span style="color: #DCDCAA">sub</span><span style="color: #D4D4D4"> a b </span><span style="color: #569CD6">=</span><span style="color: #D4D4D4"> a - b</span></span></code></pre></div>



<p class="wp-block-paragraph">That&#8217;s a bunch of <a href="https://sporto.gitbooks.io/elm-tutorial/content/en/01-foundations/02-functions.html">function definitions</a>.</p>



<p class="wp-block-paragraph">Jump back to the Elm REPL in the terminal:</p>



<pre class="wp-block-preformatted has-base-color has-contrast-background-color has-text-color has-background has-link-color wp-elements-4">&gt; import Sample exposing (..)<br>&gt; mul 2 3<br>6<br>&gt; sub 1 2<br>-1</pre>



<p class="wp-block-paragraph">You can type in more function definitions, and they&#8217;ll be available when you type them into the REPL.</p>



<p class="wp-block-paragraph">So, we&#8217;ve created functions so we can type out a language that looks like LISP:</p>


<div class="wp-block-html alignfull">
<pre>&gt; (add 1 2)
<font color="#FF55FF">3</font><font color="#555555"> : Int</font>
&gt; (add (mul 2 2) (mul 5 2) )
<font color="#FF55FF">14</font><font color="#555555"> : Int</font>
&gt; mul (add 2 3) (mul 2 2)
<font color="#FF55FF">20</font><font color="#555555"> : Int</font>
&gt; add (mul (mul 2 3) 5)
<font color="#00AAAA">&lt;function&gt;</font><font color="#555555"> : Int -&gt; Int</font>
&gt; add (mul (mul 2 3) 5) 100
<font color="#FF55FF">130</font><font color="#555555"> : Int</font>
</pre>
</div>


<p class="wp-block-paragraph">That second to last call to add returned a function. The function takes one argument. Putting a 100 after it added 30 to the 100.</p>



<p class="wp-block-paragraph">(add 1) returns a function that takes one argument, and returns a value that&#8217;s one added to the argument.</p>



<p class="wp-block-paragraph">(add 9) returns a function that takes one argument, and returns a value that&#8217;s 9 added to the argument.</p>



<p class="wp-block-paragraph">Elm has some syntax that messes with the ordering, called a pipe. Here&#8217;s the pipe in action:</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>records
    |> map getCost
    |> filter (isOver 100)
    |> sum</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">records</span></span>
<span class="line"><span style="color: #D4D4D4">    |&gt; map getCost</span></span>
<span class="line"><span style="color: #D4D4D4">    |&gt; filter (isOver </span><span style="color: #B5CEA8">100</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">    |&gt; sum</span></span></code></pre></div>



<p class="wp-block-paragraph">So, that makes sense. It&#8217;s like Unix pipes. Records piped into map getCost, piped into filter (isOver 100), piped into sum.</p>



<p class="wp-block-paragraph">In English: all the costs from records, filtered to be over 100, and summed.</p>



<p class="wp-block-paragraph">The pipe, |&gt;, rearranges the way functions work. These two function calls are the same:</p>



<pre class="wp-block-preformatted has-base-color has-contrast-background-color has-text-color has-background has-link-color wp-elements-5">&gt; add 1 2<br>3 : Int<br>&gt; 2 |&gt; add 1<br>3 : Int</pre>



<p class="wp-block-paragraph">What&#8217;s going on?</p>



<p class="wp-block-paragraph">&#8220;2 |&gt; add 1&#8221; means 2 passed to add 1.  What is &#8220;add 1&#8221;? </p>



<p class="wp-block-paragraph">(add 1) returns a function that takes a single argument, and adds 1 to it.</p>



<p class="wp-block-paragraph">The following are all the same ((2 + 3) * (2 * 2)):</p>



<pre class="wp-block-preformatted">&gt; mul (add 2 3) (mul 2 2)<br>20 : Int<br>&gt; (mul 2 2) |&gt; mul (add 2 3)<br>20 : Int<br>&gt; (2 |&gt; mul 2) |&gt; mul (3 |&gt; add 2)<br>20 : Int<br>&gt; 2 |&gt; mul 2 |&gt; mul (3 |&gt; add 2)<br>20 : Int</pre>



<p class="wp-block-paragraph">You can reformat the last one in the indented pipes layout:</p>



<pre class="wp-block-preformatted">2<br>    |&gt; mul 2<br>    |&gt; mul (3 |&gt; add 2)</pre>



<p class="wp-block-paragraph">Yeah, it doesn&#8217;t make anything clearer, but you can try to work out how Elm evaluates the final value, and it will help clarify the pipe |&gt;.</p>



<p class="wp-block-paragraph">To show what I mean, I&#8217;ll highlight (in red) functions that can resolve to a function:</p>



<pre class="wp-block-preformatted">2<br>    |&gt; <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-windpress-red-600-color">mul 2</mark></strong><br>    |&gt; mul (3 |&gt; <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-windpress-red-600-color">add 2</mark></strong>)</pre>



<p class="wp-block-paragraph">Next, we pass values (on the left of the |&gt;) into these functions, and they evaluate to values (in green).</p>



<pre class="wp-block-preformatted"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-windpress-emerald-600-color"><strong>4</strong></mark><br>    |&gt; mul <mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-windpress-emerald-600-color"><strong>5</strong></mark></pre>



<p class="wp-block-paragraph">That mul 5 will return a function:</p>



<pre class="wp-block-preformatted"><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-windpress-emerald-600-color"><strong>4</strong></mark><br>    |&gt; <strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-windpress-red-600-color">mul 5</mark></strong></pre>



<p class="wp-block-paragraph">Then, we pass 4 into the function returned by (mul 5) and evaluate.</p>



<pre class="wp-block-preformatted"><strong><mark style="background-color:rgba(0, 0, 0, 0)" class="has-inline-color has-windpress-teal-700-color">20</mark></strong></pre>



<p class="wp-block-paragraph">Obviously, there are more appropriate places to use pipe notation, and this isn&#8217;t one of them.</p>



<p class="wp-block-paragraph">This example below, however, is a good use of pipes.</p>



<div class="wp-block-kevinbatdorf-code-block-pro" data-code-block-pro-font-family="Code-Pro-JetBrains-Mono" style="font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)"><span role="button" tabindex="0" style="color:#D4D4D4;display:none" aria-label="Copy" class="code-block-pro-copy-button"><pre class="code-block-pro-copy-button-pre" aria-hidden="true"><textarea class="code-block-pro-copy-button-textarea" tabindex="-1" aria-hidden="true" readonly>records
    |> map getCost
    |> filter (isOver 100)
    |> sum</textarea></pre><svg xmlns="http://www.w3.org/2000/svg" style="width:24px;height:24px" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2"><path class="with-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4"></path><path class="without-check" stroke-linecap="round" stroke-linejoin="round" d="M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2"></path></svg></span><pre class="shiki dark-plus" style="background-color: #1E1E1E" tabindex="0"><code><span class="line"><span style="color: #DCDCAA">records</span></span>
<span class="line"><span style="color: #D4D4D4">    |&gt; map getCost</span></span>
<span class="line"><span style="color: #D4D4D4">    |&gt; filter (isOver </span><span style="color: #B5CEA8">100</span><span style="color: #D4D4D4">)</span></span>
<span class="line"><span style="color: #D4D4D4">    |&gt; sum</span></span></code></pre></div>



<p class="wp-block-paragraph">That is the same as:</p>



<pre class="wp-block-preformatted has-windpress-yellow-300-color has-secondary-background-color has-text-color has-background has-link-color wp-elements-6">(sum (filter (isOver 100) (map getCost records)))</pre>



<p class="wp-block-paragraph"></p><p>The post <a href="https://riceball.com/2026/09/03/learning-elm-pipe-tricks/">Learning Elm: pipe tricks</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/09/03/learning-elm-pipe-tricks/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
		<item>
		<title>Learning Elm</title>
		<link>https://riceball.com/2026/08/29/learning-elm/</link>
					<comments>https://riceball.com/2026/08/29/learning-elm/#respond</comments>
		
		<dc:creator><![CDATA[admin]]></dc:creator>
		<pubDate>Sun, 30 Aug 2026 01:46:45 +0000</pubDate>
				<category><![CDATA[Human Learning]]></category>
		<category><![CDATA[Elm]]></category>
		<guid isPermaLink="false">https://riceball.com/?p=30380</guid>

					<description><![CDATA[<p>I was having a hard time with the main tutorial, so I&#8217;m winding a different path through the language. 8/29: After doing the basics, I started hitting walls, and found the tutorial going all over the place, so I decided to dig through the Elm core libraries, and just try running commands: https://package.elm-lang.org/packages/elm/core/latest/ Typing things [&#8230;]</p>
<p>The post <a href="https://riceball.com/2026/08/29/learning-elm/">Learning Elm</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></description>
										<content:encoded><![CDATA[<p class="wp-block-paragraph">I was having a hard time with the <a href="https://guide.elm-lang.org/">main tutorial</a>, so I&#8217;m winding a different path through the language.</p>



<div class="wp-block-group has-windpress-slate-200-background-color has-background has-global-padding is-layout-constrained wp-container-core-group-is-layout-9bf84538 wp-block-group-is-layout-constrained" style="padding-top:var(--wp--preset--spacing--30);padding-right:var(--wp--preset--spacing--30);padding-bottom:var(--wp--preset--spacing--30);padding-left:var(--wp--preset--spacing--30)">
<p class="wp-block-paragraph">8/29: After doing the basics, I started hitting walls, and found the tutorial going all over the place, so I decided to dig through the Elm core libraries, and just try running commands: <a href="https://package.elm-lang.org/packages/elm/core/latest/">https://package.elm-lang.org/packages/elm/core/latest/</a></p>



<p class="wp-block-paragraph">Typing things out helps me to understand the syntax and also the notation in the docs.</p>
</div>



<p class="wp-block-paragraph">To get started, you need to <a href="https://guide.elm-lang.org/install/elm.html">install Elm</a>. Then, you&#8217;ll get the <code>elm</code> command, which is like <code>npm</code> or <code>composer</code>.  <code>elm</code> is a package manager and a build tool. Here&#8217;s part of the help when you type &#8220;elm&#8221;:</p>



<pre class="wp-block-preformatted">elm repl --help<br>elm init --help<br>elm reactor --help<br>elm make --help<br>elm install --help<br>elm bump --help<br>elm diff --help<br>elm publish --help</pre>



<p class="wp-block-paragraph">The main tools to use as a beginner are <code>elm reactor</code>, the web browser dev tool, and <code>elm repl</code>, the &#8220;console&#8221; where you can type Elm code and try it out.</p>



<p class="wp-block-paragraph">I started with <a href="https://package.elm-lang.org/packages/elm/core/latest/Array">Array</a>, <a href="https://package.elm-lang.org/packages/elm/core/latest/List">List</a>, and <a href="https://package.elm-lang.org/packages/elm/core/latest/Maybe">Maybe</a>. Also see the <a href="https://elm-lang.org/docs/syntax">syntax reference card</a> and the <a href="https://guide.elm-lang.org/core_language">core language reference</a>.</p>



<p class="wp-block-paragraph">It was a good way to get familiar with the notation:</p>


<pre class="wp-block-code"><span><code class="hljs language-php">fromList : <span class="hljs-keyword">List</span> a -&gt; <span class="hljs-keyword">Array</span> a</code></span></pre>


<p class="wp-block-paragraph">The Array.fromList function takes a list as an argument, and returns an array.</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript">push : a -&gt; <span class="hljs-built_in">Array</span> a -&gt; <span class="hljs-built_in">Array</span> a</code></span></pre>


<p class="wp-block-paragraph">The push function takes a value, and an array as arguments, and returns an array with the value appended to the end.</p>



<p class="wp-block-paragraph">Arrays and Lists made sense, but Maybe was different. Type these lines into the REPL.</p>


<pre class="wp-block-code"><span><code class="hljs language-javascript"><span class="hljs-keyword">import</span> <span class="hljs-built_in">Array</span> exposing (..)

x = fromList &#91;<span class="hljs-number">1</span>, <span class="hljs-number">2</span>, <span class="hljs-number">3</span>]
<span class="hljs-keyword">get</span> 1 x

-- returns Just 2 : Maybe number
</code></span></pre>


<p class="wp-block-paragraph">The return value, Just 2, is not 2. You expect 2, but get Just 2. What is up with that?</p>



<p class="wp-block-paragraph">Just 2 is of type Maybe. Maybe values can be &#8220;Just number&#8221; or &#8220;Nothing&#8221;. From the docs:</p>



<pre class="wp-block-preformatted">type Maybe a<br>    = Just a<br>    | Nothing</pre>



<p class="wp-block-paragraph">&#8220;Represent values that may or may not exist. It can be useful if you have a record field that is only filled in sometimes. Or if a function takes a value sometimes, but does not absolutely need it.&#8221;</p>



<p class="wp-block-paragraph">So, this looked weird to me, but here&#8217;s a quick way to convert it to a normal value:</p>


<pre class="wp-block-code"><span><code class="hljs">-- here's the function
withDefault : a -&gt; Maybe a -&gt; a

-- usage
withDefault 0 (Just 2)
-- returns the value 2 : number</code></span></pre>


<p class="wp-block-paragraph">OK, that is still weird. (Most languages have type coercion or functions to convert values.)</p>



<p class="wp-block-paragraph">Here&#8217;s an example from the <a href="https://elm-lang.org/docs/syntax">syntax guide</a>:</p>


<pre class="wp-block-code"><span><code class="hljs language-xml"><span class="hljs-tag">&lt;<span class="hljs-name">code</span>&gt;</span>case maybeList of
    Just xs -&gt; xs
    Nothing -&gt; &#91;]<span class="hljs-tag">&lt;/<span class="hljs-name">code</span>&gt;</span></code></span></pre>


<p class="wp-block-paragraph">This is a different way to coerce values. It switches based on the <strong>type variant</strong> of maybeList.</p>



<p class="wp-block-paragraph">So <strong>Maybe</strong> is a <strong>type</strong>, with two <strong>variants</strong> &#8220;<strong>Just</strong> xs&#8221; and &#8220;<strong>Nothing</strong>&#8220;.</p>



<p class="wp-block-paragraph">The case switching isn&#8217;t based on the value of the variable, but on the variant.</p>



<p class="wp-block-paragraph">(This might look like a variant is, itself, a type. This isn&#8217;t the case, because maybeList must be a Maybe. The case switch will match only variants of Maybe. This is more restrictive than the case switch statements you see in OOP languages with a typeof() operator.)</p>



<p class="has-tertiary-background-color has-background wp-block-paragraph">I&#8217;ll stop at this point, because types are important to Elm. I have to spend more time studying it. It&#8217;s reminding me of types in Haskell: and that means it&#8217;s part of how the program executes.</p>



<p class="wp-block-paragraph"><a href="https://dev.to/jigargosar/elm-vs-the-feature-addiction-epidemic-in-programming-ach">https://dev.to/jigargosar/elm-vs-the-feature-addiction-epidemic-in-programming-ach</a></p>



<p class="wp-block-paragraph"><a href="https://riptutorial.com/elm">https://riptutorial.com/elm</a></p>



<p class="wp-block-paragraph"><a href="https://guide.elm-lang.org/types">https://guide.elm-lang.org/types</a></p>



<p class="wp-block-paragraph"><a href="https://learnyouanelm.github.io/pages/03-types.html">https://learnyouanelm.github.io/pages/03-types.html</a></p>



<p class="wp-block-paragraph"><a href="https://www.elmcraft.org/">https://www.elmcraft.org/</a> </p>



<p class="wp-block-paragraph"><a href="https://elmprogramming.com/">https://elmprogramming.com/</a></p>



<p class="wp-block-paragraph"><a href="https://lamdera.com">https://lamdera.com</a></p>



<p class="wp-block-paragraph"><a href="https://github.com/sporto/awesome-elm">https://github.com/sporto/awesome-elm</a></p>



<p class="wp-block-paragraph"><a href="https://pragmaticstudio.com/tutorials/what-is-elm">https://pragmaticstudio.com/tutorials/what-is-elm</a></p>



<p class="wp-block-paragraph"><a href="https://www.sitepoint.com/functional-reactive-programming-elm-introduction/#google_vignette">https://www.sitepoint.com/functional-reactive-programming-elm-introduction/#google_vignette</a></p>



<p class="wp-block-paragraph"><a href="https://en.wikibooks.org/wiki/Elm_programming_language">https://en.wikibooks.org/wiki/Elm_programming_language</a></p>



<p class="wp-block-paragraph"><a href="https://www.toptal.com/developers/front-end/getting-started-elm-language">https://www.toptal.com/developers/front-end/getting-started-elm-language</a></p>



<p class="wp-block-paragraph"><a href="https://dev.to/marciofrayze/why-is-elm-such-a-delightful-programming-language-2em8">https://dev.to/marciofrayze/why-is-elm-such-a-delightful-programming-language-2em8</a></p>



<p class="wp-block-paragraph"><a href="https://github.com/elm">https://github.com/elm</a></p>



<p class="wp-block-paragraph"></p><p>The post <a href="https://riceball.com/2026/08/29/learning-elm/">Learning Elm</a> first appeared on <a href="https://riceball.com">🍙</a>.</p>]]></content:encoded>
					
					<wfw:commentRss>https://riceball.com/2026/08/29/learning-elm/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
