Skip to main content

An esoteric programming language (esolang) designed for density and structural complexity.

Project description

Obscurix

Obscurix is an esoteric programming language (Esolang) designed to have an obscure syntax that is still binary-readable.

This package provides an interpreter for .obx files.

Installation

pip install obscurix

Using the CLI

Run Obscurix files from the command line:

python -m obscurix sample.obx

With --debug flag:

python -m obscurix --debug sample.obx

Example code (sample.obx)

⥀ §sum_safe α β ※ Function definition: §sum_safe
  ⍟ ≔ 0 
  
  ↜ ?
α ≺ 0 ※ IF: Check condition α < 0
    ⇒ λ!
"Tham_số_âm" ※ TRUE: Throw an error
  ⇏ ※ ELSE: Otherwise
    ⍟ ≔ α ⊞ β ※ Calculate sum: ⍟ = α + β
  ↯ ※ End of IF block
  
  ⎋ ⍟ ※ Return the result variable ⍟
⥁ ※ End of function definition

* "Bắt_đầu_Chương_Trình" ※ Print start message

⛌ ※ TRY: Start protected block
  ⍡ ≔ 5 
  
  ⍟_res ≔ §sum_safe ⍡ 10 ※ Call function (5 + 10)
  * ⍟_res ※ Print result 15
  
  §sum_safe -1 10 ※ Call function with negative parameter -> THROW error
⎁ ε ※ CATCH: Catch error and store it in variable ε
  * "Lỗi_Bị_Bắt:" ※ Print catch message
  * ε ※ Print error message
⎎ ※ FINALLY: Block that always executes
  * "Kết_thúc_Xử_Lý_Lỗi" ※ Print finally message
⍰ ※ End of TRY block

* "Kết_thúc_Chương_Trình" ※ Print end message

Using in code (Import)

from obscurix.interpreter import ObscurixRuntime

# Source file path
FILENAME = "sample.obx"

# Initialize runtime and pass the required filename
runtime = ObscurixRuntime(FILENAME, debug=False) # Set this as True to enable debug log

# Run the execution (file content is read during initialization)
runtime.run()

# --- Expected Output (Vietnamese strings are part of the sample Obscurix code) ---
# Bắt_đầu_Chương_Trình
# 15
# Lỗi_Bị_Bắt:
# Tham_số_âm
# Kết_thúc_Xử_Lý_Lỗi
# Kết_thúc_Chương_Trình

License

MIT

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

obscurix-0.1.0.tar.gz (10.2 kB view details)

Uploaded Source

Built Distribution

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

obscurix-0.1.0-py3-none-any.whl (9.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: obscurix-0.1.0.tar.gz
  • Upload date:
  • Size: 10.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for obscurix-0.1.0.tar.gz
Algorithm Hash digest
SHA256 ab94e5d71d119c6dcb3de4514b228620840560826d7efdfc319c204cdc761061
MD5 c314310080100d1f7d95246871da2852
BLAKE2b-256 8829621d173bc40975c43e768d71442e6ed812a9b45f12b133629d934efaeeed

See more details on using hashes here.

Provenance

The following attestation bundles were made for obscurix-0.1.0.tar.gz:

Publisher: python-publish.yml on TeaserLang/obscurix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: obscurix-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 9.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for obscurix-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0abde3ea08961110b3ae3095f016c03f81ecb1b9c0da741eeaa0a4b5b36d2c83
MD5 022f89c5bce81c034f97d202ff69641d
BLAKE2b-256 bb8c97384405ec803b715de544afb7c1f6703da7859fefc3c684cb06f4890db9

See more details on using hashes here.

Provenance

The following attestation bundles were made for obscurix-0.1.0-py3-none-any.whl:

Publisher: python-publish.yml on TeaserLang/obscurix

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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