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..

ChatScript to Javascript
 
 

How can we compile the ChatScript emulator to Javascript using (for example) emscripten ?

 

 
  [ # 1 ]

Not a clue. Follow their instruction manual?

 

 
  [ # 2 ]

There is the separate question: why do you want to?

 

 
  [ # 3 ]

I want to compile it to javascript to be able to produce chatbots can be useed through the web browser of the user which may be any operating system, Android, iOS, Black Berry or whatever
Trying to achieve the famous saying (“Compile once, Run everywhere”)

 

 
  [ # 4 ]

So you don’t want to provide a server for a browser to access interactively, you want to download all of chatscript into their browser page so they have a local copy?

 

 
  [ # 5 ]
Mohammad Elabd - Jun 11, 2014:

How can we compile the ChatScript emulator to Javascript using (for example) emscripten ?

Some time ago, I had eSpeak (text to speech) compiled to JavaScript via emscripten, at http://www.chatbots.tk to allow a light duty chatbot to speak.  However the voice synthesis may only be heard via a limited number of webbrowsers which supported typed arrays.  Of course, these technical requirements are changing all the time as webbrowsers get updated.  So please review the latest offerings, before relying on this information.

Another option may be to compile a Linux kernel via emscripten and ChatScript may run through there without converting it to JavaScript?  This is an interesting experiment you suggested.  Good luck with it!

 

 

 
  [ # 6 ]
Bruce Wilcox - Jun 11, 2014:

So you don’t want to provide a server for a browser to access interactively, you want to download all of chatscript into their browser page so they have a local copy?

YES, Exactly smile

 

 
  [ # 7 ]

i used node-js and made a socket to chatscripts localserver.bat and its working fine.

 

 
  [ # 8 ]

Hi and welcome, Andy! smile

That’s great, but not exactly what the OP was looking for, I think. Personally, even considering the explosion of available bandwidth now available to the average user, loading something as large as a JS version of ChatScript would undoubtedly be (counting all of the dictionary and control files required) would be a huge drain on a browser’s resources, not to mention the memory requirements involved. Certainly caching could reduce subsequent load/execution times, but why put the user through the hassles?

Secondly (and this is just my opinion, so ignore it if you wish), converting ChatScript to a JS app kind of diminishes much (if not all) of Bruce’s hard work, and could almost be considered a form of plagiarism. Just sayin’. smile

 

 
  [ # 9 ]

My note on the question of plagarism.  My license says “do what you want with it”. So it’s not a form of plagarism. But I agree its kind of big to stick in a browser.

 

 
  [ # 10 ]

If ChatScript C++ may generate LLVM bitcode, then I find what Mohammad is proposing to be intriguing.  The fact that Mohammad opened a dialog was considerate in manner.  And it is a smart idea, that may be tried with any open source C++ chatbot, that can generate LLVM.

For the sake of conversation only, with no legal advice intended, suggested or implied.  Based on other famous systems that have been source to source compiled successfully through Emscripten, I believe all credit will naturally stick like glue to the author of the original source. 

For example, I believe Emscripten reuses the same data files with little or no change.  It just targets only the Low Level Virtual Machine code, for lack of a better term, and sort of redirects it from C++ to JavaScript.  Umm, in easy language, you can say, “Compiler, spit me out some LLVM please.” So, it’s like everyone knows the original source was not JavaScript, right?  That is why they call it a source to a source compiler.

Lastly, listen closely—these comments are all very friendly toned… I am NOT, repeat NOT criticising or trying to correct Dave Morton’s opinion. I am just trying to discuss how running open source code through different compilers, needn’t be any worry to the original author.

 

 
  [ # 11 ]

Dear Sirs;

Thank you all for your friendly co-operative replies smile

Yes I know that it’ll be relatively huge downloaded sizes through repetitive downloads of the addressed web-link and it’ll be a great memory consumption of the web browsers
But may be I wasn’t clear enough to clarify my intention of this question
I think that the JavaScript code is the most portable form of software specially in the form of mobile apps as it’s easy to load the JavaScript software to something like PhoneGap, Appcelerator or any of their alternatives to produce several mobile app wrappers for the same JavaScript project that’ll almost run on every modern mobile phone in the world today starting from Nokia Asha till the iPhone passing all Android, WebOS, SaifishOS, Bada, BlackBerry, and Windows phones by downloading this apps once through the related suitable mobile store.

And every good thing in the world has a bad cost
The super portability with minimum compile-time modifications has a cost of the run-time performance will be worse related to the native apps’ performance that’ll need greater compile-time re-coding for each port to each mobile device family

 

 
  [ # 12 ]

As the developer of one of the few JavaScript based Chatbots, I can attest to the portability. Skynet-AI has run in virtually every smart-phone (as well as game consoles and web TVs). As an APP, you incur a 1 time download but then benefit from running locally from then on. Performance should be ok (but it is hard to say for sure). Testing and integration with might be tricky.

A more interesting application would be to compile Chatscript to JavaScript and then run it on a Node.JS server.

 

 

 
  login or register to react