v8eval

Multi-language bindings to JavaScript engine V8

Github星跟踪图

v8eval

PyPI version
Gem Version
GoDoc

Multi-language bindings to JavaScript engine V8.

Currently v8eval provides Go, Python and Ruby bindings to the latest V8 7.1 and supports Linux and Mac OS X.
v8eval uses SWIG and can be extended easily for other languages.

Pre-installation

Linux

See Dockerfile.

Mac

See .travis.yml.

Installation

The installation takes several tens of minutes due to V8 build.

Go

v8eval requires Go 1.10 or later.

git clone https://github.com/sony/v8eval.git ${GOPATH}/src/github.com/sony/v8eval
${GOPATH}/src/github.com/sony/v8eval/go/build.sh install

In the case of Linux, you need to build your Go program with build.sh:

${GOPATH}/src/github.com/sony/v8eval/go/build.sh go build

Python

pip install v8eval

Ruby

gem install v8eval

Documentation

Go

See godoc.org.

Python

You can create the Sphinx documentation under python/docs.

python/build.sh docs

Ruby

You can create the YARD documentation under ruby/doc.

ruby/build.sh docs

Examples

Go

import "github.com/sony/v8eval/go/v8eval"

func Add(x, y int) int {
	var v8 = v8eval.NewV8()
	v8.Eval("var add = (x, y) => x + y;", nil)

	var sum int
	v8.Call("add", []int{x, y}, &sum)
	return sum
}

Python

import v8eval

def add(x, y):
    v8 = v8eval.V8()
    v8.eval('var add = (x, y) => x + y;')
    return v8.call('add', [x, y])

Ruby

require 'v8eval'

def add(x, y)
  v8 = V8Eval::V8.new
  v8.eval('var add = (x, y) => x + y;')
  v8.call('add', [x, y])
end

License

The MIT License (MIT)

See LICENSE for details.

主要指标

概览
名称与所有者sony/v8eval
主编程语言C++
编程语言CMake (语言数: 8)
平台
许可证MIT License
所有者活动
创建于2015-09-18 17:38:02
推送于2020-12-29 20:49:19
最后一次提交2020-12-29 20:48:46
发布数17
最新版本名称0.3.2 (发布于 )
第一版名称0.1.4 (发布于 )
用户参与
星数413
关注者数17
派生数36
提交数156
已启用问题?
问题数23
打开的问题数14
拉请求数9
打开的拉请求数0
关闭的拉请求数5
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?