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.3.0.tar.gz (14.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.3.0-py3-none-any.whl (20.0 kB view details)

Uploaded Python 3

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

Hashes for xulang-0.3.0.tar.gz
Algorithm Hash digest
SHA256 a64474ac81bbdf0f7c708b19a403941571ff83113b87072a51f169eeddc7f370
MD5 16ae5b36cf75949f828a5877f542c805
BLAKE2b-256 83b87524d2c266d3a0b142fe89c88beddcaa3e7714c06b06cfdedf98fc54453b

See more details on using hashes here.

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

Hashes for xulang-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 86e8eb70abed5695e37cc6f869a4fcc12f537a192eebbef8e3caa92825bc8aa9
MD5 185a7cf92a5e05cc129a1a74e8addf1b
BLAKE2b-256 60782eba61cd4eee48d149d5414b7bfc6303ea46004ebbf572f4e345f74ae367

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