Skip to content
Open-ArgonPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

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.0 and Isotope 1.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

Standard library

See the standard library overview for a summary of every module.

Isotope (package manager)

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, so 8 / 2 * 2 was 2, 2 ^ 3 ^ 2 was 64, -2 ^ 2 was 4, and ranges bound tighter than everything (-2 to 1 meant -(2 to 1)).
  • // and % round down for integers too ((-7) // 2 is -4); v4.0.3 rounded toward zero.
  • exponent() and ^ on custom classes called __multiply__.
  • Ranges didn't support in, and to ranges with fractional bounds (0.5 to 2.5) left out the end.
  • \` and \$ escapes, and forever loops, didn't work.
  • Reading an inherited class attribute through a subclass (Child.attr) threw.
  • Standard library:
    • random.int(start, end) returned values up to start + end.
    • File.read() always reread from the start of the file.
    • file.stdnull didn't discard subprocess output.
    • json.stringify rejected tuples.
    • path.common_prefix doubled the leading /.
    • HTTP status_text was always empty.
    • file.FileError was separate from the global FileError.
    • Date.from_string parsed local time.
    • Most of the date module'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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors