Skip to main content

Pebble programming language interpreter in Python

Project description

Pebble Programming Language

Pebble is a beginner-friendly programming language built in Python.
It’s designed to be simple, readable, and fun for learners and hobbyists.


Features

  • Functions: Define with fnc and return values with out
  • Loops: go (for loops) and until (while loops)
  • Conditions: if, with comparison keywords big, sml, eql, and boolean operators and, or, not
  • Collections: Lists {} and dictionaries [] with easy syntax
  • Input: inp[...] to get user input
  • Comments: Use ! to ignore text on a line
  • Error Handling: try-catch-finally blocks for graceful error handling
  • Math: +, -, *, /, //, %, ^, and functions like abs(), round(), sqrt(), etc.
  • Utility Functions: len, range, keys, values, append, remove, contains, str, int, float
  • Easy to run: Execute .pb files with a single command

Installation

pip install pebble-lang

Usage

Running a Pebble program

pebble examples/hello.pb

Example Pebble program (hello.pb)

say "Hello Pebble!"

x is 2 ^ 3
say x            ! Output: 8

nums is {1, 2, 3}
say len(nums)    ! Output: 3

fnc greet(name):
    say "Hello " + name

greet("Rasa")

Loops and Conditions

go i in 1 to 5:
    say i

x is 10
if x big 5:
    say "x is bigger than 5"

Error Handling

try:
    x is 5 / 0
catch e:
    say "Error: " + e
finally:
    say "Cleanup done"

Collections

numbers is {1, 2, 3}
numbers is append(numbers, 4)
say numbers        ! Output: [1, 2, 3, 4]

person is [name: "Rasa", age: 14]
say keys(person)   ! Output: ["name", "age"]
say values(person) ! Output: ["Rasa", 14]

Input

name is inp["Enter your name: "]
say "Hello " + name

License

MIT License See LICENSE for details.


Contributing

Contributions are welcome! Please open issues or pull requests on the GitHub repository.


Contact

Created by Rasa8877 GitHub: https://github.com/Rasa8877/pebble-lang

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

pebble_lang-1.0.3.tar.gz (5.0 kB view details)

Uploaded Source

Built Distribution

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

pebble_lang-1.0.3-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file pebble_lang-1.0.3.tar.gz.

File metadata

  • Download URL: pebble_lang-1.0.3.tar.gz
  • Upload date:
  • Size: 5.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pebble_lang-1.0.3.tar.gz
Algorithm Hash digest
SHA256 4fb0f651e0e81113ba20c943d44149279fe5e3984858a62945a93e0e390d6be7
MD5 2eb4d1b2e3259af958bb6de2936e7d0a
BLAKE2b-256 30ddef5f746d74f94af9793a1479d90afcf64163b216167cd4948a3ea93e13fd

See more details on using hashes here.

File details

Details for the file pebble_lang-1.0.3-py3-none-any.whl.

File metadata

  • Download URL: pebble_lang-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 5.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.5

File hashes

Hashes for pebble_lang-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 a56d6cc0f944474474b6230326affbdfb8c9fa5a39c8fc93b98dace495618736
MD5 438556ce4d0b53f4f0570ec8e7727e52
BLAKE2b-256 26c31dc75cf3e9ad867d2c59d31068cdd0f021b30ae6d24b4889b2a90b4e5e25

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