GithubHelp home page GithubHelp logo

microsoft / v8managedwrapper Goto Github PK

View Code? Open in Web Editor NEW
15.0 5.0 2.0 68 KB

V8 is Google’s open source high-performance JavaScript engine, written in C++. This wrapper project will expose some of V8 functionalities to managed (e.g: C#) world to execute JavaScript. This library could be use in Aspnet core project or any embedded application.

License: MIT License

Batchfile 7.71% C# 33.49% JavaScript 26.49% Makefile 0.88% C++ 20.52% C 10.92%

v8managedwrapper's Introduction

V8 Managed Library for Embedding Application

V8 is Google’s open source high-performance JavaScript engine, written in C++. It is used in Google Chrome, the open source browser from Google, and in Node.js, among others. It implements ECMAScript as specified in ECMA-262, and runs on Windows 7 or later, macOS 10.12+, and Linux systems that use x64, IA-32, ARM, or MIPS processors. V8 can run standalone, or can be embedded into any C++ application.

This wrapper project will expose some of V8 functionalities to managed (e.g: C#) world to execute JavaScript. Bing UX platform is using this v8.dll in their Aspnet application to execute JavaScript on server.

How to Build V8 with Wrapper Code

V8Build.cmd is a small batch file which will download V8 source code and build. V8_Native.sln is a C project which expose V8 api for P/Invoke. If you interest to get more information about V8 build please visit Here.

Please make sure you install all prerequisite in your machine(install Visual Studio, Debugging tools for Windows). Here is the stuff to install in your machine :

  1. Visual Studio with Microsoft.VisualStudio.Workload.NativeDesktop and Microsoft.VisualStudio.Component.VC.ATLMFC
  2. Windows SDK
  3. Debugging Tools For Windows

Please follow Setting up Windows [Visual Studio] section in the wiki. You don't need to install depot_tools, V8Build.cmd will take care of all the V8 dependency.

**Build Instruction **

V8Build.cmd will initialize Visual Studio 2019 Developer Command Prompt and setup proper environment variable. Then It'll download depot_tools and V8 source code and build it.

**Command** for V8Build.cmd

**Arguments :**
   init    =  It will download V8 source code and dependency(depot_tools). If you already have the V8 source code then don't pass this flag.

   [mode]   = debug/release. This will build V8 in debug mode. Default mode is "release"

   [revision] = Optional. You can specify any specific version of V8. e.g: Examples: "master", "8.9.4".
  1. Build V8 without having v8 source code.
   >> V8Build.cmd init debug/release(default) x64(default) / arm64
  1. Build V8 (if you have downloaded the V8 code via init command)
   >> V8Build.cmd  debug/release(default)

Output Folder Structure

lib\
  ---v8_monolith.lib
  ---include
      ---- .h files
  1. Open V8_Native\V8_Native.sln file and build it.
   cd V8_Native
   msbuild V8_Native.vcxproj /p:configuration=release /p:platform=x64
  1. Open and build V8_Managed_Library. V8_Managed_Library\JsRT.V8 is the managed wrapper library which do P/Invoke V8.dll.
   cd V8_Managed_Library
   dotnet build
   ; running test project
   cd Tests
   dotnet run

v8managedwrapper's People

Contributors

microsoft-github-operations[bot] avatar microsoft-github-policy-service[bot] avatar microsoftopensource avatar siamabdullah avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

Forkers

ehtick benliao

v8managedwrapper's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.