Skip to content

bluele/go-v7

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

go-v7

go-v7 is golang binding to v7.

V7 is a JavaScript engine written in C. It makes it possible to program Internet of Things (IoT) devices in JavaScript.

Install

$ go get -u github.com/bluele/go-v7

Example

Run something in the VM

package main

import (
  "fmt"
  "github.com/bluele/go-v7"
)

func main() {
  res, err = vm.Exec(`
    (function() {
      return 3.14;
    })();`)
  if err != nil {
    panic(err)
  }
  fmt.Println("result:", res)
}

Output:

result: 3.14

Benchmarks

$ cd benchmarks && go test -bench .
testing: warning: no tests to run
PASS
BenchmarkV7       200000              9176 ns/op
BenchmarkDuktape           30000             56500 ns/op
BenchmarkOtto      50000             24019 ns/op
ok      github.com/bluele/go-v7/benchmarks      5.717s

Author

Jun Kimura

About

Go binding to javascript engine v7.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published