Skip to content

KILLinefficiency/PyKal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PyKal

This repository contains source code for PyKal, which is the official bindings library to embed Kal into Python via libkal.

Installation

$ pip3 install pykal

You must have libkal.so compiled and installed on your system for PyKal to function. Follow instructions for installation.

Usage Example:

from pykal import Kal

kal = Kal()

result = kal.exec(
    """
        var data = $data.

        len data -> size.
        first data -> f.
        last data -> l.
        var m = data[(size / 2) as int].

        <- [f, m, l].
    """,
    {
        'data': [1, 2, 3, 4, 5]
    {
)

print('Return Value:', result, '\n')

for r in result.to_list():
    print(r, r.to_number())

Related Repositories

  • Kal - Core Kal Interpreter.
  • PyKal - Python Bindings for Embeddable Kal.
  • JSKal - JavaScript Bindings for Embeddable Kal.
  • Kal Website - Offical Kal Website.

About

The official Python bindings for embeddable Kal.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors