AI Zone Admin Forum Add your forum

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

CLUES Chatbot Engine in C++
 
 
  [ # 31 ]

I think that speed shouldn’t be a criteria for a language anymore.

Of course there are still some leaks, especially about regular expressions.
Some scripting languages don’t support the precompilation of them.

I’m using Java/Scala and there are even guys in the world who argue that Java is faster than C++ because of the automated and optimized garbage collection and so on (I don’t want to comment this).

I wish you all the best for your new engine.

Best Regards,
Markus

 

 
  [ # 32 ]

Thanks Markus,

Yes, the speed of any program depends more on the algorithm, how that algorithm is implemented than the language, for sure.  Maybe I’m a ‘control freak’ but I like to do a delete or delete[] and know the memory is freed, rather than depend on the language.    Also, I guess it is because I have more background in C, which is way I leaned more towards C++ than Java.  Although Java has a lot of uses, applets and JSP are good examples.  But for me, for this project, C++ is for V3.

 

 
  [ # 33 ]

small milestone on GRACE & CLUES.  I will post new thread under “My Chatbot Project”.

 

 
  [ # 34 ]
Merlin - Dec 29, 2010:
Raymond Lavas - Dec 6, 2010:

I’m curious if anyone thinks that a “very” intelligent agent actually needs to use something other than C++ in the first place. Remember that I-phones and Android based portable devices allready have a lot to deal with and I’m not sure if the processing power of these portable devices will do when it comes to voice recognition and processing.

Raymond

Raymond,
I believe that your choice of language will have more to do with your goals for your bot than it does around speed of processing. My bot Skynet-AI (http://www.tinyurl.com/Skynet-AI) was programmed in a JavaScript framework I created called JAIL(TM) (JavaScript Artificial Intelligence Language). I can’t say that it is “very” intelligent, but it is fast and runs on cell phones, video game consoles, and just about anything else with a browser on it.

Recent advances in JavaScript development allow its speed to rival that of compiled languages (and in fact it is compiled automatically in some environments).
To give you an idea, here is a page here you can test various algorithms against different language implementations. Google’s V8 JavaScript implementation is about the fastest, but Opera and Microsoft have also come a long way recently.
http://shootout.alioth.debian.org/u32/measurements.php?lang=v8

Merlin< I’ve been giving a lot of thought to your response here and i would like to know how progress is moving on your projects.

Raymond

 

 
  [ # 35 ]

Raymond,

I would say that the win for speed is always in hardware; speed optimizations, or even the differences in processing speed between languages, are minimal (close to zero tmo) in relation to hardware speed acceleration over the last few years. Any interpreted language NOW is running rings around every compiled language speeds a few years ago, simply because of the hardware.

Having said that, tmo every Turing-complete programming language is a valid choice to build AI. I would look at the structure of the programming language and see how easy certain things would be in that particular language. For that reason I’m currently looking at OpenEuphoria (RapidEuphoria before it went Open Source) as it seems to have one of the simplest and therefor most flexible ways of handling data (it has only two data-structures; sequences and atoms) and this seems useful for my approach. However, if your AI is using some model that fits neatly into a OOP model then by all means C++ is a great choice. In the same vein I see no problem at all with using JavaScript, which has the great advantage that it can run browser-based (if that’s important for your project).

 

 
  [ # 36 ]

Well I can tell you folks one thing, making many small changes in the way the algorithm is coded helps immensely !

But Hans, I do agree, for the most part, the language is inconsequential.  I think I wanted to refresh my memory on C++, so I wouldn’t forget it altogether.

The major, and I do mean MAJOR improvement in CLUES v1/v2 to v3 was not so much the move from Perl to C++, but in other factors.  Those factors were mainly:

(1) removal of all usages of regular expressions

(2) removal of all usages of strings (except of course for initial input from user and retrieval of parts of speech for each word, which is unavoidable, we don’t want user to enter a string of integers instead of English words !!)

(3) pre-compiled the grammar and semantic rules so they are turned into integers.

(4) http://en.wikipedia.org/wiki/Space-time_tradeoff - that is, there is hardly any looping in CLUES v3.  The engine has direct pointers, bypassing need for searching (or GREATLY reducing it).

Overall the speed increase was about four to five hundred times.

 

 
  [ # 37 ]

hardly any looping - means of course, not zero, (unavoidable), but absolutely bare minimum smile

 

 
  [ # 38 ]

Raymond, thanks for the interest. Good to see you around again. I’ll put an update over on the JAIL & Skynet-AI thread, but to give you a quick taste:

I have put some of my projects on hold to get Skynet-AI ready for the Chatterbox Challenge.

Speed of JavaScript is still excellent, I have done some refactoring and tests in various browsers. In Windows XP, I find Opera fastest, followed by Firefox and IE8. I haven’t benchmarked Chrome, or Safari.

Skynet-AI has run on a variety of other platforms in the browser of that platform. It runs on cell phones, IPods/Pads, video game consoles. Most recently I tested it on Sony/Google TV and the Nook. Performance on each of those platforms was good. It tells me I still have headroom to add features with acceptable results.

 

 
  [ # 39 ]

Merlin, good luck in the CBC… go Skynet go!

 

 < 1 2 3
3 of 3
 
  login or register to react