<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
  <title>Ant News</title>
  <subtitle>Releases and notes from the Ant project.</subtitle>
  <link href="https://ant-lang.org/news/"/>
  <link rel="self" href="https://ant-lang.org/feed.xml"/>
  <id>https://ant-lang.org/news/</id>
  <icon>https://ant-lang.org/favicon.png</icon>
  <author><name>Anton Medvedev</name></author>
  <updated>2026-11-20T00:00:00Z</updated>
  <entry>
    <title>Every error in one run</title>
    <link href="https://ant-lang.org/news/ant-0-3"/>
    <id>https://ant-lang.org/news/ant-0-3</id>
    <published>2026-11-20T00:00:00Z</published>
    <updated>2026-11-20T00:00:00Z</updated>
    <summary>ant check reports every error in a project at once, ant code navigates from the shell, and ant test checks before it runs.</summary>
    <content type="html" xml:base="https://ant-lang.org/news/ant-0-3">&lt;p&gt;Ant 0.3 changes the tools, not the language. Before this release I had coding agents write five
programs in Ant and report what got in their way. Most of what they found was about the tools around
the language, and most of this release answers it.&lt;/p&gt;
&lt;h2 id=&quot;ant-check&quot; tabindex=&quot;-1&quot;&gt;ant check &lt;/h2&gt;
&lt;p&gt;&lt;code&gt;ant check&lt;/code&gt; took one file. Checking a project meant one run per program, and &lt;code&gt;ant test&lt;/code&gt; ran test
files without checking them at all.&lt;/p&gt;
&lt;p&gt;Now &lt;a href=&quot;/docs/tools/check.html&quot;&gt;&lt;code&gt;ant check&lt;/code&gt;&lt;/a&gt; takes files and directories, with the current directory as the
default, and reports every error in one run. Each diagnostic ends with a code, and many come with
help and a fix:&lt;/p&gt;
&lt;div class=&quot;language-txt vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;txt&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;main.ant:2:16: Array[string] has no field or function join [no-member]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   │&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt; 2 │ let line = tags.join(&quot;, &quot;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   │            ^^^^^^^^^&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   = help: join is String.join, which takes the array first; call it through its namespace&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;   = fix: String.join(tags, ...)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;&lt;code&gt;ant check -explain no-member&lt;/code&gt; tells more about a code. &lt;code&gt;-json&lt;/code&gt; prints one object per diagnostic,
fixes included, for tools to read. The checker also warns now, about a &lt;code&gt;Result&lt;/code&gt; nobody looks at or an
import nobody uses. A warning does not fail the check unless you pass &lt;code&gt;-strict&lt;/code&gt;.&lt;/p&gt;
&lt;h2 id=&quot;ant-code&quot; tabindex=&quot;-1&quot;&gt;ant code &lt;/h2&gt;
&lt;p&gt;An editor answers where a name is declared, where it is used, and what type it has. Someone working
in a terminal, a coding agent most of all, had no way to ask.&lt;/p&gt;
&lt;p&gt;&lt;a href=&quot;/docs/tools/code.html&quot;&gt;&lt;code&gt;ant code&lt;/code&gt;&lt;/a&gt; asks from the command line. It runs the same analysis as the language
server, on the files as they are on disk:&lt;/p&gt;
&lt;div class=&quot;language-sh vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;sh&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;ant&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B45309;--shiki-dark:#FDBA74&quot;&gt; code&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B45309;--shiki-dark:#FDBA74&quot;&gt; refs&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B45309;--shiki-dark:#FDBA74&quot;&gt; Money.add&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class=&quot;language-txt vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;txt&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;main.ant:4:19: let total = price.add(Money{ cents: 100 })&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;1 reference in 1 file&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;&lt;code&gt;def&lt;/code&gt;, &lt;code&gt;type&lt;/code&gt;, and &lt;code&gt;symbols&lt;/code&gt; answer the other questions, and &lt;code&gt;rename&lt;/code&gt; renames a declaration and every
use of it, across modules. &lt;code&gt;rename -diff&lt;/code&gt; shows the change first.&lt;/p&gt;
&lt;h2 id=&quot;ant-test&quot; tabindex=&quot;-1&quot;&gt;ant test &lt;/h2&gt;
&lt;p&gt;&lt;code&gt;ant test&lt;/code&gt; now checks the test files before it runs them, so a test file with a type error reports
it as &lt;code&gt;ant check&lt;/code&gt; does, before any test runs. &lt;code&gt;-list&lt;/code&gt; prints the tests without running
them, and &lt;code&gt;-parallel&lt;/code&gt; defaults to the number of CPUs.&lt;/p&gt;
&lt;h2 id=&quot;also-new&quot; tabindex=&quot;-1&quot;&gt;Also new &lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;The language server follows imports across modules for references and rename, offers quick fixes,
and fades unused names.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;File.chown&lt;/code&gt;, &lt;code&gt;File.sync&lt;/code&gt;, &lt;code&gt;uid&lt;/code&gt; and &lt;code&gt;gid&lt;/code&gt; on &lt;code&gt;File.Info&lt;/code&gt;, &lt;code&gt;Os.gid&lt;/code&gt;, and &lt;code&gt;Os.cpus&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;ant doc&lt;/code&gt; suggests names when a lookup finds nothing.&lt;/li&gt;
&lt;li&gt;Long values in a failed &lt;code&gt;assert&lt;/code&gt; are trimmed.&lt;/li&gt;
&lt;li&gt;The REPL loads modules that import others.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;breaking-changes&quot; tabindex=&quot;-1&quot;&gt;Breaking changes &lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;ant test&lt;/code&gt; runs no tests when the checker reports an error. Pass &lt;code&gt;-nocheck&lt;/code&gt; to skip the check.&lt;/li&gt;
&lt;li&gt;Diagnostics end with their code, &lt;code&gt;path:line:col: message [code]&lt;/code&gt;. Update anything that parses
them, or read &lt;code&gt;ant check -json&lt;/code&gt; instead.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the &lt;a href=&quot;https://github.com/ant-src/ant/compare/v0.2.0...v0.3.0&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;full changelog&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Duration literals and mutable Bytes</title>
    <link href="https://ant-lang.org/news/ant-0-2"/>
    <id>https://ant-lang.org/news/ant-0-2</id>
    <published>2026-11-14T00:00:00Z</published>
    <updated>2026-11-14T00:00:00Z</updated>
    <summary>Durations get literals like 500ms and 1h30m, and Bytes becomes a buffer you can write into.</summary>
    <content type="html" xml:base="https://ant-lang.org/news/ant-0-2">&lt;p&gt;Ant 0.2 makes two kinds of everyday code shorter: waiting for a while, and working with binary
data.&lt;/p&gt;
&lt;h2 id=&quot;duration-literals&quot; tabindex=&quot;-1&quot;&gt;Duration literals &lt;/h2&gt;
&lt;p&gt;A &lt;code&gt;Time.Duration&lt;/code&gt; was built with &lt;code&gt;Time.duration&lt;/code&gt;. That is precise, but long for the spans a program
writes most, the timeouts, sleeps, and intervals:&lt;/p&gt;
&lt;div class=&quot;language-ant vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;ant&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;Time&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;sleep&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;Time&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;duration&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;milliseconds&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 500&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;))&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Now a duration is a number with its unit, and units combine, as in Go. A literal has the type
&lt;code&gt;Time.Duration&lt;/code&gt; and the same value as the call it replaces:&lt;/p&gt;
&lt;div data-lead class=&quot;language-ant vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;ant&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;Time&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;sleep&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt;500ms&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; timeout &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 1h30m&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;timeout&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;Time&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;duration&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;milliseconds&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 500&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; ==&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 500ms&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class=&quot;language-txt vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;txt&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;PT1H30M&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span&gt;true&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;A literal is a constant span. A computed one, such as &lt;code&gt;Time.duration(seconds: n)&lt;/code&gt;, is still a call,
so there is one way to write each.&lt;/p&gt;
&lt;h2 id=&quot;mutable-bytes&quot; tabindex=&quot;-1&quot;&gt;Mutable Bytes &lt;/h2&gt;
&lt;p&gt;&lt;code&gt;Bytes&lt;/code&gt; was immutable. A program that computed bytes built an &lt;code&gt;Array[byte]&lt;/code&gt; and converted it at the
end, and an array holds a whole value for every element. When I measured it, encoding 4 MB a byte
at a time peaked at about 250 MB of memory, and changing one byte of a megabyte copied all of it
twice.&lt;/p&gt;
&lt;p&gt;So &lt;a href=&quot;/docs/lib/Bytes/&quot;&gt;&lt;code&gt;Bytes&lt;/code&gt;&lt;/a&gt; is now mutable and growable, and shared by reference as an array is.
&lt;code&gt;b[i] = x&lt;/code&gt; writes in place, &lt;code&gt;push&lt;/code&gt; and &lt;code&gt;extend&lt;/code&gt; grow it, and &lt;code&gt;Bytes.read&lt;/code&gt;, &lt;code&gt;Bytes.write&lt;/code&gt;, and
&lt;code&gt;Bytes.append&lt;/code&gt; handle numbers in the byte order you name:&lt;/p&gt;
&lt;div class=&quot;language-ant vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;ant&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#6E7781;--shiki-light-font-style:italic;--shiki-dark:#8B949E;--shiki-dark-font-style:italic&quot;&gt;// A frame: a big-endian length, then the payload.&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt; frame&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;payload&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Bytes&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Bytes&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; b &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Bytes&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;  b&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;append&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;type&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;uint32&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; uint32&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;len&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;payload&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)),&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Bytes&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;BigEndian&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;{})&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;  b&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;extend&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;payload&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;  b&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;frame&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;String&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;toBytes&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B45309;--shiki-dark:#FDBA74&quot;&gt;&quot;hi&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)))&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class=&quot;language-txt vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;txt&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;Bytes(00 00 00 02 68 69)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Building those 4 MB now peaks under 30 MB and takes about a quarter less time. The cost is the one
arrays already have: a function that changes &lt;code&gt;Bytes&lt;/code&gt; changes it for everyone who holds it, so
&lt;code&gt;Bytes.clone&lt;/code&gt; is there for a copy.&lt;/p&gt;
&lt;h2 id=&quot;also-new&quot; tabindex=&quot;-1&quot;&gt;Also new &lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Result.fail&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Better type inference and clearer diagnostics.&lt;/li&gt;
&lt;li&gt;Fixes in the runtime.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&quot;breaking-changes&quot; tabindex=&quot;-1&quot;&gt;Breaking changes &lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;Bytes&lt;/code&gt; shares changes by reference. Call &lt;code&gt;Bytes.clone&lt;/code&gt; where a copy is meant.&lt;/li&gt;
&lt;li&gt;The &lt;code&gt;.body&lt;/code&gt; of an HTTP request or response is gone. Call &lt;code&gt;Http.text(r)&lt;/code&gt; for the text, or read
&lt;code&gt;r.bytes&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;&lt;code&gt;Cmd.Output&lt;/code&gt; drops &lt;code&gt;stdoutBytes&lt;/code&gt; and &lt;code&gt;stderrBytes&lt;/code&gt;. Call &lt;code&gt;Cmd.captureBytes&lt;/code&gt; for binary output.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;See the &lt;a href=&quot;https://github.com/ant-src/ant/compare/v0.1.0...v0.2.0&quot; target=&quot;_blank&quot; rel=&quot;noreferrer&quot;&gt;full changelog&lt;/a&gt;.&lt;/p&gt;
</content>
  </entry>
  <entry>
    <title>Introducing Ant</title>
    <link href="https://ant-lang.org/news/ant-0-1"/>
    <id>https://ant-lang.org/news/ant-0-1</id>
    <published>2026-11-08T00:00:00Z</published>
    <updated>2026-11-08T00:00:00Z</updated>
    <summary>The first release of Ant, a typed language with errors as values, pipes for data, and goroutines.</summary>
    <content type="html" xml:base="https://ant-lang.org/news/ant-0-1">&lt;p&gt;Ant 0.1 is the first release of Ant, a statically typed language with errors as values, pipes for
data, and goroutines. A file of statements runs from top to bottom, so a script needs no &lt;code&gt;main&lt;/code&gt;.
This post shows the three ideas the rest of the language is built around.&lt;/p&gt;
&lt;h2 id=&quot;errors-are-values&quot; tabindex=&quot;-1&quot;&gt;Errors are values &lt;/h2&gt;
&lt;p&gt;A missing file and an index out of range are different kinds of failure. The first is expected, and
the program can do something about it. The second is a bug, and only a change to the code fixes it.
Exceptions put both through one mechanism, so I gave each its own.&lt;/p&gt;
&lt;p&gt;A function that can fail returns a &lt;code&gt;Result&lt;/code&gt;, and &lt;code&gt;try&lt;/code&gt; hands an error up to the caller. Nothing is
thrown:&lt;/p&gt;
&lt;div class=&quot;language-ant vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;ant&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt; load&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; string&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Result&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;Json&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;Value&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Error&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;]&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;  let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; text &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt; try&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; File&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;read&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;path&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;  Json&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;parse&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;text&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; config &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt; load&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B45309;--shiki-dark:#FDBA74&quot;&gt;&quot;config.json&quot;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;if&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; config &lt;/span&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;is&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Err&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; {&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt; println&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;config&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;error&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;message&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; }&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class=&quot;language-txt vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;txt&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;open config.json: no such file or directory&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;A bug panics instead, and ends the program with a trace. The design note
&lt;a href=&quot;/docs/design/errors-are-values.html&quot;&gt;Why no exceptions&lt;/a&gt; goes through the split and what it costs.&lt;/p&gt;
&lt;h2 id=&quot;data-flows-left-to-right&quot; tabindex=&quot;-1&quot;&gt;Data flows left to right &lt;/h2&gt;
&lt;p&gt;A pipe passes the value on its left as the first argument on its right, and a block with &lt;code&gt;x&lt;/code&gt; is a
lambda. A chain of steps reads in the order it runs:&lt;/p&gt;
&lt;div class=&quot;language-ant vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;ant&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; result &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; [&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt;5&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 8&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;]&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;filter&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;({&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; x &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;&gt;&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; })&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;({&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; x &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 10&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; })&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;  |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Array&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;sort&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;()&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;result&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class=&quot;language-txt vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;txt&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[50, 80]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;h2 id=&quot;goroutines-not-async&quot; tabindex=&quot;-1&quot;&gt;Goroutines, not async &lt;/h2&gt;
&lt;p&gt;In a language with &lt;code&gt;async&lt;/code&gt;, a function that waits is marked, its callers must &lt;code&gt;await&lt;/code&gt; it, and the
mark spreads up to &lt;code&gt;main&lt;/code&gt;. In Ant, any function can wait: a call that waits blocks only its own
goroutine, and any function can start one. &lt;code&gt;Parallel.map&lt;/code&gt; runs a function over a
list on goroutines, at most &lt;code&gt;limit&lt;/code&gt; at once:&lt;/p&gt;
&lt;div class=&quot;language-ant vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;ant&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;func&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt; slowSquare&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;n&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; ctx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Context&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;):&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; int&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; {&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;  Time&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;sleep&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt;Time&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;duration&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;milliseconds&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 100&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;),&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; ctx&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;  n &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;*&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; n&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;}&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#7C3AED;--shiki-dark:#C4B5FD&quot;&gt;let&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; squares &lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;=&lt;/span&gt;&lt;span style=&quot;--shiki-light:#0F766E;--shiki-dark:#5EEAD4&quot;&gt; Parallel&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;map&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;([&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 2&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 4&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;],&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; slowSquare&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;,&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt; limit&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;:&lt;/span&gt;&lt;span style=&quot;--shiki-light:#2563EB;--shiki-dark:#93C5FD&quot;&gt; 3&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;
&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;println&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;--shiki-light:#24292F;--shiki-dark:#DFDFD6&quot;&gt;squares&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt;)&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;div class=&quot;language-txt vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;txt&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span&gt;[1, 4, 9, 16]&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;&lt;a href=&quot;/docs/design/no-async.html&quot;&gt;Why goroutines and not async&lt;/a&gt; explains the choice.&lt;/p&gt;
&lt;h2 id=&quot;get-started&quot; tabindex=&quot;-1&quot;&gt;Get started &lt;/h2&gt;
&lt;p&gt;Install &lt;code&gt;ant&lt;/code&gt; with one line:&lt;/p&gt;
&lt;div class=&quot;language-sh vp-adaptive-theme&quot;&gt;&lt;button title=&quot;Copy Code&quot; class=&quot;copy&quot;&gt;&lt;/button&gt;&lt;span class=&quot;lang&quot;&gt;sh&lt;/span&gt;&lt;pre class=&quot;shiki shiki-themes ant-light ant-dark vp-code&quot; tabindex=&quot;0&quot;&gt;&lt;code&gt;&lt;span class=&quot;line&quot;&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt;curl&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B45309;--shiki-dark:#FDBA74&quot;&gt; -fsSL&lt;/span&gt;&lt;span style=&quot;--shiki-light:#B45309;--shiki-dark:#FDBA74&quot;&gt; https://ant-lang.org/install.sh&lt;/span&gt;&lt;span style=&quot;--shiki-light:#57606A;--shiki-dark:#9CA3AF&quot;&gt; |&lt;/span&gt;&lt;span style=&quot;--shiki-light:#C026D3;--shiki-dark:#F0ABFC&quot;&gt; sh&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;
&lt;/div&gt;&lt;p&gt;Then take the &lt;a href=&quot;/docs/tour/01-hello.html&quot;&gt;tour&lt;/a&gt;, or try Ant in the &lt;a href=&quot;/playground.html&quot;&gt;playground&lt;/a&gt; without
installing anything.&lt;/p&gt;
</content>
  </entry>
</feed>
