The Pnuts Project

Overview

Pnuts is a scripting language system based on JVM. It is intended to be a part of dual-language system based on Java platform. Some of the features are as follows.

  • Simple and clean syntax
  • Interactive interpreter
  • Extensible through its module system
  • Customizable and embeddable through Pnuts API
  • Dynamic/static translation to JVM bytecode
  • One of the fastest scripting language implemenations on JVM
  • Inherits many advantages of Java (security, portability, etc.)

The project has a web page at http://pnuts.dev.java.net/, in which the latest source code and documents are being distributed.

Motivation

Pnuts was originally developed as a testing tool of Java classes in 1997. Since then, Pnuts has been extended, mainly focusing on essential functionalities required for Java-based scripting engine, such as module system, bytecode compiler, and so on.

Since around 2002, effort on Web scripting has been made. Java platform already has JSP based solutions. However, it is well known that there are many Web application developers who are not Java developers. JSP-based solutions seem to be too difficult to learn for them, so they typically stick with PHP or other technologies. One of the goals is to provide a scripting environment for those who are not serious Java programmers and to allow them to enjoy the benefits of Java platform.

Advantages
  1. The language is designed specially for Java Platform
    Scripting language systems on JVM fall into two categories; one is porting of an existing language to Java platform, and the other is a new language from ground up.

    Systems in the former category bring an additional value to the existing system. A common problem of systems in this category is that they have to keep it compatible with the existing system. Even if the models of the two languages differ, the difference has to be left as it was. For example, since most scripting languages have different type system from the host language, data type conversion between the languages is necessary. Not only that user has to understand and distinguish the two type systems in dual-language applications, but that it would significantly degrade the performance.

    New languages specialized for Java, including Pnuts, do not have such restriction. All values in Pnuts are Java objects of well-defined Java classes/interfaces.

  2. Modular API
    Pnuts API provides a flexible interface to embed Pnuts into Pnuts applications. Many other systems fall short in this area.
  3. A rich set of the standard modules
    Pnuts provides off-the-shelf library functions as standard modules. Those functions make application development much simpler than Java-only solution. In addition, Pnuts has a sophisticated module system that allows users to add their own modules as needed for user's application.
  4. High performance
    Pnuts is one of the fastest scripting language implementations based on Java. Speed is important when a scripting engine is embedded into a large application, because scripting engines are likely to be a performance bottle-neck of the application.
User Experiences