Why atom chose Sublime Text's grammar definitions?


#1

Hi, I created a new grammar called Cirru, and I tried to create quite some highlighting for it.
The problems I found is, there’s no state in the syntax definitions, making it quite hard to debug the grammar files, comparing to the grammar definition in Codemirror.

I found your definition here: atom language-coffee-script

Below are the examples of Cirru in Sublime Text and CodeMirror,
which you can see it’s more intuitive in CodeMIrrow’s.

github.com/Cirru/sublime-cirru/blob/master/Cirru.YAML-tmLanguage
https://github.com/Cirru/codemirror-cirru/blob/master/coffee/cirru.coffee


Sequential includes in grammars
#2

I can only assume that Atom adapted their grammar definition format from Sublime Text’s grammar definition format because that is essentially TextMate’s grammar definition format which is prevalent and allows an easy way to support existing packages.

I too would love to see some other formats supported. CodeMirror’s seems like a good candidate.


#3

From earlier posts from the Atom team, I believe that they specifically chose to emulate TextMate’s grammar definitions. I think the resemblance to Sublime Text’s grammar definitions is just that both chose to use JSON/CSON as the storage mechanism rather than the OS X-specific plist format.

The library that provides the grammar tokenization and such is also called first-mate.

As to supporting other formats, I think the general guidance from the FAQ on “Technology Choices” applies. Given the time and resources, I think the Atom team would like to support lots of different technologies, but they had to start somewhere … :grinning: