cpp.js/README.md

572 B

Cpp.js

C++ compiler written in Vanilla Javascript

Features

  • Compiles c++ to Rust
  • Compiles c++ to Php (Not yet)

Motivation

Because I had no other choice.

Example

# node main.js <file>.cpp
node main.js main.cpp # compiles a main.cpp file to rust

Test rust code

# rustc <file>.rs -o <file>.out
rustc main.rs -o main.out

Support

  • // comments
  • printf("...");
  • return
#include <cstdio>

int main()
{
    // This is comment
    printf("Hello from c++\n");
    return 0;
}