AI Zone Admin Forum Add your forum

NEWS: survey on 3000 US and UK consumers shows it is time for chatbot integration in customer service!read more..

RiveScript in Go

RiveScript has been rewritten in yet another programming language. This time it’s Google’s Go language!

I’ve just gotten to the point that I’m ready to announce it. So that means this module is considered beta status and I’d like some people to test it. smile Feature-wise it should be on par with all of the other versions of RiveScript; I ported over all the unit tests from the JavaScript version and they all passed.

Feature Highlights:

* Native support for running JavaScript object macros via otto ( The JavaScript has full access to the Go RiveScript API. Macros should be shareable with the JS version of RiveScript!
* Support for Golang object macro handlers, but these need to be compiled into your bot with `SetSubroutine()` (Go isn’t a dynamic language and can’t compile its own code).
* It’s written in Go! So your bot can be compiled into a native executable on most platforms and it probably runs a lot faster than the other RiveScript implementations.

GitHub repo:

* RiveScript Library:
* RiveScript Stand-alone Interpreter:
* JavaScript Object Macros:

Quick start, how to build the stand-alone interpreter:

1. Install Golang and set your $GOPATH (assuming it’s `~/go` for the rest of these steps)
2. `go get`
3. `cd ~/go/src/`
4. Quick testing: `go run cmd/rivescript/main.go eg/brain`
5. Build/install: `go install`

Future possibilities:

With Go v1.5, packages can be built as C-compatible shared objects (.so/.dll files). This means that RiveScript-Go should be linkable with many different programming languages, if they have an API for linking with C code. Examples include Perl, Python, Ruby, PHP, C#...

So this should be the last time I rewrite RiveScript from scratch. I’ll still support the other four implementations (Perl/Python/JS/Java), but any new languages will use a binding to the Go version. Also for the fun of it I’ll bind Python to Go and see how its performance compares to the native Python RiveScript. wink


  login or register to react