[Grace-core] Is grace as statically typed as python?

Marco Servetto marco.servetto at gmail.com
Sun May 4 13:02:17 PDT 2014


On 5 May 2014 05:40, Andrew P. Black <black at cs.pdx.edu> wrote:
> but the mechanism itself is part of  the language.


I agree for point (1), types for python would require some non-elegant
and non-natural solutions, since the syntax was not designed to
accommodate this kind of annotations, and they added decorators later.
 but I do not understand point(2)//but the mechanism itself is part of
 the language.
If I understand you mean that ast-manipulation in the sense of seeing
the ast as data structure, modify it and "commit" it is part of the
language.
is the set of functionality allowing ast-manipulation part of the
language is potentially  expressible as a library over a simple
commit/eval primitive functionality? That is something python have too...

For who do not know python decorators:
@accepts(int,int)
@returns(float)
def bar(low,high):
    pass

and while you do not have the ast directly, there is a way to get your
source code, and a library "ast" with a nice "parse" method...
https://docs.python.org/2/library/ast.html
(historical?) http://legacy.python.org/dev/peps/pep-0318/


More information about the Grace-core mailing list