Axiom is a programming language designed for simplicity.
The one-page
language manual
can be read and understood within a day.
See the
FAQ
for more information.
Download
Binaries for various platforms and syntax highlighters can be found here.
Example
#this is a function
:hello(name)
print 'hello',name+'!'
hello('world')
##
output:
hello world!
##
See more examples here.
Reference
See the complete language manual and library reference here.
Updates
-
2025.03.22 —
Call :string() implicitly (if defined in class) when interpolating template strings.
Fixed bug where web.req() could hang indefinitely if the server is never ready.
Website improvements: Added error page. The path /dl now redirects to /dl/axiom.zip.
-
2024.12.01 —
Added io.xml.query().
Improved io.html.get_text(): handle whitespace better, skip HTML comments, and fix bug when script/style was followed by another tag.
Fixed bug where the |= operator never worked because it was parsed incorrectly.
Fixed integer overflow bug in number.base() which prevented large numbers from being converted correctly.
-
2024.11.04 —
Using an assignment operator on a variable declared in an outer scope now modifies the variable (instead of declaring a new variable in the inner scope).
This makes the behavior in Axiom (example)
different from popular languages like Python (example), but more intuitive.
Fixed bug where reference counts were not atomic, which could cause crashes when multithreading.
Fixed bug where class/function definition collisions were not detected.
-
2024.10.01 —
Ignore script and style tags in io.html.get_text().
Added regex.all() to find all matches in a string.
Added thickness parameter to image.circle()/rect(). Fixed bugs in image.line().
Added search functionality to documentation.
Fixed minor bug in Vim syntax highlighter.
-
2024.09.01 —
Slightly improved image.find_fuzzy() by making the threshold adjustable and returning more information.
-
2024.08.02 —
Fixed os.thread.kill() not working on some platforms.
Fixed io.html.get_text() accidentally inserting extra characters on some platforms.
-
2024.07.01 —
Improved image module documentation.
Fixed crash when calling image.text*() methods on high Unicode code points.
Added thickness parameter to image.line().
Increased image method defaults to accomodate high-DPI displays.
Clarified compare() behavior.
Added string.contains().
Allow non-string headers in array.untable().
-
2024.05.08 —
Added GPU support to Android, but removed GPU support from Raspberry Pi.
On Raspberry Pi, matrix multiplication was never faster on GPU than on CPU.
Added array.counts() and array.map().
Differentiate between Android and Linux in os.platform().
-
2024.04.07 —
Parse HTML entities in io.html functions.
-
2024.01.06 —
Removed item.exists from os.dir()/stat() and zip.items(),
and instead return null when items don't exist.
-
2023.12.08 —
Added regex module! Also fixed bugs in parse_date().
-
2023.11.23 —
Various matrix module improvements.
Removed matrix.valid() and replaced all invalid matrices with null.
Added support for negative indexes in matrix methods,
which are relative to the number of rows/columns.
The print statement and REPL now implicitly call :string(), if defined in the variable's class.
-
2023.10.01 —
Various sqlite module fixes and improvements.
Default to ":memory:" in sqlite().
Improved docs for query(),
and fixed bug where array and object values were bound as null.
They are now bound as text after being converted to JSON.
Removed commit(), and use built-in autocommit instead.
This fixes issues with concurrent access, and one can always use
BEGIN/COMMIT explicitly within SQL for improved performance.
Fixed and improved Vim syntax highlighter.
-
2023.05.29 —
Improved web.server.submit() and web.server.load_post().
Added web.server.headers() to get raw request headers.
Clarified rules for template strings and identifiers.
A dollar sign within a template string that is not followed by an identifier
no longer causes an error.
Updated all syntax highlighters to properly highlight template strings.
-
2023.05.01 —
Simplified web.server.run() config file (web.ini),
and fixed SSL certificate not reloading when modified.
Return the sever's SSL certificate in web.req() when using HTTPS.
Fixed some possible crashes when OpenSSL is missing.
Changed default web.user_agent() from IE9 to generic browser.
Changed array.bsearch() to return closest indices when value is not found.
Fixed early timeouts in web.server.write_thread() and websockets. The default
timeout in both cases is now unlimited, but can be customized with
web.server.timeout().
-
2023.03.31 —
Added randstd() and matrix.randstd().
Added matrix.cov() and matrix.cor() to get covariance and correlation matrices.
Added variance to matrix.stats() and tweaked output.
Removed warning when an empty matrix is constructed (normally used to represent an invalid matrix).
-
2023.03.04 —
Tweaked and clarified rules for multiline string literals.
Changed all sort*() methods to take dsc=false instead of asc=true by default.
Changed web.req() to return object {head,body} instead of string.
Return removed value instead of null in array.remove() and object.remove().
Fixed bug where json()/string() converted nan/inf to invalid JSON.
Now they are converted to null, similar to Javascript.
Added image.qr().
-
2023.01.01 —
Fixed bug where os.sleep() couldn't handle durations over 1 hour.
Added number.duration() to format time durations.
Added calendar.midnight().
-
2022.12.01 —
Fixed bug where web.req() sometimes crashes on chunked responses.
-
2022.11.01 —
Fixed bug where io.exists()/load() fails for read-only files.
Refactored image module: move surface class into image, and remove data()/data_ptr().
Added support for image and matrix in native.declare().
Added matrix.shape() and change matrix.size() to return number of elements instead of shape.
Fixed bug where matrix(r,c,fill) didn't actually use fill.
Added file() to get absolute path of source file.
Added number.acosh()/asinh()/atanh()/cosh()/sinh()/tanh()/cbrt().
Inherit environment in os.exec()/pty() instead of having to specify it explicitly.
Tweaked and fixed bugs in web.req(): fix failed PUT/POST when kept-alive connection drops, only follow redirect if status is 3xx, improve progress bar.
-
2022.10.01 —
Removed matrix size limitations; matrix size is now only limited by system memory, similar to other data types.
Improved string.parse_date().
-
2022.09.01 —
Added scope() and call() for reflection. Added array.bsearch().
Fixed inconsistencies with index operator when used for assignment versus retrieval (ex: object[number] and array[boolean] are now assignable).
Fixed bug where core global functions (like time()) could be redefined.
Fixed bug where web.server.render_html() was not re-entrant, possibly causing issues when used with web.server.write_thread().
Moved website to new domain: axm.dev
-
2022.08.02 —
Added ARM Linux binary, tested on
Jetson Nano
and
Ampere Altra
(OCI).
Fixed bug where web.req() leaves sockets in CLOSE_WAIT instead of closing them.
-
2022.06.04 —
Added Android binary. Fixed OpenSSL not loading on Android and PopOS.
Updated to latest
read_line,
which adds support for delete key.
-
2022.04.24 —
Added array.filter() and matrix.size().
Fixed bugs when matrix is large.
Preserve whitespace in single-line template strings.
Updated to latest
read_line,
which adds support for home/end keys.
Return this instead of null in sort*()/shuffle() methods.
-
2022.03.31 —
Added web.url(). Added string.punycode().
Support scalars in matrix.add()/sub()/mul()/div(). Removed matrix.scale() due to overlap.
Removed object.key(). Added optional index argument to object.keys()/pairs()/values().
Always cast index as string when doing object[index], since index as number is now supported by object.values().
Added array.apply().
Back-ticked strings are now also template strings.
Updated to latest
read_line,
which fixes a crash when REPL is started within a pseudo-terminal.
-
2022.02.19 — Fixed bugs in mail module.
Added object.pairs() and object.values().
Added io.text module.
Added official Axiom Docker image.
-
2022.01.03 — Updated to use new
read_line which fixes issues when line
is greater than terminal width.
-
2021.12.04 — Added mail module!
Fixed some critical longstanding bugs.
Fixed bugs in matrix.mul()/set() when called after slice(), which also affected fit().
Fixed bugs with randomness in random()/randint()/randstr()/uuid().
Fix bug where web.server information was unavailable during on_destroy.
-
2021.11.05 — Various bug fixes and improvements.
Fixed crash bugs in string.slice() and web.get().
Fixed off-by-one bug in matrix.fit() for underdetermined matrices, and added tolerance parameter.
Added os.pty(). Improved websocket interface in web.server.
Fixed crash in calendar.next_month()/prev_month().
Added array.table() and array.untable().
Removed "local" parameter from number.date() and added number.local() for reuse with calendar.
-
2021.08.19 — Added number.round(). Fixed crash on empty array.remove().
Axiom is now compiled using my
crossbuild
image
instead of using each platform's native build tools.
-
2021.06.12 — More bug fixes. Fixed key precedence when using operator+ or operator+= with objects.
Fixed OpenSSL not loading on Debian. Fixed web.req() not working on certain sites due to missing headers.
Fixed crash when leaving background threads running after main thread exits. Axiom will now wait for all
background threads to complete before exiting the main thread.
-
2021.05.02 — Fix crash when os.thread() goes out of scope before thread is finished running.
Added headers parameter to sqlite.query() and removed sqlite.headers().
Internally, class instances now reference the class scope instead of class scope path.
This improves method call performance, and also fixes issue where thing().class==thing was false.
-
2021.04.17 — More bug fixes. Fixed a crash on Windows when calling web.server.run() without use().
Fixed crash when using the * operator to allocate memory when given a negative size.
Fixed parsing errors on files with no trailing newline.
Fixed REPL not working when used with a debugger like lldb.
Fixed potential issues with calling web.req() from multiple threads.
Added os.wait() and os.done() to deal with child processes on Posix.
Fixed os.exepath() on Linux and Raspberry Pi.
-
2021.03.14 — Numerous bug fixes and improvements:
fixed os.mkdir()/web.dl()/import(url) not working in Windows;
fixed number.comma() not working for negative numbers, and also added precision parameter;
improved @zip interface;
add support for fractional numbers and precision in number.base()/string.parse_base().
The first Axiom tutorial is out! You can view the slides here:
Stock Market Analysis using Axiom.
-
2021.01.31 — Added the matrix module!
-
2020.12.04 — In for loops over strings, iterate over code points instead of bytes.
The most common use case of string for loops is to iterate over text,
in which case the code points are more useful, especially for foreign languages.
-
2020.11.01 — Updated SQLite to version 3.33.0. This improves SQLite performance and adds some more extensions.
Also added missing shift operators (<< and >>).
-
2020.10.16 — Removed dependency on libreadline and replaced it with my
read_line library. This improves cross-platform REPL support and behavior.
-
2020.09.04 — Function and class references are now opaque objects ("scopes") instead of magic strings ("addresses").
This improves performance and fixes some obscure bugs.
Also fixed string.escape()/unescape() for Unicode surrogate pairs (emojis), clarified docs on ?= operators, added special case for += operator,
and added string.search() to search for wildcard patterns.
-
2020.08.09 — String elements are now (single-character) strings instead of (byte) numbers.
This makes for-loop and operator-[] behavior on strings similar to Python/Javascript.
Added string.byte() to explicitly retrieve byte value. Updated and improved documentation.
-
2020.03.21 — Improved for-loop semantics to support collections. Added calendar module. Added number.format().
Various library changes. Entering the REPL will now report a build date.
- 2019.11.23 — Added image module! Also improved documentation in various places.
- 2019.10.02 — Language tweaks: allow :main() redefinition, environment variables in :import(), and blank return statements.
- 2019.09.06 — Streamlined core methods and improved documentation.
- 2019.08.16 — Added web.server module! Also fixed bugs in Vim highlighter, and made other minor improvements.
- 2019.05.04 — Lots of performance improvements. Also added syntax highlighters for VS Code and Vim.
- 2019.04.07 — Added REPL and several new modules: io.csv, io.html, io.ini, io.json, web, sqlite, zip. Also improved performance.
- 2019.03.08 — Axiom first released!