I have been moving my MATLAB to Python, and for many things that are not related specific to mathematics I have had a more difficult time finding a portable language. Due to the fact that Windows support is always a challenge when you do not use it, I settled on Typescript. In the same way that Microsoft address all of my gripes about Java by making C#, Typescript solves most of my complains about Javascipt. Typescript creates Javascript, so that the code can run on the seemingly ubiquitous Javascript.
In order to use Typescript, we need a program called tsc at a minimum. A Typescript IDE would be helpful too (I used Visual Studio Code). In order to install TypeScript, I used macports, so start by installing macports.
Once you have macports, install package manager for node.js called npm:
port install npm5
npm install -g typescript
tsc --version
{ class Startup { public static main(): number { console.log('Hello World'); return 0; } } Startup.main(); }
tsc test.ts
node test.js
No comments:
Post a Comment