Repository navigation
Conversation
Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
Signed-off-by: Ashley Claymore <aclaymore@bloomberg.net>
|
Hi there. I'm not an active user of this library, unfortunately, but I'm keeping an eye on it because I love the idea behind it. Pure intereset. Are you considering rewriting it in Go since the TypeScript 7 is now in Go? |
Collaborator
Author
|
Hi @vanyauhalin 👋🏻 thanks for taking an interest in the project! Rewriting in Go is not something currently being considered. I think this library provides the most benefit by being distributed as a small JavaScript package that can depend on the official TypeScript-Native package. The performance numbers are good and it keeps the package small and simple. |
dragomirtitian
force-pushed
the
ts-go
branch
from
September 4, 2026 13:48
3846d99 to
91b4cf7
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Just an experimental draft PR for now with the basics working.
Performance
The repo's perf test is currently showing 40% overhead on my M2 when using the native APIUsing
--cpu-profto find hot spots and replace them with more efficient APIs the benchmark time has been improved from 1.641s to under a second and is now ~23% faster than main:Note: this is with microsoft/typescript-go#4472 fixed locally, otherwise the current overhead is higher due to that extra walking caused by the bug.Now fixed upstream.Output differences
Changes in AST Node start and end positions mean that more comments are being blanked out. Sometimes the output looks more correct, other times it would have been nice to preserve the comment. Using the scanner to get comment aware positions would likely address most of these.This appears to be fixed upstream testing with
@typescript/native-preview@7.0.0-dev.20260629.1🎉String position encoding bug
Non-ASCII characters are currently resulting in incorrect output due to the string position difference between Go (UTF-8) and JS (UTF-16).microsoft/typescript-go#4289 did fix the issue for diagnostics. Maybe the same can be done for AST nodes too.This appears to be fixed upstream testing with
@typescript/native-preview@7.0.0-dev.20260629.1🎉