The Neat Tools package essentially is a visual programming language primarily consisting of connected modules that process input based on their (the modules) parameters and pass output to other modules.
I am attempting to extend the functionality of Neat Tools to include a programmable module.
The programming language to be implemented in this module is a variant of Netscape'sJavaScript scripting language.
You won't be able to do anything new to Neat Tools with the module.
It will basically become a general-purpose module.
Some things will just be easier/quicker to implement as a quick little script, especially for users with a programming background.
This, however, is just the first step in an attempt to get Neat Tools to interact with Netscape's browser.
The end product is intended to be a module, whose flavor of JavaScript is capable of 'seeing' a Neat Tools plug-in for Netscape.
The plug-in itself serves as a source and destination of data to and from the browser.
The choice of Netscape's JavaScript implementation as the module's language is due to the fact that mozilla.org is providing the JavaScript runtime engine, downloadable for free and the code is stable.
The JavaScript Runtime Engine:
The JavaScript runtime engine, which can be obtained from mozilla.org, comes as C source code which compiles into a shared resource (a DLL for Microsoft Windows, a .so shared library for UNIX).
The runtime engine is responsible for allocating memory for JavaScript objects, managing garbage collection, etc.
Communication between Neat Tools and The JavaScript Runtime Engine:
Communication between an application and the engine consist of API calls to the engine.
In the case of the Neat Tools module the application is a shared resource itself making calls to Neat Tools, the JavaScript engine and the Neat Tools plug-in.
The Scripting Language:
The details of the language are pretty much going to be made up as I go along.
At the very least there will be an input object, an output object (to communicate with other Neat Tools modules), and a browser object (to interact with the plug-in).
Much off the details will depend on the implementation of the plug-in and sorting out module/browser interaction.
Developing Netscape control capability for Neat Tools via plug-in
Overview
This is the second and final stage of connecting Neat Tools to the web via Netscape's browser.
It will involve creating a Netscape plug-in that acts as a data server to a Neat Tools JavaScript module and tweaking the Neat Tools module/Netscape plug-in to obtain some sort of interface/protocol
Netscape Plug-ins
The universe of plug-ins is uncharted territory for me.
Their capabilities and limitations are not very clear, however Netscape's documentation indicates that plug-ins are able to 'see' the browser and vise versa via Netscape's LiveConnect technology.
Neat Tools side control
The Neat Tools JavaScript module will serve as Neat Tools gateway to Netscape, as I mentioned above the details of the JavaScript module's language will depend on factors such as
Neat Tools inter-module communication
Plug-in implementation
Inter-application communication (Neat Tools Module to Netscape Plug-in)
Browser side control
Netscape's LiveConnect technology will be the heart and soul of the browser side interaction with the plug-in.
A quote from Netscape's documentation.
Netscape LiveConnect lets you integrate Java, JavaScript and Navigator plug-ins.
This allows you to create plug-ins that can be controlled by Java and JavaScript, or use Java and JavaScript to implement portions of your plug-in.
Fundamentally, Netscape LiveConnect allows you to:
call Java methods from plug-ins
call native methods implemented in plug-ins from Java
call Java methods from JavaScript
call JavaScript from Java methods
Although there is no direct connection from plug-ins to JavaScript, the combination of (1) and (4) allows plug-ins to call JavaScript code, and (2) and (3) allows JavaScript to manipulate plug-ins.
Implementation Approach:
Proof of Concept Demo for JavaScript Module
The proof of concept demo will be a Neat Tools JavaScript module with the barest javaScript functionality.
It will have two integer inputs and one integer output.
Its only property will be the name of the file containing its JavaScript code.
It should be able to emulate any integer two to one function available in Neat Tools
Extention of proof of Concept demo
To include, multiple inputs, multiple outputs and access to the modules properties.
Develope Plugin
From here on is very gray area and a re-evaluation of the projects goals/direction should probably be done at this point.
Possible Extensions:
Advanced Network Capability For Neat Tools
Given a 'network socket module' a JavaScript module could be used to implement a network protocol on the fly for seamless network integration.
This could be very useful for getting Neat Tools to communicate with non standard protocols.
Intuitive External Device Control
Given Neat Tools interface capabilities.
A simple easy to follow finite state machine could be written to say, control a Lego MindStorm robot or implement an alarm system.
Forseen problems:
Lack of documentation
Although the Neat Tools documentation is sparse I have the advantage of working with its current developers.
Developing the NeatTools module will probably not be a major hassle.
The netscape documentation, on the other hand, comes mainly in the form of reference manuals and the occasional user guide.
I see this to be quite a problem and expect it to be one of many gremlins.
A lot of the work involved will be trial and error and just get a feel for what the Netscape components are capable of.
Maintaining Cross Platform Conformance
Just about every feature required to implement this project is non generic.
Inter-Application Communication (Neat Tools to Netscape)
The need for Netscape's LiveConnect technology for Browser control
The need for Netscape's Navigator Object Heirarchy
Chances are the first version of the module/plugin will be geared to a Windows/Netscape envionment.
Hopefully further revisions will seperate platform specific code from the core.