https://github.com/sebastian-nunez/ts-lang-interpreter
A custom programming language interpreter using TypeScript and Deno.
https://github.com/sebastian-nunez/ts-lang-interpreter
ast deno interpreter lexer typescript
Last synced: 6 months ago
JSON representation
A custom programming language interpreter using TypeScript and Deno.
- Host: GitHub
- URL: https://github.com/sebastian-nunez/ts-lang-interpreter
- Owner: sebastian-nunez
- Created: 2025-01-08T00:55:02.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-01-09T23:23:34.000Z (12 months ago)
- Last Synced: 2025-02-27T09:00:37.609Z (10 months ago)
- Topics: ast, deno, interpreter, lexer, typescript
- Language: TypeScript
- Homepage:
- Size: 50.8 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# TypeScript Custom Language Interpreter
This project is a demonstration of building a custom programming language interpreter using [TypeScript](https://www.typescriptlang.org/) and [Deno](https://deno.com/).
It provides a foundational understanding of the core components involved in creating an [interpreter](), including [lexical analysis](https://en.wikipedia.org/wiki/Lexical_analysis) (tokenization), parsing ([abstract syntax tree](https://en.wikipedia.org/wiki/Abstract_syntax_tree) generation), and [run-time execution](https://en.wikipedia.org/wiki/Runtime_system).
## Syntax
```rust
fn makeAdder (offset) {
fn add (x, y) {
x + y + offset
}
add
}
const adder = makeAdder(1);
print(adder(10, 5))
```
## Tech stack
- **Language:** [TypeScript](https://www.typescriptlang.org/) - used for writing the interpreter itself.
- **Runtime:** [Deno](https://deno.com/) - a JavaScript/TypeScript runtime environment used to execute the interpreter code.
## Getting started
### Running locally
1. [Install Deno](https://docs.deno.com/runtime/getting_started/installation/)
2. Install dependencies: `deno install`
3. Run the app: `deno run dev`