Using Node.js on the IBM i Platform

Bill Onion

Traditionally RPG is the most used language on the IBM i platform. As RPG developers are retiring, companies running the IBM i are getting concerned about a talent shortage. While we at Briteskies offer a great solution to retiring developers and system admins, if you want to think even further into the future, Node.js is a great option.

What is Node.js? 

Node.js is an open-source, cross platform, back-end JavaScript runtime environment that runs on a JavaScript engine and executes JavaScript code outside a web browser, designed to build scalable network applications.

Now let’s break that down.

The “js” at the end of name stands for JavaScript. JavaScript is considered one of the easiest languages to learn, making it the most popular programming language in the world.

JavaScript is a client-side language, also referred to as a frontend language. As a client-side language, JavaScript is responsible for executing actions that take place on the user’s computer as opposed to the server – actions like data validation, email format validations, etc.

JavaScript is executed by an engine, a software component that interprets the code and allows the computer to execute it as a just-in-time compilation. For our purposes, it is important to note that Node.js was built specifically on Google Chrome’s V8 JavaScript engine.

JavaScript also has application frameworks which allow for standard features to be easily written into custom code. The most popular JavaScript application frameworks are:

  • React: a collection of JavaScript created to build user interfaces for web applications
  • React Native: a collection that allows developers to build mobile apps with JavaScript
  • Node.js: a collection that enables two-way communications with servers for exchanging data

Before Node.js's creation, backend applications were created mainly in PHP, ASP.NET, and Java. Node.js extends that list and allows frontend developers with JavaScript skills to join in on the fun.

Why use Node.js? 

One of the most significant features of Node.js is its asynchronous I/O. Backend systems like PHP and ASP send requests using a synchronous method, programs “line up” in a virtual queue line and wait their turn to be sent. This means that one larger job can block the line for subsequent jobs.

In contrast, Node.js is single-threaded and non-blocking, meaning commands execute concurrently or in parallel and use callbacks to signal completion or failure. This feature makes Node.js significantly faster than PHP for example, since it doesn’t get stalled by a single large job. However, because Node.js is single-threaded it is not ideal for large computations that will take up a large CPU percentage as they will clog the thread and reduce command speed.

Why use Node.js on the IBM i? 

You may be wondering where the IBM i fits in to all this. The IBM i has built-in open-source technologies which allow for applications written in Node.js to be integrated with the legacy system. Companies can keep their existing legacy RPG code and write new code in Node.js and meld the two together. Writing code in Node.js is notoriously quick since developers can take advantage of the NPM, a free code repository, and minimize the need for new RPG development.

Using Node.js allows AS400 companies to cut down on development time and also take advantage of the large pool of JavaScript developers without having to change their existing custom code.

While it all depends on skill level, Node.js has the potential to decrease project cost, accelerate project timelines, and improve developer efficiency.


Questions? Contact Us For More Info



Subscribe by Email

No Comments Yet

Let us know what you think