News for hackers. Stuff that matters.
Re:The Grep Test by pnathan on Friday July 12, 2013 @04:42PM (#6035045)
No, actually, dynamic languages can, theoretically, handle this. At least, I can introspect in a running Lisp instance quite well. By all reports Smalltalk does it quite well too.

The fact that most dynamic languages were hacked together doesn't imply that the better systems also fail.

Re:The Grep Test by brazzy on Friday July 12, 2013 @05:16PM (#6035261)
No, actually, dynamic languages cannot handle this even theoretically. See halting problem: No realistic amount of introspection is going to automatically tell you where negative_position is defined in the second example from TFA, because method_missing can do literally anything to decide what method names it does and does not handle. And Smalltalk's #doesNotUnderstand: works exactly like that.
Re:The Grep Test by wes-exp on Saturday July 13, 2013 @11:47AM (#6037778)
You are confusing dynamic typing vs static typing with run-time execution vs compile-time execution.

A statically typed language can do arbitrary stuff at run-time too that will not be amenable to static analysis. This has nothing to do with the type system.

Furthermore, a dynamic language can be perfectly amenable to static analysis. For instance, in lisp+slime, slime-who-calls can identify callers of a particular function, even when grep would not, e.g. if the function was invoked via a turing-complete macro. The key thing here is that the AST to be analyzed does exist at compile-time; it just happens to be generated rather than hand-coded.

Re:The Grep Test by gohrt on Friday July 12, 2013 @05:57PM (#6035484)
In practice, you can add a sprinkle of static to your dynamic language, adding a preprocessor that requires declaration of method_missing patterns that are acceptable to the application.
Re:The Grep Test by vidarh on Friday July 12, 2013 @10:56PM (#6036506)
Theoretically, for constrained cases yes.

On the other hand, the typical Ruby ORM defines methods that corresponds to the current columns of tables in the database it is told to connect to. That fancy AST parsing tool won't be able to do anything in that case without being able to connect to your database and issue queries...

You might consider this "hacked together" but those kinds of api's is a major part of the draw of Ruby for a lot of people.