All Projects â†’ TheLartians â†’ TypeScriptXX

TheLartians / TypeScriptXX

Licence: Unlicense License
🧷 Stay safe! Type-safe scripting for C++ using TypeScriptToLua and CMake with auto-generated declarations.

Programming Languages

CMake
9771 projects
C++
36643 projects - #6 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to TypeScriptXX

Emscripten Docker
Docker image with Emscripten to compile ASM.js and WebAssembly
Stars: ✭ 92 (+178.79%)
Mutual labels:  webassembly, wasm, emscripten, asmjs
Modern Wasm Starter
🛸 Run C++ code on web and create blazingly fast websites! A starter template to easily create WebAssembly packages using type-safe C++ bindings with automatic TypeScript declarations.
Stars: ✭ 140 (+324.24%)
Mutual labels:  webassembly, wasm, emscripten, asmjs
Dcmjs
dcmjs is a javascript cross-compile of dcmtk (dcmtk.org).
Stars: ✭ 92 (+178.79%)
Mutual labels:  webassembly, wasm, emscripten, asmjs
Wasmjit
Small Embeddable WebAssembly Runtime
Stars: ✭ 1,063 (+3121.21%)
Mutual labels:  embedded, webassembly, wasm, emscripten
Wasmer
🚀 The leading WebAssembly Runtime supporting WASI and Emscripten
Stars: ✭ 11,047 (+33375.76%)
Mutual labels:  webassembly, wasm, emscripten
Opus Stream Decoder
Instantly decode Ogg Opus audio streams in chunks with JavaScript & WebAssembly (Wasm)
Stars: ✭ 80 (+142.42%)
Mutual labels:  webassembly, wasm, emscripten
Wasm Micro Runtime
WebAssembly Micro Runtime (WAMR)
Stars: ✭ 2,440 (+7293.94%)
Mutual labels:  embedded, webassembly, wasm
Securityworker
The best javascript code protection solution ever.
Stars: ✭ 626 (+1796.97%)
Mutual labels:  webassembly, emscripten, asmjs
Assortedwidgets
OpenGL GUI library
Stars: ✭ 92 (+178.79%)
Mutual labels:  webassembly, wasm, emscripten
Tdl
Node.js bindings to TDLib.
Stars: ✭ 177 (+436.36%)
Mutual labels:  webassembly, wasm, bindings
Awesome Wasm Langs
😎 A curated list of languages that compile directly to or have their VMs in WebAssembly
Stars: ✭ 2,966 (+8887.88%)
Mutual labels:  webassembly, wasm, asmjs
Asm Dom Boilerplate
A simple boilerplate to start using asm-dom without configuration.
Stars: ✭ 49 (+48.48%)
Mutual labels:  webassembly, wasm, asmjs
Cargo Web
A Cargo subcommand for the client-side Web
Stars: ✭ 1,026 (+3009.09%)
Mutual labels:  webassembly, emscripten, asmjs
Asm Dom
A minimal WebAssembly virtual DOM to build C++ SPA (Single page applications)
Stars: ✭ 2,604 (+7790.91%)
Mutual labels:  webassembly, wasm, asmjs
Wasm3
🚀 The fastest WebAssembly interpreter, and the most universal runtime
Stars: ✭ 4,375 (+13157.58%)
Mutual labels:  embedded, webassembly, wasm
Cppwasm Book
📚 WebAssembly friendly programming with C/C++ -- Emscripten practice
Stars: ✭ 956 (+2796.97%)
Mutual labels:  webassembly, wasm, emscripten
Rustynes
👾 An NES emulator by Rust and WebAssembly
Stars: ✭ 399 (+1109.09%)
Mutual labels:  webassembly, wasm, emscripten
Camaro
camaro is an utility to transform XML to JSON, using Node.js binding to native XML parser pugixml, one of the fastest XML parser around.
Stars: ✭ 438 (+1227.27%)
Mutual labels:  webassembly, wasm, emscripten
Webassembly Examples
From Simple To Complex. A complete collection of webassembly examples.
Stars: ✭ 177 (+436.36%)
Mutual labels:  webassembly, wasm, emscripten
Raylib
A simple and easy-to-use library to enjoy videogames programming
Stars: ✭ 8,169 (+24654.55%)
Mutual labels:  embedded, webassembly, wasm

Actions Status Actions Status Actions Status Actions Status codecov

TypeScriptXX

About

This is a template project that uses the Glue library to add type-safe scripting capability to a C++ project. Scrips are coded in TypeScript, transpiled using tsc or TSTL and run in by node.js or an an embedded Lua engine. The built JavaScript target can also be run in a browser and used on a website. The TypeScript declarations are automatically generated and updated by CMake.

Usage

Transpile to Lua and run natively

The following commands build the project and run the typescript script.

cmake -HstandaloneLua -Bbuild/lua

 # Compiles C++ code, updates the declarations and transpiles TypeScript
cmake --build build/lua -j8

# runs the transpiled lua script at dist/lua/index.lua
./build/lua/TypeScriptXX --script dist/lua 

Is is also possible to enable watch mode for hot reloading. This way any code changes to the TypeScript source will be transpiled and run automatically.

npx concurrently "npm run watch:lua" "./build/lua/TypeScriptXX -s dist/lua --watch"

Transpile to JavaScript and run in node.js

First, install and activate the emsdk. The following commands build the project and run the typescript script.

emcmake cmake -HstandaloneJS -Bbuild/js

 # Compiles C++ code, updates the declarations and transpiles TypeScript
cmake --build build/js -j8

# runs the transpiled lua script at dist/js/index.js
node ./build/js/TypeScriptXX.js --script dist/js 

How it works

The example C++ library is exposed to TypeScript using Glue bindings.

The projects contains four standalone subprojects:

After building, CMake will use the latter to ensure that the declarations at typescript/cpplib.d.ts are up-to-date and then transpile the TypeScript code to Lua or JavaScript.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].