Skip to main content

Silicon: A new language made with Python.

Project description

💎 Silicon.py (v0.3.0)

Silicon is a custom-built, high-logic programming language designed for structured data manipulation and iterative logic. Built with the "Industrial Library" philosophy, Silicon separates data into distinct namespaces (vars, arrs, funcs) to ensure maximum memory clarity and zero variable shadowing.

🚀 Installation

Silicon.py is available on PyPI. Install it globally or in your virtual environment:

pip install silicon.py

🛠 Usage

Silicon.py uses the .sil extension. Once installed, you can execute your scripts using the sili command:

sili your_script.sil

🏗 Language Syntax

Silicon.py introduces a unique Action-Library syntax. To modify data, you must call the action through the appropriate library.

1. Variables and Arrays

Definitions and assignments are distinct steps. This ensures intentional memory allocation.

~~ Define your data ~~

define(type:Var = playerName)    
define(type:Arr = inventory)

~~ Set values using the Library:Action syntax ~~

vars.playerName:Set("Architect")    
arrs.inventory:Set("Hammer", "Shield", "Silicon Core")

2. The cond() Logic (v0.2.2+)

Silicon.py v0.2.2 replaced the traditional if with the unified cond() system. It supports single-pass conditions (if) and loops (during).

Supported Logic Operators:

  • alt; (OR)
  • also; (AND)
  • not; (NOT)
cond(during vars.health > 0):    
    log(console, "Character is alive...")    
        
    cond(if vars.energy < 10 also; vars.hasPotion == true):    
        log(console, "Energy low! Drinking potion...")    
    :end    
:end

3. The math library (v0.3.0+)

In silicon.py v0.3.0, a couple of new features released. One of these include the new math library. This library allows for complex calculations directly within your Set actions or logic checks.

Available Operations:

  • math.sqrt(x): Returns the square root of x.
  • math.rand(): Generates a random integer between 0 and 1.
  • math.rand(max): Generates a random integer between 0 and max.
  • math.abs(x): Returns the absolute value of x.

Example:

define(type:Var = luck)  
define(type:Var = rootVal)

~~ Generate random number between 0 and 10 ~~  
vars.luck:Set(math.rand(10))

~~ Calculate square root of 64 ~~  
vars.rootVal:Set(math.sqrt(64))

4. String Combination (v0.3.0+)

Silicon v0.3.0 introduces the combine() function, allowing you to dynamicly stitch together strings, numbers, and variable values without complex concatenation syntax.

Syntax: combine(val1, val2, val3, ...)

Example:

define(type:Var = user)  
vars.user:Set("Admin")

~~ Output: "Welcome back, Admin. System ready." ~~  
log(console, combine("Welcome back, ", vars.user, ". System ready."))

5. Execution Control (v0.3.0+)

To manage the flow of your program, v0.3.0 adds the delay() logic. This pauses script execution for a specified number of seconds.

Syntax: delay(seconds)

Example:

log(console, "Initializing core...")  
delay(2)  
log(console, "Core active.")

📑 Roadmap

  • v0.2.2: Unified cond() logic and semantic operators (alt;, also;).
  • v0.2.3: Official rebranding to Silicon, .sil extension, and sili CLI.
  • v0.2.4: Added README.md for better guides of use.
  • v0.2.5: Updated README.md for better guides of use.
  • v0.2.6: Updated console logging to [SILICON].
  • v0.2.7: Allowed usage of sili --version.
  • v0.3.0: Added math library, delay() logic, and combine(x, y, z) to conjoin strings, numbers, and variables.

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

silicon_py-0.3.0.tar.gz (8.8 kB view details)

Uploaded Source

Built Distribution

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

silicon_py-0.3.0-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

Details for the file silicon_py-0.3.0.tar.gz.

File metadata

  • Download URL: silicon_py-0.3.0.tar.gz
  • Upload date:
  • Size: 8.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for silicon_py-0.3.0.tar.gz
Algorithm Hash digest
SHA256 90c8cfda612a8d440b19b410b49d16415f75308c3fe8d3a80bbebc49dd3aade0
MD5 a6aed0a86ed374713d1c7409833add35
BLAKE2b-256 cb193aa1cd0d2ae84a41ab25b44a96263c80a56d94e2dd2d0eaa55830685d4f6

See more details on using hashes here.

File details

Details for the file silicon_py-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: silicon_py-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.2

File hashes

Hashes for silicon_py-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 01ba2cf6086bd74ad9a4c06d7f528c6c6274603f4c5bdf38739c953ce9bc8d51
MD5 a40077002ed4d6846dca5cef64d3b13e
BLAKE2b-256 70f7119787f04b8d285b54efb377122953e60634813bc1f9af295495c760627c

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