C++ compiler written in Vanilla Javascript
 
 
 
 
Go to file
Gers2017 9a1ad1e7a4 feat(command line arguments): Add --target and --help flags
- Move generate_rust_code to interpreter
- Clean stuff.js
- Parse command line arguments
2023-05-04 16:23:08 -06:00
.gitignore refactor(build step): Add Makefile 2023-05-04 16:20:52 -06:00
Makefile refactor(build step): Add Makefile 2023-05-04 16:20:52 -06:00
README.md Cpp.js initial commit | cpp club 2023-04-22 18:57:55 -06:00
interpreter.js feat(command line arguments): Add --target and --help flags 2023-05-04 16:23:08 -06:00
main.cpp Cpp.js initial commit | cpp club 2023-04-22 18:57:55 -06:00
main.js feat(command line arguments): Add --target and --help flags 2023-05-04 16:23:08 -06:00
package.json Cpp.js initial commit | cpp club 2023-04-22 18:57:55 -06:00
parser.js feat(command line arguments): Add --target and --help flags 2023-05-04 16:23:08 -06:00
run.sh Cpp.js initial commit | cpp club 2023-04-22 18:57:55 -06:00
stuff.js feat(command line arguments): Add --target and --help flags 2023-05-04 16:23:08 -06:00
utils.js Cpp.js initial commit | cpp club 2023-04-22 18:57:55 -06:00

README.md

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;
}