DeSc1998 / yadl-zig

A simple data querying language
MIT License
1 stars 0 forks source link

Yet Another Data Language

Yadl is a data querring and processing language.

The main reason why we build this language is to simplify processing and modifying of data. SQL (most if not all dialects), which is mostly used for storing and querring data, is not useful for modifying data and most programming languages usually do not provide functionality for reading and saving data like csv out of the box.

NOTE: This project was originally a group affort in a university context. After the semester was over I started rewritting yadl in zig and offered the rest of the group to contribute but no one did so far.

The original project can be found here mirrored by one of the contributers.

Table of Contents

  1. Quick Start
  2. Build Instructions
    1. Prerequisites
    2. Building in Terminal/Shell
  3. Testing of Code
    1. Unit testing
    2. Testing with pytest

Quick Start

Simply run to build:

> zig build run -- <files...>

This will run the run-task defined in build.zig and add <files...> as arguments.

Build Instructions

Prerequisites

Building in Terminal/Shell

Run the following commands in the project root.

Just building:

zig build

Running:

zig build run

Running with Program arguments:

zig build run -- args...

Testing of Code

Unit testing

Similar to building in the terminal you execute the following for the scala unit tests:

zig build test

or for more details:

zig build test --summary all

Testing with pytest

These tests involve a bit more work to be run. For the duration of these steps I assume you are at the root of the project.

Prerequisites

Install pytest

Step 1

Just compile at least once.

Step 2

The python scripts relies on envirnoment variable to be pointed to the yadl interpreter.

To set the env. var. use:

For Linux:

export YADL_BIN=zig-out/bin/yadl-linux

For Mac:

export YADL_BIN=zig-out/bin/yadl-mac

For Windows (may work, previous ci test failed though):

set YADL_BIN=.\\zig-out\\bin\\yadl-win.exe

Step 3

Finally run pytest:

pytest test-scripts/