A month after the last release, I'd like to inform you about my current proceedings in Hax development.
During the past weeks, development was a bit slowed down due to other things that came up. Also, I needed to figure out what to start doing next, while I was expecting some feedback on the 1.00 release as well.
After the expected feedback did not turn up, I chose to continue my experiments with a feature which I started preparations for prior to the 1.00 release. That feature is to support alternative scripting languages to be used in Hax.
Now this might seem like a lot of work, but the wonderful JSR223 specification makes it a lot easier. For those who are interested but lazy to search, JSR223 is basically a specification of a common interface to scripting languages in Java. Thus, it is enough to integrate your application with that interface to be able to use any arbitrary scripting language for which a JSR223 interface implementation exists.
I managed to add support in the HaxOS command line for running scripts using the JSR223 interface. I successfully tested simple "Hello World" and interactive "What is your name? - Hello [name]" scripts in JavaScript, Python, Ruby, Clojure, and Lua. I also tried Scala, but due to its strict typing and an apparent bug in its JSR223 implementation I have not found it feasible or convenient to use at the moment. As for Clojure, I don't think anyone would go that way either as it appears a bit extreme for this purpose, but as a proof of concept it works. A limitation of all this, however, is that most of the scripting engines do not work well with a security manager, thus requiring to disable the script sandbox for Hax. JavaScript is an exception as it is directly included in Java, and I found it to be functional and correctly restricted under the sandbox. Lua does not work under the sandbox at all. As for the others, I have still to try them out.
Next up on my list is to encourage script development. For this, I plan to prepare a sample data center. This data center could be used as a playground to learn writing scripts for Hax and configuring data centers. It will contain well commented sample scripts, as well as guides on how to script. It might also contain samples in alternative scripting languages mentioned above. The configuration files of the data center will also be well commented, with hints on how to experiment with the hardware setup and wiring of machines. Finally, documentation of the Hax API and HaxOS API, including the data center configuration language, should be included in the next release.
If you have any questions, comments or feature requests, feel free to post on the discussion group or contact me directly. Any feedback is greatly appreciated.
No comments:
Post a Comment