All Projects → ts-llvm → Ts Llvm

ts-llvm / Ts Llvm

Licence: mit
TypeScript to LLVM compiler (abandoned)

Programming Languages

javascript
184084 projects - #8 most used programming language
typescript
32286 projects

Projects that are alternatives of or similar to Ts Llvm

Scala Native
Your favorite language gets closer to bare metal.
Stars: ✭ 4,053 (+1662.17%)
Mutual labels:  compiler, llvm, aot, native
NatsuLang
No description or website provided.
Stars: ✭ 96 (-58.26%)
Mutual labels:  native, llvm, aot
ts-llvm
TypeScript to LLVM compiler (abandoned)
Stars: ✭ 266 (+15.65%)
Mutual labels:  native, llvm, aot
Hikari
LLVM Obfuscator
Stars: ✭ 1,585 (+589.13%)
Mutual labels:  compiler, llvm
Fanx
A portable programming language
Stars: ✭ 101 (-56.09%)
Mutual labels:  compiler, llvm
Brain
An esoteric programming language compiler on top of LLVM based on Brainfuck
Stars: ✭ 112 (-51.3%)
Mutual labels:  compiler, llvm
Ghdl
VHDL 2008/93/87 simulator
Stars: ✭ 1,285 (+458.7%)
Mutual labels:  compiler, llvm
Rhine
🔬 a C++ compiler middle-end, using an LLVM backend
Stars: ✭ 157 (-31.74%)
Mutual labels:  compiler, llvm
Ispc
Intel SPMD Program Compiler
Stars: ✭ 1,924 (+736.52%)
Mutual labels:  compiler, llvm
Jitfromscratch
Example project from my talks in the LLVM Social Berlin and C++ User Group
Stars: ✭ 158 (-31.3%)
Mutual labels:  compiler, llvm
Llvm Guide Zh
User Guides For those new to the LLVM system.(LLVM系统的新用户指南,中文翻译版)
Stars: ✭ 180 (-21.74%)
Mutual labels:  compiler, llvm
Faust
Functional programming language for signal processing and sound synthesis
Stars: ✭ 1,360 (+491.3%)
Mutual labels:  compiler, llvm
Numba Scipy
numba_scipy extends Numba to make it aware of SciPy
Stars: ✭ 98 (-57.39%)
Mutual labels:  compiler, llvm
Flax
general purpose programming language, in the vein of C++
Stars: ✭ 111 (-51.74%)
Mutual labels:  compiler, llvm
Enzyme.jl
Julia bindings for the Enzyme automatic differentiator
Stars: ✭ 90 (-60.87%)
Mutual labels:  compiler, llvm
Cs2cpp
C# to C++ transpiler (Cs2Cpp) (Powered by Roslyn)
Stars: ✭ 155 (-32.61%)
Mutual labels:  compiler, native
Play with llvm
A book about LLVM & Clang(中文开源书:玩转 LLVM)
Stars: ✭ 175 (-23.91%)
Mutual labels:  compiler, llvm
Lhc
The LLVM LHC Haskell Optimization System
Stars: ✭ 188 (-18.26%)
Mutual labels:  compiler, llvm
Dmd
dmd D Programming Language compiler
Stars: ✭ 2,498 (+986.09%)
Mutual labels:  compiler, native
Akilang
A compiler for a simple language, built with Python and LLVM
Stars: ✭ 71 (-69.13%)
Mutual labels:  compiler, llvm

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