Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
NetKernel
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Programming== The fundamental instruction in NetKernel is a resource request, specified by a URI. Mechanisms that sequence URI requests are located above the microkernel. In the current Java-based implementation, requests are dispatched using a Java API. This implies that any language that can call a Java API can be used to program NetKernel. {{As of|2013|04}}, the set of languages supported includes: * Java * Ruby * Scala * Clojure * JavaScript * Python 2 * Groovy * Beanshell * PHP * DPML * XML related languages such as XQuery * The URI specification itself has sufficient richness to express a functional programming language. ===Active URI Scheme=== <!-- Add a Wiki Page on active: URI --> The ''active'' URI scheme was proposed by [[Hewlett-Packard]] as a means to encode a [[functional program]] within a URI. <pre> active: {function-name} [+ {parameter-name} @ {parameter-value-URI}]* </pre> For example, the following URI calls a random number generator <pre>active:random</pre> and the following uses an [[XSLT]] service to transform an [[XML]] document with an XSLT stylesheet: <pre>active:xslt+operator@file:/style.xsl+operand@file:/document.xml</pre> Because the argument values may be URI addresses themselves, a tree-structured set of function calls can be encoded in a single URI. ===Transports=== Transports are a mechanism used to introduce requests from outside of NetKernel to the NetKernel address space. Transports are available for the HTTP protocol, JMS ([[Java Message Service]]), and CRON. Other transports can be easily added as they are independent from the rest of NetKernel. The role of the transport is to translate an external request based on one protocol into a NetKernel request with a URI and a specific verb (SOURCE, SINK, etc.) and then to send the returned representation back to the client via the supported protocol. Two mappings are handled by a transport. The first is between the address space of the externally supported protocol to the internal NetKernel address space. And the second is between the verb or action specified externally into a NetKernel verb. For example, in the case of the HTTP transport, the external address space is a sub-space of a URL. The following mapping illustrates this point. <pre>http://www.mywebsite.com/publications/... | v file:/src/publications/...</pre> In addition, the HTTP protocol supports methods such as GET, PUT, HEAD, etc. which are mapped to NetKernel verbs. ===Scripting languages=== A mechanism is needed to issue the URI requests, capture the returned representations, and communicate with clients. Scripting languages are executed by their runtime engine, which is itself a service. For example, the [[Groovy_(programming_language)|Groovy]] language runtime will run a program contained in the file <code>file:/program.gy</code> with the following: <pre> active:groovy+operator@file:/program.gy </pre>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)