Closed sjmatta closed 8 years ago
Antlr can generate javascript parser code from an antlr grammar. CFLint is built over https://github.com/cfparser/cfparser/tree/master/cfml.parsing/src/main/antlr4/cfml.
I'm not planning on touching that one though :-)
@ryaneberly haha, I don't want to know how much time you put into rewriting the parser. Better man than I. That's for sure.
:)
@ryaneberly Cool! Thanks for that. The only reason behind this is that launching Java from Atom is slow and cumbersome. But, at the same time, Java makes a lot more sense for linting during things like a Gradle build. I'll have to really think about this.
Maybe the solution is less a JavaScript implementation and more finding a way to 'build' the JAR into an executable... just thinking out loud
It is slow every time, or just the first time you call from it from Atom?
You could have the java process startup once and keep listening for future requests. And maybe auto-terminate after a period of time if no new lint requests arrive.
Then your integration package could be pure javascript, and make the request and process the response through some form of interprocess communication. (named pipes, a local port, etc).
This is naturally a bit complex, but far simpler than re-writing the entire linter in a different language. and you would eliminate the cost of the JVM startup.
CFLint is far too big and rich to recreate. This was sort of a pipe dream early on before I really dove in. Java as the language of choice makes sense when using Maven and Gradle, and I don't want to fork this. Instead I'll focus on performance improvements with the Java version.
This is a huge job, but I wanted to suggest it