frameworks_runtimes_typescript_ts2native:基于 TypeScript 的代码转换框架项目

可将 TypeScript 代码转换为原生代码,适用于提升性能与内存效率。核心功能包括 TypeScript 到原生代码的编译转换,提供编译器、代码生成等模块,支持多种语法特性测试验证。【此简介由AI生成】

Branch5Tags4
FilesLast commitLast update
10 months ago
5 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago

Introduction

[English|简体中文]

A framework in openvela for converting TypeScript to native code.

Project Structure

├── lib
│   └── std.d.ts
├── package.json
├── README.md
├── README_zh-cn.md
├── src
│   ├── compiler.ts
│   ├── cwriter.ts
│   ├── debug.ts
│   ├── index.ts
│   └── resolver.ts
├── test
│   ├── any.ts
│   ├── array.ts
│   ├── binaryops.ts
│   ├── class.d.ts
│   ├── class.ts
│   ├── closure.ts
│   ├── console.ts
│   ├── enum.ts
│   ├── for.ts
│   ├── func.ts
│   ├── generic-object.ts
│   ├── hello.ts
│   ├── if.ts
│   ├── interface1.ts
│   ├── interface.ts
│   ├── literal_object.ts
│   ├── map.ts
│   ├── out
│   │   └── foo_native.cc
│   ├── primitive.ts
│   ├── set.ts
│   ├── t.d.ts
│   ├── template.ts
│   ├── test.ts
│   ├── tuple.ts
│   ├── types.ts
│   └── while.ts
└── tsconfig.json
  • src: Core project code.
  • test: Common test programs used to test the performance and memory changes after converting TypeScript to native code.

Usage

Project Compilation

npm run build

Converting Hello to Native Code

gcc -fPIC -shared -I<runtime-path> -o libhello.so out/hello.c
./runtime/tsshell hello

Introduction

可将 TypeScript 代码转换为原生代码,适用于提升性能与内存效率。核心功能包括 TypeScript 到原生代码的编译转换,提供编译器、代码生成等模块,支持多种语法特性测试验证。【此简介由AI生成】

Customize your domain