Skip to main content

A Calcium language interpreter

Project description

calcium-py

A Calcium language intepreter on Python

What is Calcium language?

Calcium is a programming language that takes a JSON array as input. It is interoperable with the Python language, allowing you to utilize Python's standard libraries and more. It is primarily designed as a subset of Python.

How to create the interpreter and run Calcium code

from calciumlang.runtime import Runtime

# Calcium code is given as a JSON array.
calcium_code = [
  [1, [], "#", "0.0.1"],
  [1, [], "expr", ["call", ["var", "print"], ["Hello, World."]]],
  [1, [], "end"],
]

# The Runtime executes Calcium code.
r = Runtime(calcium_code)
r.run()  # outputs 'Hello, World.'

Applications using Calcium

With Blockly, you can generate Calcium code in a visual environment. This editor produces Calcium code (a JSON array) that can be executed by calcium-py.

Documentation

See here.

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

calciumlang-0.0.1.tar.gz (20.3 kB view hashes)

Uploaded Source

Built Distribution

calciumlang-0.0.1-py3-none-any.whl (21.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page