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>

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.1.0.tar.gz (10.9 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.1.0-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: xulang-0.1.0.tar.gz
  • Upload date:
  • Size: 10.9 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.1.0.tar.gz
Algorithm Hash digest
SHA256 2bd2e83a31f846e79b15a589cdf0110681f8833d1eb363ea1b6d7a874a90a059
MD5 889bc55cbca1b489e26aea35675633c2
BLAKE2b-256 d725800d1948abe07201d4ffdec353cb2c0ed6abb80047864dd39eb6fbd9c8dc

See more details on using hashes here.

File details

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

File metadata

  • Download URL: xulang-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 15.7 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 079360f9c96de6d8951195c204be000d06768e76e39a0d865f7a9da4fbc2c472
MD5 b46521443c6343b93dd6d03ff2836a5d
BLAKE2b-256 0255254e52cb6aa3355617bdf721efd3eb2b2fdd5e37cbf69d761640c061da02

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