# prgm-lang

> This is my custom programming language for my OS.

Latest version **2.1.0** (published 2024-03-20) · ISC license · 0 weekly downloads

## Install

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

Provides the command `prgm`.

## Health

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

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.1.0 |
| Published | 2024-03-20 |
| First published | 2023-08-23 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 83.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Noob Killa Studios |
| Maintainers | noob-killa5412 |

## Links

- npm: https://www.npmjs.com/package/prgm-lang
- Repository: https://github.com/NoobKilla5412/PRGM
- Homepage: https://github.com/NoobKilla5412/PRGM#readme
- Issues: https://github.com/NoobKilla5412/PRGM/issues
- npm.io page: https://npm.io/package/prgm-lang

## Dependencies (1)

- [yargs](https://npm.io/package/yargs.md) ^17.7.2

## Recent versions

- 2.1.0 (latest) — 2024-03-20
- 2.0.0 — 2024-03-20
- 1.5.0 — 2024-03-14
- 1.4.7 — 2024-03-09
- 1.4.6 — 2024-03-09
- 1.4.5 — 2024-03-09
- 1.4.4 — 2024-03-09
- 1.4.3 — 2024-03-09
- 1.4.2 — 2024-03-09
- 1.4.1 — 2024-03-09
- 1.4.0 — 2024-03-09
- 1.3.0 — 2024-02-23
- 1.2.0 — 2024-02-23
- 1.1.11 — 2023-10-09
- 1.1.10 — 2023-10-09
- … 16 more at https://npm.io/package/prgm-lang/versions

## README

# PRGM-lang

This is a programming language that I made.

## Example

```prgm
class Point {
  x = 0;
  y = 0;

  constructor(x, y) {
    this.x = x;
    this.y = y;
  }

  operator +=(other) {
    this.x += other.x;
    this.y += other.y;
    this;
  }

  toString() {
    "(" + this.x + ", " + this.y + ")";
  }
}

point = Point(10, 5);

println(point.toString());

canMove = true;

function move() {
  point.x += 1;
}

if (canMove) then point.x += 10;
else point.x -= 0;

if (!canMove) {
  println("Error");
} else move();
```

## Syntax

### Operators
All operators require spaces in between them.
```prgm
!cond # not cond
cond = true
i += 1
i -= 1
i /= 2
i *= 2
i %= 2
cond || otherCond # BUG: Both sides evaluate no matter what
cond && otherCond # BUG: Both sides evaluate no matter what
i < 1
i > 1
i <= 1
i >= 1
cond == true
cond != true
i + 1
i - 1
i * 2
i / 2
i % 2
obj.prop
```

### Call functions
```prgm
fnName(arg1, arg2, arg3);
```

### Block
```prgm
{
  # lines of code separated by ";"
}
```

### If
```prgm
if (cond) {
  true;
} else {
  false;
}

if (cond) then true; else false;
```

### Do-While
```prgm
do {
  # lines of code separated by ";"
} while (cond);
```

### Async while
```prgm
_while (cond) {
  # code
}
```

### While
```prgm
while (cond) {
  # code
}
```

### Function
The last expression evaluated is the return value of the function.
```prgm
function fnName(arg1, arg2, arg3) {
  # function body
}
```

### Object
```prgm
object {
  prop1: "Foo",
  prop2: "Bar",
  "Prop with spaces": 2
}
```

### Class
```prgm
class ClassName extends OtherClass {
  x = 2;
  y = 6;

  constructor(arg1, arg2) {
    # body
  }

  method1(arg) {
    # body
  }

  prop1 = "Foo";
}
```

### Import
```prgm
import "path";
```

### Other types
```prgm
# Null:
null
# Bool
true
false
# Num
1
2
3.5
# String
"Foo"
# Char
'a'
'b'
```

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