Skip to content
This repository was archived by the owner on Oct 21, 2023. It is now read-only.

theycallhermax/TSCPL

Repository files navigation

TSCPL

TSCPL (TypeScript Compiled Programming Language) is a port of ACPL. The original ACPL compiler compiles ACPL files to C, but TSCPL can compile ACPL files to TypeScript and even run ACPL files after compilation.

Installation

npm install -g tscpl

Compiling and Running ACPL files

Compiling

To compile a ACPL file, you just need to run the following command:

tscpl [ACPL file here]

Running

Since version 1.1.0, TSCPL can run ACPL files automatically after the file is compiled. To do this, run the following command:

tscpl [ACPL file here] --run

Output files

TSCPL compiles ACPL files to TypeScript in the file format of [original ACPL file name].ts. Since version 1.2.0, you can use the --output flag to output the compiled ACPL file to any file name you want! Please note that this doesn't change the output language. To do this, run the following command:

tscpl [ACPL file here] --output [compiled ACPL file name here]

libtscpl

Since version 1.2.0, libtscpl is the backend for TSCPL written in TypeScript. It provides TSCPL with it's core functions, such as compiling ACPL files.

Documentation

compile()

Compiles a ACPL file.

Example script

# main.acpl
outln "Hello from libtscpl!"
// index.ts
import { compile } from "tscpl";

try {
    compile("main.acpl", "main.acpl.ts");
} catch(e) {
    console.error(e);
}