All Projects → emlai → ts-llvm

emlai / ts-llvm

Licence: MIT license
TypeScript to LLVM compiler (abandoned)

Programming Languages

typescript
32286 projects
LLVM
166 projects
C++
36643 projects - #6 most used programming language

Projects that are alternatives of or similar to ts-llvm

NatsuLang
No description or website provided.
Stars: ✭ 96 (-63.91%)
Mutual labels:  native, llvm, aot
Ts Llvm
TypeScript to LLVM compiler (abandoned)
Stars: ✭ 230 (-13.53%)
Mutual labels:  native, llvm, aot
Scala Native
Your favorite language gets closer to bare metal.
Stars: ✭ 4,053 (+1423.68%)
Mutual labels:  native, llvm, aot
Awesome Graal
A curated list of awesome resources for Graal, GraalVM, Truffle and related topics
Stars: ✭ 302 (+13.53%)
Mutual labels:  llvm, aot
dmjit
.dmJIT is a Rust-based JIT compiler using modified auxtools, dmasm and Inkwell LLVM wrapper for boosting Byond DM performance without any hassle! (formerly known as dm-jitaux)
Stars: ✭ 18 (-93.23%)
Mutual labels:  llvm
clam
Static Analyzer for LLVM bitcode based on Abstract Interpretation
Stars: ✭ 180 (-32.33%)
Mutual labels:  llvm
chimera
🐍 A CLI tool for generating Boost.Python/pybind11 bindings from C/C++
Stars: ✭ 12 (-95.49%)
Mutual labels:  llvm
windigo
Windows API and GUI in idiomatic Go.
Stars: ✭ 187 (-29.7%)
Mutual labels:  native
hmg
💝 My personal Gentoo/Linux configuration backup files
Stars: ✭ 16 (-93.98%)
Mutual labels:  llvm
ugo-compiler-book
📚 µGo语言实现(从头开发一个迷你Go语言编译器)[Go版本+Rust版本]
Stars: ✭ 996 (+274.44%)
Mutual labels:  llvm
aot-loader
Load and pre-evaluate code at compile time
Stars: ✭ 16 (-93.98%)
Mutual labels:  aot
phpmon
Lightweight, native Mac menu bar app that interacts with Laravel Valet. Helps you manage multiple PHP installations, locate config files and more.
Stars: ✭ 1,896 (+612.78%)
Mutual labels:  native
glottie
OpenGL/WebGL based Lottie animation player
Stars: ✭ 60 (-77.44%)
Mutual labels:  llvm
native-xr-for-web
Add iOS and Android build with AR capabilities to your website or web-based app.
Stars: ✭ 27 (-89.85%)
Mutual labels:  native
malgo
A statically typed functional programming language.
Stars: ✭ 37 (-86.09%)
Mutual labels:  llvm
netty-native-demo
Instant Netty startup using GraalVM's Native Image Generation
Stars: ✭ 58 (-78.2%)
Mutual labels:  native
react-tinder-card
A npm react module for making react elements swipeable like in the dating app tinder.
Stars: ✭ 184 (-30.83%)
Mutual labels:  native
PointerScript
Scripting language with pointers and native library access.
Stars: ✭ 26 (-90.23%)
Mutual labels:  native
stack-guard
A toy implementation of 'Stack Guard' on top of the LLVM compiler toolchain
Stars: ✭ 21 (-92.11%)
Mutual labels:  llvm
xDL
🔥 xDL is an enhanced implementation of the Android DL series functions.
Stars: ✭ 117 (-56.02%)
Mutual labels:  native

Notice: This project is not being actively worked on. If you're interested to pick it up, let me know. See #12.

ts-llvm Build Status

ts-llvm is a compiler for TypeScript that generates LLVM code, which can then be optimized using all existing LLVM optimizations, and converted further into e.g. native code, WebAssembly, or JavaScript (using emscripten).

It uses the TypeScript Compiler API to parse and typecheck the input TypeScript code. The resulting TypeScript AST is transformed into LLVM IR using the llvm-node bindings. ts-llvm also provides a runtime library written in C++ that implements native replacements for built-in TypeScript APIs such as console.log.

ts-llvm is still in very early stages of development. For example, it cannot yet compile most TypeScript programs and it doesn't yet do any garbage collection. If you're willing to contribute, any help will be greatly appreciated. For questions you can create a GitHub issue or ask on the ts-llvm Slack.

Check out the language features roadmap and the standard library roadmap to see what has been implemented so far, and what still needs to be implemented for the v1.0 release.

Goals

  • Compile a strictly-typed subset of TypeScript to LLVM IR.
  • Use the TypeScript compiler API to parse and type-check the input code.
  • Implement the JavaScript standard library (such as the array and string types) in C++/C/Rust to allow TypeScript code compiled using ts-llvm to use it.
  • Experiment with ideas such as Node Addons written in TS compiled to native code using ts-llvm, with autogenerated JS/TS bindings.
  • Don't add new features to TypeScript, such as integer types or manual memory management.

Related projects

  • StaticScript, another TypeScript to LLVM compiler.
  • AssemblyScript, a TypeScript to WebAssembly compiler.
  • Speedy.js, a JavaScript subset to WebAssembly compiler. Uses the TypeScript compiler API.

Building from source

  1. You need to have LLVM installed on your system.
  2. Run npm install to install other dependencies. If llvm-config is not on your PATH, you may need to tell llvm-node where to find LLVM on your system, e.g. by running npm config set cmake_LLVM_DIR $(path-to-llvm/bin/llvm-config --cmakedir) before npm install.
  3. If you want ts-llvm to generate native code, you need to have llc and g++ (any C++ compiler) on your PATH. llc will not be required once llvm-node gains support for the LLVM legacy PassManager and addPassesToEmitFile APIs. g++ will not be required once ts-llvm learns to detect the system C++ compiler on its own.

Once everything above is set up, you can use the following commands:

  • npm run build will build the ts-llvm compiler in the build directory.
  • npm start will run the ts-llvm compiler. You can pass arguments to the compiler after two consecutive hyphens: e.g. npm start -- --help will print the compiler's usage information.
  • npm test will run the test suite. ts-llvm uses snapshot testing to test the output LLVM IR code. Use npm run updateSnapshots to update the snapshot files.

License

ts-llvm is licensed under the MIT license.

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].