This tutorial explains where basil.js sits in comparison to Processing. By Ludwig Zeller
While basil.js is in the spirit of Processing, in the details it is quite different. Processing is based on the Java language, running relatively low-level drawing commands on a Java Virtual Machine and painting pixels to the screen. You can do much more but in a nutshell that's the idea.
So if you cannot draw pixels to a canvas, what is this good for? Well, it's meant to be a meaningful addition for graphic designers who work on poster and book designs. While Processing is an extremely versatile environment your programmes are usually limited regarding the ease of use. For instance you cannot move items that you have drawn to the screen, manage them on layers easily, alter their appearance afterwards or simply save the current state of your project to your hard drive. Of course you can add all these functionalities, but you have to do it individually for each usage scenario on your own.
basil.js on the other hand is quite different. Since you always work on InDesign documents from the beginning you get all this convenience from the beginning. So you should ask yourself if you want to go wild with an experimental high-performance algorithm and just want to create some visual output or if you want to produce a project file that you can manually alter by hand, generate and modify by code, re-edit by hand, and so forth. Basil.js is meant for the latter.
It is worth mentioning that Scriptographer offers a well developed environment for Adobe Illustrator. While really liking their work we thought that it would be interesting to add this philosophy to InDesign as well since the target use is quite different. Unfortunately, Scriptographer has recently been stalled.