Skip to main content

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

xulang-0.2.0.tar.gz (12.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

xulang-0.2.0-py3-none-any.whl (17.2 kB view details)

Uploaded Python 3

File details

Details for the file xulang-0.2.0.tar.gz.

File metadata

  • Download URL: xulang-0.2.0.tar.gz
  • Upload date:
  • Size: 12.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11

File hashes

Hashes for xulang-0.2.0.tar.gz
Algorithm Hash digest
SHA256 585cd78f0c108ba0c5d8167b81cff6e8abb77dbde4101d598d43b7769f5fa906
MD5 cb71746f37865d8a9b222d4759f575c7
BLAKE2b-256 22f91a477c0059aa5f7a19215c922c9a9fee0a1c9bbe29546812f3fe5db65442

See more details on using hashes here.

File details

Details for the file xulang-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: xulang-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 17.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.2 CPython/3.13.12 Windows/11

File hashes

Hashes for xulang-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3dc31cbcf29875b545034fe2984a1c36690b601a2cdef0e6e262f733f710a02e
MD5 a45099cf5a556eb9ccdd5bfea3cb15fa
BLAKE2b-256 1705536d1ca21fedcfec87922492612e879c5a7d0bf11a370a776c823908df10

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page