Replies: 1 comment
-
Hi @aurium Thanks for the issue. I have no doubt having type information will make the engine faster, but it is a large undertaking and not something on our roadmap anytime soon. We want to focus on improving performance with the engine, updating the GC and finishing the Temporal implementation. The issue with implementing Typescript is that there is no spec for it, so we would never be 100% compatible and whatever we had could change with each release, so we would constantly be chasing compatibility with the reference implementation. I’ll leave this open as a discussion, as I have no issue with someone attempting this, but I don’t think any of the core contributors can give any time to it right now. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I saw issue #4 by @JasonShin. I understand it may not be something to focus right now.
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. Boa can do more!
Just as an engine can be more performant manipulating numbers in a
Float64Array
than in a genericArray
, some runtime benefit can be gained byarr: 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.Boa could follow one of this paths:
any
everywhere automatically) to run. I believe this is positive, so that any project will benefit when at least one module provides typing.--ts-strict
flag, or acontext.eval(..., ts_strict)
arg, to enable type optimizations.Extra: Mozilla, with asm.js, showed 10 year ago that types could improve JS performance.
Beta Was this translation helpful? Give feedback.
All reactions