Xulang: a minimalist programming language with no rules to memorize. Dedicated to my dear little mouse.
Project description
xulang
xulang: an ultra-minimalist programming language with zero memorization of rules required.
Install
pip install xulang
Usage
# xulang interactive CLI
python3 -m xulang
# run file
python3 -m xulang <filepath.xu>
# run file with include_path
python3 -m xulang -I <include_path> <filepath.xu>
Lexical Units
Constants: Character strings consisting of letters, digits, and underscores, starting with a digit or uppercase letter. Examples: 123, ABX_1, T, etc.
Variables: Character strings consisting of letters, digits, and underscores, starting with a lowercase letter or underscore. Examples: a, _name, _var1.
String Matching: A string starting with an asterisk immediately followed by a variable name. Examples: *a, *_x, *v1.
Program Examples
// Define IF ternary operator (with short-circuit evaluation)
(IF TRUE a b) => a
(IF FALSE a b) => b
// Define MERGE: merge any two sequences
(MERGE (*a) (*b)) => (*a *b)
// Define HEAD: get the first element of a non-empty sequence
(HEAD (a *b)) => a
// Define REV: reverse any sequence
(REV ()) => ()
(REV (a *b)) => (MERGE (REV (*b)) (a))
// Define TAIL: get the last element of a non-empty sequence
(TAIL (*a)) => (HEAD (REV (*a)))
// Run program (result is E)
(IF FALSE X (TAIL (A B C D E)))
// Run program (result is 1)
(IF TRUE 1 (TAIL (A B C D E)))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file xulang-0.3.0.tar.gz.
File metadata
- Download URL: xulang-0.3.0.tar.gz
- Upload date:
- Size: 14.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a64474ac81bbdf0f7c708b19a403941571ff83113b87072a51f169eeddc7f370
|
|
| MD5 |
16ae5b36cf75949f828a5877f542c805
|
|
| BLAKE2b-256 |
83b87524d2c266d3a0b142fe89c88beddcaa3e7714c06b06cfdedf98fc54453b
|
File details
Details for the file xulang-0.3.0-py3-none-any.whl.
File metadata
- Download URL: xulang-0.3.0-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
86e8eb70abed5695e37cc6f869a4fcc12f537a192eebbef8e3caa92825bc8aa9
|
|
| MD5 |
185a7cf92a5e05cc129a1a74e8addf1b
|
|
| BLAKE2b-256 |
60782eba61cd4eee48d149d5414b7bfc6303ea46004ebbf572f4e345f74ae367
|