Skip to content

germinolegrand/Cpp.js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

55 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status

Cpp.js is a project with no pretention. It aims to be a JS interpreter in a C++ environment. The JS environment should be highly and easily manipulable from simple modern C++.

var{{
    {"console", {{
        {"log", var(
            [](auto args){
                std::copy(std::begin(args), std::end(args), std::ostream_iterator<var>(std::cout));
                std::cout << '\n';
                return var{};
            })
        }
    }}},
    {"exit", var(
        [](auto args)->var{
            exit(args.size() >= 1 ? static_cast<int>(args[0].to_double()) : 0);
        })
    }
}}

Currently it is still in an early stage, but is advanced enough to support a basic Interpreter.

You will find examples in tests/.

Build

This repository has submodules, don't forget init them :

# git submodule update --init

For Code::Blocks (see https://github.com/chris-be/premake-codeblocks):

# cd build
# premake5 codeblocks

For Linux:

# cd build
# premake5-linux64 gmake2
# make

For MinGW64:

# cd build
# premake5 gmake2
# mingw32-make