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
  • Math: +, -, *, /, //, %, ^
  • 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}
count is 0
go n in nums:
    count is count + 1
say count
! Output: 3

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

greet("Rasa")

Loops and Conditions

nums is {0, 1, 2}
go i in nums:
    say "Hello"

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

Collections

numbers is {10, 20, 30}
say numbers

person is [name: "Rasa", age: 14]
say person

go n in numbers:
    say n * 2

say person["name"]
say person["age"]

This will output:

[10, 20, 30]
{'name': 'Rasa', 'age': 14}
20
40
60
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-2.0.0.tar.gz (6.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-2.0.0-py3-none-any.whl (6.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pebble_lang-2.0.0.tar.gz
  • Upload date:
  • Size: 6.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-2.0.0.tar.gz
Algorithm Hash digest
SHA256 1c99910a6b5b7ba3e251c32b9c148ff1b717807619f333b9db023109b6e876f4
MD5 913ebaf5a47924c9a41068dce0f12084
BLAKE2b-256 37d8978328822c8166a5df38e1829c798aec43564ca2158557ab1d97e64fb0f8

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pebble_lang-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 6.2 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-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cf25e7341c94f6bd7c2339dac568941512e1e65b9cea358211851befc8e3786e
MD5 dc8753f09824c4c104089be48daaf20e
BLAKE2b-256 4686ceb82be1f32247d494177149c8406ac83a04015c6b9adf19caaa14e20d8d

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