Let's Push Things Forward

Maximizing social utility for fun and (modest) profit

  • 1
I'm interested in static analysis of programs to improve quality. Given that JavaScript is dynamic in just about every direction, and not at all amenable to static analysis, how can we expect to improve tooling so that programming errors are caught before release? (That was the reason I wanted to attend the DX hackfest.)

As an example, this is the kind of thing which I'm interested in: http://fedoraproject.org/wiki/Features/StaticAnalysisOfPythonRefcounts. Possible with Python (as an arbitrary example), probably not possible with JavaScript.

(Note: linting is not the same as static analysis. Linting is useful, but has limitations.)

Re: Discussion question

Yeah, in the very least, I think we should make linting happen for JavaScript code in the same places we compile our compiled code to minimize risks of, eg, runtime compilation errors (the type that are caught earlier in static languages).

I'm not personally an experienced JavaScript developer (more C, Vala, Python, etc.), so maybe others can point out other areas we can bridge the gap between static and dynamic languages. I'd certainly welcome that.

Re: Discussion question

With jslint (or gjslint) and plenty of jsdoc comments, you can get what amounts to compile-time type checking.

I'm not sure if there's a simple way to do it without Closure, but since I use Closure most of the time, I find it very convenient to use Closure's compiler to find many easily overlooked issues for me, across many JavaScript files.

  • 1

Log in