Introduction to JGrok

JGrok is a programming language designed for manipulating collections of binary relations. The initial version of Grok was created by Dr. Ric Holt in 1995, and has since evolved to become a language for manipulating factbases. Grok operates at the level of a relational database, in that operators generally apply across entire relations, and not just to single entities. The Grok interpreter has been optimized to handle large factbases (up to several hundred thousands of facts, or tuples). It keeps all of its data structures in memory. Grok is written in the Turing language.

The term grok means to understand, which is appropriate in that the Grok language is used primarily to analyze factbases relating to large-scale software. This term was coined in the book "Stranger in a Strange Land", by Robert A. Heinlein.

Introduction to JGrok/QL

QL is a Java re-implementation of Grok, written by Jingwei Wu at the University of Waterloo. While serving essentially the same purpose as Grok, QL is not identical to it. While being slower than Grok, QL makes up for it with new operators and built-in commands.

Despite their differences, the fundamentals of Grok and QL are the same, and it is rather easy to switch from one to the other. Throughout this guide, the term Grok is used to refer to both Grok and QL collectively. The differences between the two tools are pointed out where neccessary.

Using Grok

Much like an operating system shell, Grok can be used interactively or through a script. When being used interactively, Grok displays a command prompt and awaits a command to be typed in by the user. Alternatively, it is possibly to store a sequence of commands in a text file, and istruct Grok to execute it.