Skip to content

Update Language Specification #4033

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

Merged
merged 5 commits into from
Jul 29, 2015
Merged

Update Language Specification #4033

merged 5 commits into from
Jul 29, 2015

Conversation

ahejlsberg
Copy link
Member

This spec update includes the following:

  • Revised grammar to be based on ES6 spec.
  • Extensive revision of script and module grammar.
  • Changed "internal module" to "namespace" everywhere.
  • Changed "external module" to "module" everywhere.
  • Added TODO comments with links to all open issues.
  • Added section on names (2.2)
  • Revised section on declarations (2.3)
  • Revised section on scopes (2.4)
  • Revised section on union types (3.4)
  • Added section on intersection types (3.5)
  • Revised section on type references (3.8.2)
  • Permit comma separator in object type literals (3.8.3)
  • Generic type aliases (3.10)
  • Revised apparent members of union and intersection types (3.11.1)
  • Revised section on function expressions (4.10)
  • Added section on blocks (5.1)
  • Added section on let and const declarations (5.3)
  • Renamed chapter 11 to Scripts and Modules
  • Added ES6 style modules (11.3)

This PR also updates the word2md tool to properly convert hyperlinks from Word to Markdown format.

ahejlsberg added a commit that referenced this pull request Jul 29, 2015
@ahejlsberg ahejlsberg merged commit b3feae1 into master Jul 29, 2015
@ahejlsberg ahejlsberg deleted the updateLangSpec branch July 29, 2015 14:54
@danquirk
Copy link
Member

@mhegazy @RyanCavanaugh thoughts on doing a pass on new conformance tests for these changes? If we're going to do a significant reworking of the spec for 1.6 maybe we'd rather put off a conformance pass right now and do it in the context of the newly organized spec.

@aharpervc
Copy link

@ahejlsberg the language near the bottom of 1.10 Modules seems awkward

Module 'M' is an example of an internal module, because it is nested within the global module (see section 10 for more details)

Section 10 is about Namespaces. Did this miss the find/replace?

Also:

TypeScript also supports external modules, which are files that contain top-level export and *import *directives.

If all "modules" are external modules then this could stand to be reworded.

@ahejlsberg
Copy link
Member Author

@aharpervc The entire introduction is due for an overhaul which we're hoping to get it done soon. It's definitely seeming rather out of date at this point.

@basarat
Copy link
Contributor

basarat commented Jul 31, 2015

Changed "internal module" to "namespace" everywhere.
Changed "external module" to "module" everywhere.

Awesome 👍 . Should people no longer use the module keyword for namespaces?

@RyanCavanaugh
Copy link
Member

Should people no longer use the module keyword for namespaces?

That's our recommendation - namespace is preferred now. We've switched over the compiler sources, so it should only be a few days before everyone else follows suit 😉

We'll support module x { ... } for the foreseeable future - obviously it would be a gigantic breaking change to remove it at this point.

@basarat
Copy link
Contributor

basarat commented Jul 31, 2015

We've switched over the compiler sources

Just curious if this is an oversight or intentional

@RyanCavanaugh
Copy link
Member

Oversight

@basarat
Copy link
Contributor

basarat commented Jul 31, 2015

Thanks 🌹

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants