Well, there are some additions - thought it can be compiled via tsc into js that would never run. This is still useful though for IDE and tooling support, language servers etc.
The most important thing is that you have these types you can import. For example the "int" below:
import { int } from "@tsonic/core/types.js";
function fibonacci(n: int): int {
if (n <= 1) {
return n;
}
return fibonacci(n - 1) + fibonacci(n - 2);
}
Instead of making it a keyword, I decided to export these from core/types.ts - so that the code can still be compiled with tsc, and all the tooling would still work. Similarly (among others), you'd use ptr<long>, if you wanted a pointer to a long.
Well, there are some additions - thought it can be compiled via tsc into js that would never run. This is still useful though for IDE and tooling support, language servers etc.
The most important thing is that you have these types you can import. For example the "int" below:
Instead of making it a keyword, I decided to export these from core/types.ts - so that the code can still be compiled with tsc, and all the tooling would still work. Similarly (among others), you'd use ptr<long>, if you wanted a pointer to a long.