WebSphere sMash

Last updated
WebSphere sMash
Developer(s) IBM
Final release
1.1.1 / June 1, 2009 (2009-06-01)
Written in Java
Type Application Server
License Proprietary
Website www.projectzero.org [ dead link ]

WebSphere sMash was a development and runtime environment from IBM for the creation of dynamic web applications using the scripting languages Apache Groovy and PHP. It contained a PHP runtime written in Java. Project Zero was the experimental software development community in which new versions of WebSphere sMash were incubated. WebSphere sMash was withdrawn from sale in 2012, with support discontinued in 2014. [1]

Contents

WebSphere Smash integrated with Eclipse and produced REST-style services on top of Groovy or PHP . [2]

Architecture

There are a number of distinguishing aspects to the architecture of WebSphere sMash.

Event-driven programming model

WebSphere sMash uses an event-driven programming model. Applications are typically composed of a number of small modules which communicate with each other by firing events which are then caught by other handlers that have registered to catch the events. The code firing the event does not have any knowledge of the code that will handle the event. This architecture allows application to be built up from a mixture of code written using PHP, Java, Groovy or the Flow language.

Global context

Since events are stateless, a mechanism is required to share data between event handlers. This mechanism is the Global Context. The Global context functions basically as a large map of data divided up into various zones with different lifetimes, properties and persistence.

Repository management system

sMash makes use of the Ivy dependency manager. sMash applications are composed of models which can specify dependencies on other modules which may be present in a local Ivy repository or which can be fetched from a remote repository. IBM maintains a repository of useful modules at projectzero.org and dependencies can also be specified on the maven2 repository.

PHP support

The PHP support in WebSphere sMash is provided by a PHP runtime implemented in Java. [3] PHP scripts are compiled into Java bytecode which then run on the Java Virtual Machine (JVM). This is similar in concept to the approach taken by other projects such as JRuby and Jython, which run the Ruby and Python languages, respectively, against the JVM. Running on the JVM allows direct, same process calls between PHP, Java and Groovy code allowing applications to be assembled using a variety of languages.

In contrast to the approach taken by Quercus, the other JVM based PHP implementation, sMash is able to re-use existing PHP extensions from PHP.net attaching them to the Java virtual machine via the Java Native Interface (JNI) and an API layer called XAPI-C.

The runtime has a DBGp debug port allowing debug access from IDEs and debuggers which support the DBGp protocol such as the Eclipse PDT project.

The PHP runtime does not have an identity outside of sMash so it is simply referred to as the "WebSphere sMash runtime for PHP."

As of October 2008 WebSphere sMash is capable of running several well-known PHP applications on a Java Virtual Machine. These include SugarCRM, [4] phpBB, [5] WordPress [6] and MediaWiki. [7]

The PHP runtime supports close integration with the Java and Groovy languages through its Java/Groovy bridge. This allows PHP scripts to use libraries written in Java and Groovy through a lightweight and extremely fast interop layer[ citation needed ]. The Groovy bridge allows advanced features from Groovy to be accessed directly from PHP. Examples include closures and Groovy metaobjects.

See also

Related Research Articles

<span class="mw-page-title-main">Java virtual machine</span> Java Virtual machine

A Java virtual machine (JVM) is a virtual machine that enables a computer to run Java programs as well as programs written in other languages that are also compiled to Java bytecode. The JVM is detailed by a specification that formally describes what is required in a JVM implementation. Having a specification ensures interoperability of Java programs across different implementations so that program authors using the Java Development Kit (JDK) need not worry about idiosyncrasies of the underlying hardware platform.

<span class="mw-page-title-main">PHP</span> Scripting language created in 1994

PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by the PHP Group. PHP was originally an abbreviation of Personal Home Page, but it now stands for the recursive initialism PHP: Hypertext Preprocessor.

<span class="mw-page-title-main">NetBeans</span> Integrated development environment software for software development

NetBeans is an integrated development environment (IDE) for Java. NetBeans allows applications to be developed from a set of modular software components called modules. NetBeans runs on Windows, macOS, Linux and Solaris. In addition to Java development, it has extensions for other languages like PHP, C, C++, HTML5, and JavaScript. Applications based on NetBeans, including the NetBeans IDE, can be extended by third party developers.

<span class="mw-page-title-main">Eclipse (software)</span> Software development environment

Eclipse is an integrated development environment (IDE) used in computer programming. It contains a base workspace and an extensible plug-in system for customizing the environment. It is the second-most-popular IDE for Java development, and, until 2016, was the most popular. Eclipse is written mostly in Java and its primary use is for developing Java applications, but it may also be used to develop applications in other programming languages via plug-ins, including Ada, ABAP, C, C++, C#, Clojure, COBOL, D, Erlang, Fortran, Groovy, Haskell, JavaScript, Julia, Lasso, Lua, NATURAL, Perl, PHP, Prolog, Python, R, Ruby, Rust, Scala, and Scheme. It can also be used to develop documents with LaTeX and packages for the software Mathematica. Development environments include the Eclipse Java development tools (JDT) for Java and Scala, Eclipse CDT for C/C++, and Eclipse PDT for PHP, among others.

Jython is an implementation of the Python programming language designed to run on the Java platform. The implementation was formerly known as JPython until 1999.

<span class="mw-page-title-main">Apache Groovy</span> Programming language

Apache Groovy is a Java-syntax-compatible object-oriented programming language for the Java platform. It is both a static and dynamic language with features similar to those of Python, Ruby, and Smalltalk. It can be used as both a programming language and a scripting language for the Java Platform, is compiled to Java virtual machine (JVM) bytecode, and interoperates seamlessly with other Java code and libraries. Groovy uses a curly-bracket syntax similar to Java's. Groovy supports closures, multiline strings, and expressions embedded in strings. Much of Groovy's power lies in its AST transformations, triggered through annotations.

Maven is a build automation tool used primarily for Java projects. Maven can also be used to build and manage projects written in C#, Ruby, Scala, and other languages. The Maven project is hosted by The Apache Software Foundation, where it was formerly part of the Jakarta Project.

<span class="mw-page-title-main">Java (software platform)</span> Set of computer software and specifications

Java is a set of computer software and specifications developed by James Gosling at Sun Microsystems that provides a system for developing application software and deploying it in a cross-platform computing environment. Java is used in a wide variety of computing platforms from embedded devices and mobile phones to enterprise servers and supercomputers. Java applets, which are less common than standalone Java applications, were commonly run in secure, sandboxed environments to provide many features of native applications through being embedded in HTML pages.

<span class="mw-page-title-main">SlickEdit</span>

SlickEdit, previously known as Visual SlickEdit, is a cross-platform commercial source code editor, text editor, and Integrated Development Environment developed by SlickEdit, Inc. SlickEdit has integrated debuggers for GNU C/C++, Java, WinDbg, Clang C/C++ LLDB, Groovy, Google Go, Python, Perl, Ruby, Scala, PHP, Xcode, and Android JVM/NDK. SlickEdit includes such features as built in beautifiers that can beautify code as you type, code navigation, context tagging, symbol references, third party tool integration, DiffZilla, syntax highlighting, and 15 emulations - that include keyboard and selection styles.

The Java Class Loader is a part of the Java Runtime Environment that dynamically loads Java classes into the Java Virtual Machine. Usually classes are only loaded on demand. The virtual machine will only load the class files required for executing the program. The Java run time system does not need to know about files and file systems as this is delegated to the class loader.

Eclipse OpenJ9 is a high performance, scalable, Java virtual machine (JVM) implementation that is fully compliant with the Java Virtual Machine Specification.

Fantom is a general purpose object-oriented programming language created by Brian and Andy Frank that runs on the Java Runtime Environment (JRE), JavaScript, and the .NET Common Language Runtime (CLR). Its primary design goal is to provide a standard library API that abstracts away the question of whether the code will ultimately run on the JRE or CLR. Like C# and Java, Fantom uses a curly brace syntax. The language supports functional programming through closures and concurrency through the Actor model. Fantom takes a "middle of the road" approach to its type system, blending aspects of both static and dynamic typing.

<span class="mw-page-title-main">Node.js</span> JavaScript runtime environment

Node.js is a cross-platform, open-source server environment that can run on Windows, Linux, Unix, macOS, and more. Node.js is a back-end JavaScript runtime environment, runs on the V8 JavaScript engine, and executes JavaScript code outside a web browser.

<span class="mw-page-title-main">Vert.x</span>

Eclipse Vert.x is a polyglot event-driven application framework that runs on the Java Virtual Machine.

<span class="mw-page-title-main">GraalVM</span> Java virtual machine

GraalVM is a Java VM and JDK based on HotSpot/OpenJDK, implemented in Java. It supports additional programming languages and execution modes, like ahead-of-time compilation of Java applications for fast startup and low memory footprint. The first production-ready version, GraalVM 19.0, was released in May 2019. The most recent version is GraalVM 23.0.0 , made available in June 2023.

appserver.io is an application server for PHP-based web environments. The project consists of middleware which delivers classical PHP web applications and provides additional services.

Enduro/X is an open-source middleware platform for distributed transaction processing. It is built on proven APIs such as X/Open group's XATMI and XA. The platform is designed for building real-time microservices based applications with a clusterization option. Enduro/X functions as an extended drop-in replacement for Oracle Tuxedo. The platform uses in-memory POSIX Kernel queues which insures high interprocess communication throughput.

References

  1. "IBM United States Withdrawal Announcement 912-138" (PDF). June 12, 2012.
  2. "About Project Zero". Project Zero Site. Archived from the original on 2008-07-09. Retrieved 2008-06-23.
  3. "Project Zero PHP page". Archived from the original on 2009-01-25. Retrieved 2009-02-02.
  4. "Smash4Sugar project at SugarForge". Smash 4 Sugar. Retrieved 2008-06-30.
  5. "PhpBB running on Project Zero". phpBB on PZ. Archived from the original on 2008-08-07. Retrieved 2008-06-30.
  6. "Try out PHP Application WordPress on sMash". WordPress on PZ. Archived from the original on 2008-10-22. Retrieved 2008-10-09.
  7. "Try out PHP Application MediaWiki on sMash". MediaWiki on PZ. Archived from the original on 2008-10-16. Retrieved 2008-10-19.