The following description is taken directly from their website (and is why I think this implementation has possibilities).
intwill always remain an
intat both compile time and runtime, a variable declared as
unsigned shortwill always remain an
unsigned shortat compile time and runtime, and a variable declared as an
Employeeclass will always remain an
Employeeobject at both compile time and runtime. Previous systems could not guarantee your types would not transform at runtime, and there could be instances where a
stringcould “morph” into a number, function, null, or any other type during application execution.
Ok, let’s learn a little more about JS++. Note that I am just scratching the surface in this weblog post. If enough readers express interest in more in depth analyses, I may include that in the future.
First, I installed this on a Windows Server 2012 R2 operating system (since there is presently not a Mac version). You simply download, virus check, and install the .exe file. Once installed, you open the command prompt and enter js++ –version. Assuming all works as anticipated, you will see a screen like the following.
In the above case, this is the most recent version of JS++. You will also note that I am working in a Scripts/JS folder so I can keep all my code organized for these examples.
The first file I created is Example01.jspp (note the extension). I am using Brackets to display the contents below.
I next compiled the above file (using the command shell and the command js++ example01.jspp. The results are shown below.
The resulting jspp.js file does not readily pass JSLint (but I have this set to very strict standards).
As noted, there are some observed problems (most of these are relatively minor and likely due to my settings for JSLint in Brackets). I would expect the version 1.0 of JS++ will have addressed these sorts of issues.
One next creates a bit of HTML and references the JS file as shown below.
The resulting web page is shown in the Chrome browser below.
I am curious if you have tried JS++ (or plan to experiment with it). As always, I look forward to your comments.