Pnuts FAQ

0. Table of Contents

1. General Questions
What's Pnuts?
Java Programming Skill is required?
Environment to use Pnuts?
How Pnuts relate to the products of JavaSoft?
Any experience using Pnuts?
Can I use Pnuts in my commercial products?
2. Technical Questions
Can I convert a Pnuts script to Java source code or compile it to bytecode?
What does 'lexical scope' mean?
Why use different syntax than Java ?
Can I convert a Pnuts script to Java source code or compile it to bytecode?
How do I use regular expression like in Perl?
How do I use dbm from Pnuts?
docproc doesn't work with the current version of Pnuts.

1. General Questions

What's Pnuts?
Pnuts is a script language which can access Java APIs interactively. it can be embeded in a Java program and called easily from Java.

Java Programming Skill is required?
It is neccessary to have a basic knowledge of Java API to use Pnuts, but no need for any advanced knowledge of Java programming such as OOP or various kinds of Java coding tips.

Environment to use Pnuts?
Because Pnuts is written in Java, it works on any environment that is compatible to JDK1.1 or later. We tried Pnuts on the following environments.

How Pnuts relate to the products of JavaSoft?
There are no relationship except both are owned by Sun Microsystems Inc. All questions and comments about Pnuts should be thrown to pnuts@etale.com.

Any experience using Pnuts?
Sean Russel, Oregon university, developed XSL pre-parser docproc, which uses Pnuts as a scripting language.

Please let us know how you use Pnuts.

Can I use Pnuts in my commercial products?
Sure. Under License Term, you can distribute Pnuts with no royalty if license.txt is included.

2. Technical Questions

What's an advantage among other languages?
Pnuts keeps the spec. small using Java API extensively. So user needs to know almost nothing but Java API. Besides, apart from older languages, the programming model is identical to that of Java. The script can be conceptually very close to Java.

What does 'lexical scope' mean?
Lexical Scope is a scoping rule which variables in a function can reference to the environment in which the function is defined. Contrally, dynamic scope is another rule which variables can reference only to the runtime environment. Pnuts adopted Lexical Scope rule.

Why use different syntax than Java ?
In Pnuts, "class classname" specifies a class, although just "classname" in Java.
There is a problem when a global variable "java" is defined, for example, classes in "java" package can not be accessed properly. With a syntax that clarify the border of a class name and an instance variable, the problem can be solved.

Pnuts uses "::" to access static memebers.
Pnuts does not have types for variables. And there is no distinction between a class as a type and a class as a Class object. The new syntax "::" allows to access a class as an ordinally object.

Can I convert a Pnuts script to Java source code or compile it to bytecode?
A Pnuts-to-Java translator is provided as of 1.0beta3. In the future, on-the-fly bytecode compiler will be provided as a plug-in module.

How do I use regular expression like in Perl?
Pnuts itself does not support regular expression, but Perl Toolkit developed by ORO Inc. enable simple R.E. scripting in Pnuts. A sample script is provided in the distribution package.

How do I use dbm from Pnuts?
Jigsaw by W3C includes a dbm-like package, called jdbm, written in Java. A sample script is provided in the distribution package.

If you need the compatibility with GDBM you might find JavaGDBM useful, though it has native methods.

docproc doesn't work with the current version of Pnuts.
docproc Version 19980207 was written based on Pnuts-0.61. You can try an unofficial patch to make it work with Pnuts-0.80 or later.

Pnuts Home | User's Guide | Pnuts Language | FAQ | Download | License | Contact Us