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

Consider to use Ecmascript as the base #4

Closed
dangh opened this issue Jan 17, 2018 · 1 comment
Closed

Consider to use Ecmascript as the base #4

dangh opened this issue Jan 17, 2018 · 1 comment

Comments

@dangh
Copy link

dangh commented Jan 17, 2018

bathos/Ecmascript-Sublime is the best syntax highlighting right now. It already supports React and ES stage-3 features. The only missing part is Flow syntax. It would be great if we can patch it to support Flow.

Here's a quick comparison, Ecmascript (below) support ES6 decorator, and it can detect syntax error.
screen shot 2018-01-18 at 3 59 24 am

@Thom1729
Copy link
Owner

Full ECMAScript support is a top priority. While some features are currently absent from the core JavaScript syntax, I am actively working to add them and I hope that we may see 100% Stage-3 support in the next stable release. In the mean time, I may apply some of the outstanding patches to this syntax in anticipation of their eventual inclusion in core.

If there are specific features that are a high priority for you, I can probably put them next on the list.

Ecmascript-Sublime is an impressive piece of work, and in many ways it inspired the work that I've done on the core JavaScript syntax. However, it has several key disadvantages:

  • It's 5,447 lines of code, making it challenging to modify or debug.
  • It is much slower than the core syntax or JS Custom. Last time I checked, Ecmascript-Sublime took several times as long as core to highlight files.
  • It uses its own unique build system, which would not integrate well with JS Custom.
  • It differs from the core syntax in scoping and behavior, which means that tools designed for the core syntax are likely not to work with Ecmascript-Sublime.

In addition, I personally find its strict parsing to be a hindrance rather than a help. The core syntax is designed to handle syntax errors gracefully while you're typing. To catch errors, no syntax definition can replace a good linter.

For these reasons, I intend to stay with the core syntax. However, because of the modular nature of JS Custom, this shouldn't be a limiting factor. If another JavaScript package does something differently from the core syntax, it's probably possible to add an extension that provides the new behavior.

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

No branches or pull requests

2 participants