ditinc / linter-cflint

:shirt: CFLint plugin for Atom Linter
MIT License
4 stars 7 forks source link

Rewrite parser/linter in JavaScript #7

Closed sjmatta closed 8 years ago

sjmatta commented 9 years ago

This is a huge job, but I wanted to suggest it

ryaneberly commented 9 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 :-)

jjames967 commented 9 years ago

@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 commented 9 years ago

:)

sjmatta commented 9 years ago

@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.

sjmatta commented 9 years ago

Maybe the solution is less a JavaScript implementation and more finding a way to 'build' the JAR into an executable... just thinking out loud

ryaneberly commented 9 years ago

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.

sjmatta commented 8 years ago

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.