TypeScript-Go: Microsoft's Native Port Development – What You Need to Know
Are you a developer interested in the future of TypeScript? Microsoft's typescript-go project is a native port of TypeScript being developed in Go. This has the potential to significantly impact performance and integration capabilities. Here’s what you need to know about this exciting project.
What is TypeScript-Go?
TypeScript-Go is a Microsoft project focused on creating a native port of the TypeScript language using the Go programming language. This staging repository serves as the development ground for this undertaking. The goal is to potentially merge its contents into the main microsoft/TypeScript
repository long-term.
Why a Native Port of TypeScript?
A native port can bring several advantages:
- Performance Boost: Go can offer improved performance compared to the existing JavaScript implementation.
- Simplified Integration: Easier integration with Go-based backend systems.
- New Possibilities: Opening doors to new platforms and environments where TypeScript can be used.
Getting Started with TypeScript-Go: Build and Run
Want to try it out? Here’s how to get started:
-
Prerequisites: Go 1.24+, Node.js with npm, and
hereby
. -
Clone the repository: Make sure to clone with submodules:
-
Initialize Submodules (if already cloned):
-
Install Dependencies:
-
Run Tasks with Hereby:
Running the tsgo
Compiler
After building, you can find the compiler at built/local/tsgo
. The tsgo
command largely behaves like tsc
, respecting tsconfig.json
and printing performance statistics. For closer fidelity to the regular tsc
, use tsgo tsc [flags]
.
Trying the LSP (Language Server Protocol) Prototype
- Open the repository in VS Code (
code .
). - Copy
.vscode/launch.template.json
to.vscode/launch.json
. - Press
F5
to start debugging.
If set up correctly, a new VS Code instance will launch, utilizing the Corsa LS as the backend, which you can verify in the Output pane.
What's Working and What's Not? Current Status
Keep in mind this is an active development project. Here's the current status overview of the typescript-go project:
- Done: Program creation, parsing/scanning, type resolution, type checking.
- In Progress: Emit (JS output).
- Prototype: Watch mode, language service (LSP).
- Not Ready: JavaScript-specific inference, JSX, declaration emit, build mode, incremental build, API.
Before reporting issues, please review the status list to ensure you're not reporting something already known or under development.
Contributing to TypeScript-Go
Microsoft encourages contributions to this project. Ensure you agree to the Contributor License Agreement (CLA). Follow the instructions provided by the CLA bot when you submit a pull request.
Key Takeaways
- typescript-go is a native port of TypeScript written in Go.
- It aims to improve performance and integration capabilities.
- The project is under active development, with different features at various stages of completion.
- Community contributions are welcome.
Stay tuned for further updates as this project evolves!