Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

What if Ladybird had *real* Typescript support? #1633

Open
aurium opened this issue Oct 4, 2024 · 1 comment
Open

What if Ladybird had *real* Typescript support? #1633

aurium opened this issue Oct 4, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@aurium
Copy link

aurium commented Oct 4, 2024

It would be nice to have a browser that supports TS like Node, Deno and Bun... but these only support as something to be converted (lost) on the fly, not as something that can enable important optimizations at runtime. LibJS could do better!

I think Ladybird could enable TS features when found <script type="typescript">, that also implies type="module", or when receive the HTTP header content-type: text/typescript. Other browsers will not run this code and devs can write a failover code.

Why support TS, not just transpile to JS? As an engine can be more performant manipulating numbers in a Float64Array than in a generic Array, some runtime benefit can be gained by let arr: number = []

When a function is called with incompatible arguments, the engine must not allow the fate to decide application result... In this case the execution must to stop and an exception should be thrown. With this approach other optimizations can be achieved, by 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.

That can bring some of the WebAssembly performance to common web apps, with direct DOM interaction.

@ADKaster
Copy link
Member

ADKaster commented Oct 4, 2024

For the next several years we will be focused on building out the browser to be able to view the modern web as it exists today, in the hope of it becoming a daily driver for non-technical users.

You're of course welcome to add your own experimental features to your fork(s).

@ADKaster ADKaster added the enhancement New feature or request label Oct 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants