Skip to content

Latest commit

 

History

History
53 lines (44 loc) · 1.22 KB

README.md

File metadata and controls

53 lines (44 loc) · 1.22 KB

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