Description
Typescript is no longer a niche language. Large projects and small solutions are written directly in Typescript.
Node, Deno and Bun support TS as something to be converted (lost) on the fly, not as something that can enable important optimizations at runtime. Nova is just another one doing the same.
Just as an engine can be more performant manipulating numbers in a Float64Array than in a generic Array, some runtime benefit can be gained by arr: number = []
When a function is called with incompatible arguments, the engine will not allow the fate to decide application result... In this case the execution will stop and an exception should be thrown. With this approach other optimizations can be achieved, for example: (a:number, b:number)=> a + b
, where the +
operator will always be an arithmetic operator (no string concatenation will be possible) and no elaborate conversion should be expected.
I've already seen that @load1n9 is moving in this direction, especially working on enums support.
I think Nova should to be a TS first engine to achieve this goal, and JS code will need to receive generic typing (any
everywhere) to run. I believe this is positive, so that any project will benefit when at least one module provides typing.