I got this e-mail today about RiveScript and thought my response would be good for a general audience as well.
Orion asked:
Hello Noah i want to know...
- What is Vanilla Rivescript?
- What can Vanilla Rivescript do?
- How can i install or use Vanilla Rivescript?
I wrote this article for the RiveScript Community Wiki, but am reposting it here for visibility.
I've been noticing more and more lately that people are using RiveScript to power Facebook Messenger chatbots, which adds a whole lot of complexity that RiveScript wasn't ready for. This article explains why RiveScript was designed the way that it is, what it's doing to support modern chatbots, and recommendations for how to design a modern chatbot.
This is something I wanted to rant about for a while: event loops in programming.
This post is specifically talking about programming languages that don't have their own built-in async model, and instead left it up to the community to create their own event loop modules instead. And how most of those modules don't get along well with the others.
Over the last couple months I've been slowly working on rewriting RiveScript in yet another programming language: Google's Go language! It's also my first project in Go, which is what tends to be the case (rewriting RiveScript in Java and Python were my first projects in those languages, too).
But this is the last time I'm going to be rewriting RiveScript from scratch.
I've spent the last few months porting over the JavaScript version of my chatbot scripting language, RiveScript, into CoffeeScript. I mainly did this because I didn't like to maintain raw JavaScript code (especially after I ran a linter on it and had to rearrange my variable declarations because JavaScript's variable scoping rules are stupid), but I also took the opportunity to restructure the code and make it more maintainable in the future.
For some historical background, the first RiveScript implementation was written in Perl, and I designed it to be one big monolithic file (RiveScript.pm
), because then I could tell noobs that they can update to a new version of RiveScript in their bots by just dropping in a new file to replace the old one, and avoid overwhelming them with the complexity of doing a CPAN installation (especially if they're generally new to Perl as well, and all they really wanna do is just run a chatbot.)
I've just spent pretty much the whole day redoing the website for RiveScript.com, and I think it looks pretty nice.
RiveScript.com was the final website on my server that was still running on my legacy PerlSiikir CMS, and it's been on my to-do list for a while to get it migrated over to my new Python CMS, Rophako like what Kirsle.net is currently running on. The old Perl code was clunky and ugly and memory-leaky, and now I'll be at ease if I ever need to migrate to a new web server, as my Python web apps are extremely quick to get up-and-running, whereas it was an hours-long ordeal to get PerlSiikir to run.
So, the bulk of the work actually needed for RiveScript.com was purely front-end. I revamped the whole web design to use Twitter Bootstrap and make it look all hip and edgy like how all the other small software project websites are these days.
Besides the programming language on the back-end, I had other reasons for why I wanted to simplify RiveScript.com: I don't have the motivation or energy to do as much with that site as I did previously.
I used to run a YaBB Forum on RiveScript.com, but it wasn't extremely active and it was getting hit by too many spam bots, so several months ago I shut that down and linked to the RiveScript forum at Chatbots.org.
More recently I had programmed a chatbot hosting service that was on RiveScript.com, but that wasn't very popular either. I know nobody was using it because it had been broken for months and I hadn't heard any complaints. ;) A couple months ago I sunsetted that feature by turning off new site registrations and removing some references to the feature. And now that's officially gone! If you actually had a bot hosted there, contact me and I can get you your bot's reply files back.
So, the new site is simple and minimalistic and is just about the RiveScript language itself. It was an ordeal rewriting all of the pages from scratch (well, most of them) but now that it's done, the site should be very low-maintenance for me.
One of the most fun parts of it was that I ported over my "Try RiveScript Online" page to use JavaScript and run in the browser, whereas the old version had a Perl back-end (because a JavaScript version of RiveScript didn't exist at the time), so that's even one less thing for me to maintain and make sure it doesn't break. :)
And, the front-end pages for the new site are also open source, FWIW.
In an older blog post I mentioned getting Alicebot Program V, a Perl implementation of an Alice AIML bot, up and running on a modern version of Perl, but I didn't go into any details on what I actually did to get this to work (which wasn't very nice of me ;) ).
Unfortunately for me I also didn't even write down any notes for myself, so I had to figure it out again, myself, from scratch. Which I decided to do, only this time I wrote down some notes, and published a new, updated version of Program V which you can check out on GitHub -- or for the lazy, get a zipped release of Program V 0.09.
This blog post is about what I needed to do to get Program V up and running, some of which is also outlined in UpdateNotes.md
on the GitHub repo.
Front (click for bigger picture) |
Back (click for bigger picture) |
Zoom-in on back.
If you want one it's $20 at cafepress.com/rivescript.
It supports all the directives and tags that the Perl version does, including the trickier things like the %previous tag and topic inheritance/includes. The only notable thing it doesn't support yet is object macros, because Java isn't a dynamic language and can't dynamically execute more Java code. So, eventually I'll be adding JavaScript support to it for object macros, and maybe even find a clever way to get Perl macros to work with it too.
With this I eventually plan on creating some RiveScript-enhanced Android apps, like a "personal assistant" chatbot that can talk out loud and listen to you using Android's text/speech converter libraries.
On my many attempts to learn C++ I never actually made anything useful that wasn't a tutorial-like program (with the exception being a single-threaded CyanChat library I was working on but never completed). So this time I decided to just skip the tutorial b/s and dive right in to making a RiveScript C++ library, and Google things as I run into them.
I knew about C++ strings (who doesn't?) which are a big improvement over what C has, but I newly discovered vectors (dynamic resizable arrays) and maps (associative arrays) and among these three, it covers all the basic data types I'm used to in Perl.
I hit a roadblock though when it came to constructing the large data structure that the Perl RiveScript module makes and which I'm familiar with, but looking into C++'s struct
solved that pretty quickly.
All this attention to RiveScript lately, though, made me remember the point about how the Perl RiveScript module (the only feature-complete implementation of RiveScript to date) is released under the GNU General Public License, which would demand that any application that uses it also be released under open source.
I was thinking of re-licensing RiveScript under a more open license to see if it could drive up usage of it for non-GPL projects. I was considering something like the LGPL, Apache or BSD license. But, I think I have a better idea!
At work I was using ExtJS for a while and I saw how their licensing scheme works: they dual-license their code; the GPL licensed version is free to use, but being GPL code it demands that your entire application be made open source. They then have a commercial license that allows you to use their library in a non-open application, for a fee.
I think this may be the better way to go. For the open source folks who use RiveScript today nothing changes, but if somebody wants to create a commercial application with RiveScript they wouldn't be able to use the GPL-licensed version. After watching all the news about SmarterChild and its parent company (Colloquis, now owned by Microsoft) over the past decade, with their chatterbot patent and their commercial SDK, giving out free code that can be used in a commercial closed-source product doesn't seem like a very smart move. ;)
The chatterbot patent now owned by Microsoft is groundless anyway, because the Net::AIM module on CPAN released in 1999 ships with an example script for an AIM chatterbot which pre-dates ActiveBuddy's inception in 2000. ActiveBuddy's claim that they invented the AIM chatterbot falls in the face of prior art.
0.0019s
.