Hoon Interface
Jock supplies a foreign function interface (FFI) to Hoon. Thus, Hoon functions may be accessed from within Jock. In fact, this is how many basic operations in Jock (such as arithmetic operators) are implemented.
The basic pattern is to invoke the name from the hoon
namespace:
(You must therefore follow Hoon's expectation about argument signature and function arity.)
Certain operators also automaticaly desugar to the appropriate Hoon. This is subject to revision as the type system grows in sophistication.
Hoon operations are available under the hoon
namespace, e.g. hoon.dec(5)
will yield 4
. A limited subset of operations are available through operators, such as +
and -
for add
and sub
, respectively.
The Hoon implementation is a slight extension of /lib/tiny
, which contains essentials for calculations but omits the parser and compiler, among other extensions.
Hoon functions specialized to work with data types like lists can also be accessed:
Importing Libraries
Hoon libraries can be imported using the import
keyword. At the current time, only hoon
can be (and is automatically) imported, pending better support for arbitrary files in choo
.
Last updated