Is there an official language spec and/or lexical grammar for TS?

This page summarizes the projects mentioned and recommended in the original post on reddit.com/r/typescript

Our great sponsors
  • Appwrite - The Open Source Firebase alternative introduces iOS support
  • Scout APM - Less time debugging, more time building
  • JetBrains - Developer Ecosystem Survey 2022
  • SonarLint - Deliver Cleaner and Safer Code - Right in Your IDE of Choice!
  • TypeScript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

    The spec has been out of date for years, it's a long standing issue unfortunately. In fact two years ago they decided that the official spec was no longer a concern to them at all. https://github.com/Microsoft/TypeScript/issues/15711

  • promises-spec

    An open standard for sound, interoperable JavaScript promises—by implementers, for implementers.

    Dang, that GitHub thread is probably the most dramatic thread I’ve seen since the famous attempt to get Promises to work like monads.

  • Appwrite

    Appwrite - The Open Source Firebase alternative introduces iOS support . Appwrite is an open source backend server that helps you build native iOS applications much faster with realtime APIs for authentication, databases, files storage, cloud functions and much more!

  • swc

    Rust-based platform for the Web

    It's not official, but swc includes an existing TypeScript parser written in a lower-level language. Swc is specifically designed for AST transformations. Currently the plugin system for custom transformers uses JS plugins which might not be fast enough for you. They are discussing implementing a Rust plugin system that would be faster. In the meantime you could pull out the parser code, and incorporate it into your own code.

  • esbuild

    An extremely fast JavaScript and CSS bundler and minifier

    If Rust isn't for you there is also esbuild which includes a TypeScript parser written in Go.

  • tree-sitter-typescript

    TypeScript grammar for tree-sitter

    If you need to do efficient AST operations, have you considered treesitter? There is a typescript grammar available https://github.com/tree-sitter/tree-sitter-typescript

NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts