| Crates.io | adc-lang |
| lib.rs | adc-lang |
| version | 0.2.7 |
| created_at | 2025-01-03 04:20:06.133658+00 |
| updated_at | 2025-11-26 21:26:26.951091+00 |
| description | Array-oriented reimagining of dc, a terse RPN esolang |
| homepage | |
| repository | https://github.com/43615/adc-lang |
| max_upload_size | |
| id | 1502109 |
| size | 211,854 |
This is a project to introduce array programming paradigms and other improvements to an ancient calculator language called dc, while preserving its core tenets:
Very compact syntax, usually single-character commands.
Operations implicitly occur on a stack, resulting in an RPN syntax.
Straightforward, purely procedural execution flow using strings as code.
Interpreter performance comparable to a compiled language.
This project is available on crates.io. With a working Rust environment, you can just run:
cargo install adc-lang
or, of course, build. If you want to disable OS-related functionality, add the option -F no_os.
This crate should work on all systems supported by Rust. However, I do not extensively test it on anything other than x86-64 Linux. Please report any platform-related issues.
Some breaks from the "one character per command" principle to allow for better mnemonics and rarely-used commands.
Array support with arbitrary nesting (dimensions). In general, the primitive functions are implicitly applied to entire arrays at once.
Boolean vectors as a new type, enabling more comfortable conditionals.
Numbers are rationals of arbitrary size, provided by Malachite.
Strings have actual manipulation commands and full UTF-8 support. Includes regex find/replace operations.
Additional arithmetic functions, including real-valued ones (performed using floats).
Arbitrary input/output bases for numbers, with a special format above base 36. Stack for parameter contexts.
Registers with arbitrary indices, directly selectable with a number.
Macro execution in child threads using registers as handles.
Expanded command line argument syntax, including saving/loading the whole interpreter state.
OS-interfacing features, such as running commands and file I/O. May be disabled for dealing with untrusted input.