1. 15
  1.  

  2. 3

    I really like this idea! It’s something I use a lot when coding Haskell (static restriction of what the “right answer” for a codebase ought to be) and then suffer terribly from in a dynamic language.

    It also makes me wonder what a language which enabled cheap addition of static analyses would look like. Something like Scala’s presentation compiler is an obvious step in the right direction, but even more could be done with a plugin system, perhaps, that let you embed new checks deep inside the compiler.

    1. 3

      Go provides https://golang.org/pkg/go/parser/, which makes it pretty easy to do this. We use automatic static analysis a lot at Google, especially in the code review tool.

      1. 1

        I spent an evening a few months ago navel gazing about writing a macro layer on Common Lisp that would add type checking as part of the macroexpansion phase. Didn’t get more than just mentally chewing on the idea. I should explore it more. :-)

      2. 2

        I get where the author is coming from, and it is a nice idea and all, but unless there is a toolkit that makes it easy to write rules for such things I do not see this becoming reasonable.

        1. 0

          Sorry, if you’ve not made a clear thesis by the third of fifteen paragraphs, I see no reason to continue reading.