/yovec

A functional, vector-based language that transpiles to YOLOL

Primary LanguagePythonGNU Affero General Public License v3.0AGPL-3.0



Yovec

A functional, vector-based language that transpiles to YOLOL.

FeaturesGetting StartedLicense

Features

  • Simple, unambiguous syntax
  • Supports numbers, vectors, and matrices
  • Interoperable with YOLOL (via imports and exports)

Example program:

// Calculate the Euclidean distance between two vectors.

import n

let vector A = [1, 2, 3]
let vector B = [$n, $n, $n]
let vector C = map ^2 (A - B)
let vector D = [reduce + C]
let vector E = map sqrt D

export E as dist

Getting Started

To clone and run Yovec, you'll need Git and Python 3.5 (or newer).

# Clone the repository
git clone https://github.com/averycrespi/yovec.git

# Install dependencies
pip3 install lark-parser

# Run Yovec
python3 yovec.py -i in.yovec -o out.yolol

To learn the Yovec language, check out some example programs or read the full language spec.

License

AGPLv3