Java Virtual Machine based runtime supporting PHP and Groovy.NOT a Java EE environmentTargeted at Script developersNot for producing Java code.A Commercial ProjectWith development done in the open and limited no-cost use.A Full Stack RuntimeWith a HTTP server, module system and simple IDE built in.IBM’s Scripting platform.For building Agile Web ApplicationsUsing PHP and GroovyUsing assets from PHP and Java worlds.Built on Java (SE not EE)Uses many LAMP principles.Single threaded application programming model.Shared nothing.Restart-able runtime.
WebSphere sMash core values are Speed, Simplicity, and Agility- product elements that support this are:SpeedDynamic scripting languages (PHP and Groovy – with Java as system language)Core application constructs: templates, pre-built servicesSimplicityBuilt-In development tooling: Visual Editors for Web Page Construction and for Flow AssemblyAssemble-style development (Developers can visually mash up services and feeds using a Visual Editor for Flow Assembly)AgilitySimple deployment (application “is” the server)Runtime Characteristics (clean, cost effective, short-lived)
Why is IBM interested in PHP? 3 Reasons: Community, Assets, SimplicityCommunity: The PHP community is around 3M programmers. (Java community is around 7M programmers). Assets: Lots of applications and snippets that can be easily re-used. Validated by sMash partners ZSL, SugarCRM.Simplicity: The language is very easy to learn even for people without traditional programming skills.But don’t be fooled. PHP is not a toy language. 1/3 of the internet uses it. It powers Yahoo, facebook and wikipedia and commercial applications such as SugarCRM.
OK, so PHP is interesting…..but why not use the existing C based implementation. Why implement it on the JVM?Well, we wanted to be able to build sMash using Java but give PHP programmers a first rate programming experience.Since the PHP is built on the JVM, PHP , Groovy and Java can interact without costly IPC. Interaction on the same callstack.PHP can reach into the Global context without copying.This allows PHP programmers to leverage the power of the Java libraries and Java/Groovy programmers to re-use all the great applications and snippets from the PHP world.It really is the best of both worlds. We have multiple cases of business partners combining PHP assets with new code written in Groovy.We have instances of business partners mixing Java and Groovy programmers on the same project.Its about getting the job done…….fast……using what you have.Add to this all the great Java technology which we’ve invested 100s of PY in. Its pretty exciting to think about the Java JIT being able to chew on PHP code.IBM is not alone in this. At Javaone this year there were multiple presentations on the merits of bringing new languages to the Java Platform. Jruby, Jython, Groovy, Scala are just a few of the languages with large followings.11
The PHP runtime is built on the JVM. It requires Java 5 SE or later from any vendor.The HTTP interface is via Zero. We are not using apache or lightppd here.PHP Scripts are parsed into an intermediate form and then either interpreted or compiled to Java Bytecodes.Java Bytecodes are cached in memory and written to disk as .class files.User experience is one of scripting (compilation is hidden from user).PHP extensions implemented in C from php.net can be attached via XAPI-C which uses JNI.We also attach Java extensions using XAPI-J which is how we interface to Zero and to databases via JDBC.We have a debug port to allow Eclipse PDT to debug PHP scripts.IF anyone asks about performance (suggest not to bring this up)…….PHP performance is great for most sMash use cases. The pathlength is not in the PHP its in the database, webserver and infrastructure.For huge deployments of PHP applications where out and out throughput matters, PHP performance is about 50% of PHP.net default configuration.Its important to say “default configuration” because PHP.net users can download and install a bytecode cache with improves throughput by about 4X.The implementation we have in sMash 1.1 has 2X the pure interpreter thoughout from sMash 1.0.Its still mainly an interpreter. We have designs and work items for sMash 2.0 and beyond to generate much more efficient bytecodes.
OK, so what does this PHP to java interaction look like?Well there are really two schemes. For tight coupling we can use the java bridge which allows PHP to instantiate classes, call methods, extend java classes etc.This is appropriate when wanting to re-use java libraries, such as SugarCRM’s desire to use Apache libraries from their PHP application.Also one can leverage the Zero programming models to design handlers that interact using events and the Global Context.This more appropriate for ZSL’s use case where they want to mix PHP code with new handlers written in Groovy.There is also the extension interface we saw earlier of course. This allows the creation of PHP extension functions and object proxies in Java.
How long implementation may takeHow many resourcesRolesHardware/software requirementsTypical project plan; first step; milestonesPitfalls; exception plan<number>
<number>Change and Release Management for Software Development<number>