Author Topic: Programming Hal in Java and other languages  (Read 9188 times)

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Programming Hal in Java and other languages
« on: October 01, 2003, 09:27:53 pm »
If there are any Java or C/C++ programmers out there, you may be interested in knowing that Hal not only runs as a VBScript, but can run as a JavaScript program as well. Attached to this post is a sample brain that shows how JavaScript can be used to program Hal.

Hal uses the Windows Scripting Host (WSH) to run any scripting language. Windows by default has VBScript and JavaScript. Many third party scripting engines exist also such as PerlScript ( http://www.activestate.com/Products/ActivePerl/ ) so Hal can be programmed in virtually any scripting language.


Download Attachment: javahal.uhp
3.45 KB
Robert Medeksza

stephen

  • Newbie
  • *
  • Posts: 6
    • View Profile
Programming Hal in Java and other languages
« Reply #1 on: July 27, 2005, 10:40:23 pm »
hello,i really like the java brain only i'm no programmer.is there any way i could experiment with java in the brain editor ?if not is there anyway i could get some one to help withj a script written in java?thanks
  stephen
 

bitblaster

  • Newbie
  • *
  • Posts: 40
    • View Profile
Programming Hal in Java and other languages
« Reply #2 on: July 30, 2005, 08:57:30 pm »
Thanks for this information... seems very interesting...

Assuming HaL was written in something other than visual basic, I am assuming C/C++, how come the brains do not use C# or some form of a C script?
 

d_vyn1

  • Newbie
  • *
  • Posts: 10
  • E. C. G. The Foundation
    • View Profile
    • PureTek Solutions
Re: Programming Hal in Java and other languages
« Reply #3 on: October 26, 2010, 03:39:36 am »
Thak you so much Mr M. This was exactly the info I was looking for. I'm a more comfortable with c++ but java is close enough. now how can I find a primer for aPI with objects functions and methods(read templates). I'm sure I can do what I want to do in VB Script but I'm way more comfortable with a c style script

Edit 1

Found the method protocols in the .mbr files

D_vyn1
d_vyn1@yahoo.com
« Last Edit: October 27, 2010, 01:38:14 am by d_vyn1 »
The future is now and every moment hereafter

betzelelgalut

  • Newbie
  • *
  • Posts: 12
    • View Profile
Re: Programming Hal in Java and other languages
« Reply #4 on: January 01, 2011, 01:03:38 am »
hello, is there any howto documents about converting a brain from vbscrip to another one? and will it still work with ultra hal? i was thinking about converting it to python as that is the language i am most familiar with.

onthecuttingedge2005

  • Guest
Re: Programming Hal in Java and other languages
« Reply #5 on: February 23, 2011, 12:12:10 pm »
If there are any Java or C/C++ programmers out there, you may be interested in knowing that Hal not only runs as a VBScript, but can run as a JavaScript program as well. Attached to this post is a sample brain that shows how JavaScript can be used to program Hal.

Hal uses the Windows Scripting Host (WSH) to run any scripting language. Windows by default has VBScript and JavaScript. Many third party scripting engines exist also such as PerlScript ( http://www.activestate.com/Products/ActivePerl/ ) so Hal can be programmed in virtually any scripting language.


<b>Download Attachment:</b> javahal.uhp
3.45 KB

Hi Rob.

Quick Question.

Can the HAL engine cope with multi language programming in the form of plugins, what I mean is can plug-ins that are both Java and Vbscript and C++ coexist in the same brain cache without creating an error when assembled?

I would think it would be limited do to the;
//'Language=JavaScript
will it work using both
Rem Language=VBScript
in the same brain?

Jerry

Medeksza

  • Administrator
  • Hero Member
  • *****
  • Posts: 1469
    • View Profile
    • http://www.zabaware.com
Re: Programming Hal in Java and other languages
« Reply #6 on: February 23, 2011, 01:17:28 pm »
The plug-ins and main brain script must be in the same scripting language for it to work. All the Ultra Hal Assistant program does is insert the plug-ins into the main script to create a new unique script and then it uses that. There is no way to mix languages within one script file.

And to answer the unanswered question from d_vyn1, Hal will support any language that can work with the windows script host (WSH) system. For a list of compatible languages see http://en.wikipedia.org/wiki/Windows_Script_Host#Available_Scripting_Engines  Python is listed there.
Robert Medeksza

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
Re: Programming Hal in Java and other languages
« Reply #7 on: February 23, 2011, 01:36:08 pm »
I believe that your 100% there.... As The script control Loads the UHP brainfile into its memory to be evaluated ie "Resolve Getresponse" the beginning of the file

/'Type=Brain
//'Name=Example JavaScript Brain
//'Language=JavaScript
//'DataFolder=DefBrain
//


Specifies the Current language to Evaluate the Getresponse function "Technically could be Any Visual Programming Language" IE: C++ C# VB Java Foxpro... these are the languages that the script control recognizes...

Although it may be possible to make the brain Be Pure "Plugins" these plugins could be made in any language... C+.uhp C#.uhp But not in the SAME UHP!

A Python Script control would be needed to Add a Python script.... As Microsoft Programming languages do not yet recognize python and other 3rd party programming scripts as an evaluatable language yet

onthecuttingedge2005

  • Guest
Re: Programming Hal in Java and other languages
« Reply #8 on: February 23, 2011, 02:51:03 pm »
I think that clears thing up, thanks guys.

Jerry 8)

spydaz

  • Hero Member
  • *****
  • Posts: 670
    • View Profile
    • http://www.spydazweb.co.uk/
Re: Programming Hal in Java and other languages
« Reply #9 on: February 24, 2011, 06:15:21 am »
Opps my mistake "PYTHON" / IronPython is supported under the Scriptcontrol