# temil

Latest version **0.0.19** (published 2024-12-03) · 0 weekly downloads

## Install

```sh
npm install temil
pnpm add temil
yarn add temil
bun add temil
```

## Health

**Score 35/100 (D)** — status: maintenance-mode.

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads; pre 1.0.

Negative: stale; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.19 |
| Published | 2024-12-03 |
| First published | 2023-05-10 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | ikkifirleaf |

## Links

- npm: https://www.npmjs.com/package/temil
- npm.io page: https://npm.io/package/temil

## Recent versions

- 0.0.19 (latest) — 2024-12-03
- 0.0.18 — 2024-12-02
- 0.0.17 — 2024-11-26
- 0.0.16 — 2024-11-22
- 0.0.15 — 2024-11-22
- 0.0.14 — 2024-11-22
- 0.0.13 — 2024-11-19
- 0.0.12 — 2024-01-26
- 0.0.11 — 2024-01-11
- 0.0.10 — 2024-01-08
- 0.0.9 — 2023-07-28
- 0.0.8 — 2023-07-28
- 0.0.7 — 2023-05-14
- 0.0.6 — 2023-05-14
- 0.0.5 — 2023-05-11
- … 5 more at https://npm.io/package/temil/versions

## README

# Temil
(**t**ree-evaluated **e**xpression, **m**inimally **i**nterpreted **l**anguage)

Temil is a small interpreted and purely expression based programming language. 

## Introduction
The main idea is to give controlled acess to execution functionality. 

In concept, Temil is just a definition of how to structure expressions, everything else is up to you. Although, for convenience, a lexer, a parser and the entrypoint for execution is provided.

## EBNF
```ebnf
whitespace = " " ;
operator = STRING ;
literal = [ "'" ], STRING, [ "'" ];
expression = "(", ( operator, { expression | literal } ), ")" ;
```

## Expressions
Expressions are Temils way of execution. Everything in Temil is an expression composed of an operator and a list of arguments, which may either be expressions or literals.

## Literals
Literals are a way of giving temil a "literal" value to work with. Everything written in between single quotation marks is considered top be a literal. By default temil knows what literals are, but does not know what to do with them. For that you'll need operators.

## Operators
Operators define the execution of your Temil Interpreter. By default there are no operators, so you'll have to write your own.

## Example
For this example we have two operators defined:

- `and` is an operator that takes two expressions, evaluates them, expects the evaluated values to be numbers and then adds them together.
- `num` is an operator that parses a temil literal and turns it into the host languages representation of a number.

```
(add (num '1') (num '2'))
```

The result of this expression is the number 3 in the host languages representation of a number.

---
_Source: https://npm.io/package/temil · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
