walnut/lang

There is no license information available for the latest version (0.0.8) of this package.

0.0.8 2025-03-28 02:16 UTC

This package is not auto-updated.

Last update: 2025-04-25 23:37:46 UTC


README

The follow-up of the Cast and the Walnut languages.

Installation

To install the latest version, use the following command:

$ composer require walnut/lang

Usage

Walnut is a programming language which you can easily call from any PHP code. You can use the CliEntryPoint for interactions between the language and the host environment.

Sample usage:

use Walnut\Lang\Implementation\Program\EntryPoint\Cli\CliEntryPointFactory;
$rootDir = __DIR__; //or something different
$sourceRoot = $rootDir . '/nut-src';
$packages = ['core' => $rootDir . '/vendor/walnut/lang/core-nut-lib'];

$result = new CliEntryPointFactory($sourceRoot, $packages)
    ->entryPoint->call('start', 'arg1', 'arg2'); //Call the main function of the `start` module
echo "Result: $result", PHP_EOL;

Demos

Documentation

  1. Index
  2. Introduction
  3. Types and Values
  4. Functions
  5. Expressions
  6. Method Reference