# HypeScript | A Simplified Implementation Of TypeScript's Type System

**URL:** <https://onehack.st/t/hypescript-a-simplified-implementation-of-typescripts-type-system/287828>\
**Category:** Tools & Scripts\
**Tags:** tools, programming, freebies, technology\
**Created:** [July 28, 2024, 9:04pm UTC](https://onehack.st/t/hypescript-a-simplified-implementation-of-typescripts-type-system/287828 "2024-07-28T21:04:27Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prometheus](https://onehack.st/user_avatar/onehack.st/prometheus/32/34950_2.png) [@Prometheus](https://onehack.st/u/Prometheus)\
**Post date:** [July 28, 2024, 9:04pm UTC](https://onehack.st/t/hypescript-a-simplified-implementation-of-typescripts-type-system/287828/1 "2024-07-28T21:04:27Z")

</div>

## 🐬 HypeScript

### Introduction

This is a simplified implementation of [TypeScript](https://github.com/microsoft/TypeScript)’s type system that’s written in TypeScript’s type annotations. This means that it uses types only — with no runtime code whatsoever.

You pass TypeScript code as a string to the `TypeCheck` generic and get possible type errors back ( **See the live demo** ):

[![showcase-1](https://github.com/ronami/HypeScript/raw/master/images/example1.png)](https://github.com/ronami/HypeScript/blob/master/images/example1.png)

_☝ Please note that this project is meant to be used for fun and learning purposes and not for practical use._

### Try running the code

See a live demo in your browser on the TypeScript Playground.

Alternatively, install `@ronami/hypescript` in your project with `yarn` or `npm` (TypeScript 4.7 or later is required):

```auto
yarn add @ronami/hypescript

```

### Code examples

Only a subset of TypeScript’s syntax and features are available. Here’s a list of examples ( **with browser demo links** ) for some code examples:

- Variables
- Functions
- Arrays
- Objects
- Methods
- Function return type
- Equality
- Arithmetic operations
- Globally types

### Inspiration

- [TypeScripts Type System is Turing Complete](https://github.com/microsoft/TypeScript/issues/14833)
- [Functions and algorithms implemented purely with TypeScript’s type system](https://github.com/ronami/meta-typing)
- [Typing the Technical Interview in TypeScript](https://gal.hagever.com/posts/typing-the-technical-interview-in-typescript/)
- [A collection of TypeScript type challenges with online judge](https://github.com/type-challenges/type-challenges)
- [Extreme Explorations of TypeScript’s Type System](https://www.learningtypescript.com/articles/extreme-explorations-of-typescripts-type-system)
- [A SQL database implemented purely in TypeScript type annotations](https://github.com/codemix/ts-sql)

## GitHub:

[https://github.com/ronami/HypeScript](https://github.com/ronami/HypeScript)
