JS-CMP is a transpiler that converts JavaScript code into C++ code, and then compiles the generated C++ code into a binary. It enables JavaScript developers to leverage the performance of C++ by converting their JavaScript codebases into optimized executables. The project is written in C++ and uses Boost libraries.
Ensure that you have git
, cmake
and g++
or another C++ compiler installed on your system.
git clone https://github.com/JS-CMP/JS-CMP.git
cd JS-CMP
git submodule update --init --recursive
Debian-based:
sudo apt install libboost-all-dev doxygen libicu-dev
Arch-based:
sudo pacman -S boost doxygen icu
Fedora:
sudo dnf install boost-devel doxygen libicu-devel
brew install boost doxygen icu4c
icu4c may need to be linked manually if not automatically detected by CMake:
brew link --force icu4c
cmake . && make
doxygen Doxyfile
To transpile a JavaScript file and execute the resulting binary:
./js_cmp <input-file> && ./<output-file>
JS-CMP currently supports Linux and macOS platforms. While it may be possible to build on Windows using tools like WSL or Cygwin, official support and testing have not been provided for Windows environments. Contributions for Windows compatibility are welcome.
Organization: https://github.com/JS-CMP