# typestack-lang

> A stack-based, type-safe programing language

Latest version **1.6.8** (published 2023-06-21) · MIT license · 0 weekly downloads

## Install

```sh
npm install typestack-lang
pnpm add typestack-lang
yarn add typestack-lang
bun add typestack-lang
```

Provides the command `typestack`.

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.6.8 |
| Published | 2023-06-21 |
| First published | 2022-12-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Dependencies | 0 |
| Unpacked size | 103.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Brett Ormsby |
| Maintainers | brettormsby |

## Links

- npm: https://www.npmjs.com/package/typestack-lang
- Repository: https://github.com/BrettOrmsby/type-stack
- Homepage: https://brettormsby.github.io/typestack/
- Issues: https://github.com/BrettOrmsby/type-stack/issues
- npm.io page: https://npm.io/package/typestack-lang

## Recent versions

- 1.6.8 (latest) — 2023-06-21
- 1.6.7 — 2023-02-07
- 1.6.6 — 2023-02-05
- 1.6.5 — 2023-02-03
- 1.6.4 — 2023-02-03
- 1.6.3 — 2023-02-03
- 1.6.2 — 2023-02-03
- 1.6.1 — 2023-02-03
- 1.6.0 — 2023-02-03
- 1.5.2 — 2023-01-23
- 1.5.1 — 2023-01-09
- 1.5.0 — 2023-01-09
- 1.4.1 — 2023-01-08
- 1.4.0 — 2023-01-07
- 1.3.1 — 2023-01-06
- … 6 more at https://npm.io/package/typestack-lang/versions

## README

# TypeStack

**A stack-based, type-safe language** 

> **Warning**
>  This is a work in progress language

[Documentation](https://brettormsby.github.io/typestack/#theBasics)

## Instillation for CLI

```bash
npm install typestack-lang -g
```

## Running Files via CLI

```bash
# tsk is the file extension for typestack
typestack filename.tsk
```

## VSCode 

Download the [extension](https://marketplace.visualstudio.com/items?itemName=BrettOrmsby.typestack) to provide language support to `.tsk` files.

## Instillation for JavaScript

```bash
npm install typestack-lang
```

## Running TypeStack

```js
import typestack from "typestack-lang/dist/index.js";

await typestack(`
100 for loop {
    dup 15 % 0 ==
    if {
        "FizzBuzz" print drop
    } else {
        int dup 5 % 0 ==
        if {
            "Buzz" print drop
        } else {
            int dup 3 % 0 ==
            if {
                "Fizz" print drop
            } else {
                int print
            }
        }
    }
}
`);
```

## Example FizzBuzz Program

```python
100 for loop {
    dup 15 % 0 ==
    if {
        "FizzBuzz" print drop
    } else {
        int dup 5 % 0 ==
        if {
            "Buzz" print drop
        } else {
            int dup 3 % 0 ==
            if {
                "Fizz" print drop
            } else {
                int print
            }
        }
    }
}
```

## Example Number Guess Program

```python
# make the random number
1 100 rand

# repeat while the guess is wrong
loop {
  "Guess a number: " int read
  over over # create a copy of the guess and random number
  == if {
    "You are correct!" print
    break
  } else {
    int over # create a copy of the random number on the top
    > if {
      "Too high!" print drop
    } else {
      "Too low!" print drop
    }
  }
}
```

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