Argon Documentation
This is the documentation for Argon, a dynamically typed scripting language, as implemented by Chloride, its C interpreter (a bytecode compiler and virtual machine). It also covers Isotope, Argon’s package manager.
If you already know a scripting language like Python or JavaScript, most of Argon will feel
familiar. The biggest differences are that blocks are opened with do and closed by
indentation, functions are declared with let name(args) = ..., and numbers are exact
rationals rather than floating point.
let greet(name) = `Hello, $(name)!`
for (name in ["Ada", "Grace"]) do
term.log(greet(name))
Versions: this documentation describes Chloride
v4.1.0and Isotope1.0.0. If you’re running an older version, see Changes in v4.1.0. Chloride is still under active development, so if something here disagrees with the interpreter, trust the interpreter (and please fix this doc!).
Start here
Language guide
- Syntax basics: comments,
doblocks, indentation - Variables, scope and destructuring
- Numbers
- Operators
- Control flow
- Functions
- Strings
- Arrays
- Dictionaries and tuples
- Buffers
- Classes and objects
- Errors and exceptions
- Modules and
import - Built-in globals reference
Standard library
See the standard library overview for a summary of every module.
term: printing and input (global, no import needed)mathsrandompathfilejsondatetimeregexnetwork: TCP, TLS and HTTPurlhexthreadingsubprocessarchivebuild: compiling native extensions
Isotope (package manager)
- Isotope overview and commands
- Using packages
- Publishing packages
argon-package.jsonandiso-lock.json
Tooling
Changes in v4.1.0
These behaved differently in Chloride v4.0.3 and earlier:
- Operator precedence is now conventional (see Operators).
In
v4.0.3, every operator had its own level, so8 / 2 * 2was2,2 ^ 3 ^ 2was64,-2 ^ 2was4, and ranges bound tighter than everything (-2 to 1meant-(2 to 1)). //and%round down for integers too ((-7) // 2is-4);v4.0.3rounded toward zero.exponent()and^on custom classes called__multiply__.- Ranges didn’t support
in, andtoranges with fractional bounds (0.5 to 2.5) left out the end. \`and\$escapes, andforeverloops, didn’t work.- Reading an inherited class attribute through a subclass (
Child.attr) threw. - Standard library:
random.int(start, end)returned values up tostart + end.File.read()always reread from the start of the file.file.stdnulldidn’t discard subprocess output.json.stringifyrejected tuples.path.common_prefixdoubled the leading/.- HTTP
status_textwas always empty. file.FileErrorwas separate from the globalFileError.Date.from_stringparsed local time.- Most of the
datemodule’s features (durations, date arithmetic, ISO parsing, local time) are new.
For AI coding agents
skills/argon is an agent skill that summarises the language, its
pitfalls, the standard library and Isotope, for coding agents writing Argon. To use it with
Claude Code, copy or symlink the skills/argon directory into ~/.claude/skills/ (or into a
project’s .claude/skills/).
License
Chloride is released under the GNU General Public License v3.0 (or later). The standard
library is released under the GNU LGPL v3.0 (or later). See the project’s LICENSE.txt and
LICENSES/ directory for details.