PurpleJS unites Java, JavaScript development

PurpleJS unites Java, JavaScript development

Melding Java and JavaScript, PurpleJS is emerging as a framework for running lightweight JavaScript server applications without the complexity of the Node.js asynchronous programming model.

Atop the JVM (Java Virtual Machine), open source PurpleJS can be used when developers want to build multithreaded applications in JavaScript. It allows developers to run the same code in the browser and on the server, and it enables them to employ JavaScript while working with existing Java projects.

"PurpleJS is a simple and capable framework for creating performant web applications without leaving JavaScript," main developer Sten Roger Sandvik said. "It's created in Java to give the flexibility and performance Java provides."

But PurpleJS is not a replacement for Node.js, the popular server-side JavaScript platform, he stressed. "It's a totally different model since we, for now, do not use async. This fit our needs and was much simpler to program for our initial users." PurpleJS will support the async programming approach in the future, though.

Applications are built using the Gradle build system, and the Java SDK. Java serves as the runtime, but coding is done in JavaScript. Developers also can use PurpleJS Boot, a server running the Jetty HTTP server. "It's very easy to develop in 'dev' mode and you will not need to restart the server as long as you stick with JavaScript coding," Sandvik said.

The APIs in PurpleScript are starting to become more stable, but the framework needs work, Sandvik cautioned. "Application configuration is one thing that's missing now and should be in place before 1.0. Also, more libraries are needed -- SQL, MongoDB, Influx, Freemarker and Velocity to name a few." He's also in the process of implementing support for CLIs made with PurpleJS.

Sandvik works at Enonic, which offers its Enonic XP Web Operating System. PurpleJS currently is a separate project from Enonic but it features code donated by Enonic; Sandvik is hopeful PurpleJS one day could be featured as part of Enonic’s platform.

IDG Insider


«Hello again: What to expect from Apple's Mac event on Thursday


Review: LG’s V20 is a different kind of phone -- in a good way»
IDG Connect

IDG Connect tackles the tech stories that matter to you

Our Case Studies

IDG Connect delivers full creative solutions to meet all your demand generatlon needs. These cover the full scope of options, from customized content and lead delivery through to fully integrated campaigns.


Our Marketing Research

Our in-house analyst and editorial team create a range of insights for the global marketing community. These look at IT buying preferences, the latest soclal media trends and other zeitgeist topics.



Should the government regulate Artificial Intelligence?