Common functionality for dynamic languages

Sven Brauch svenbrauch at googlemail.com
Wed Apr 16 19:36:40 UTC 2014


Hi!

I recently spent some time on cleaning up and generalizing some of the tools 
kdevelop-python uses for type inference, and moved them to KDevPlatform. 
There's now the following things:

 - The container types: They make it possible to track T for List<T> for a T 
which is not static. There's also a type for hashmap-like objects which can 
track P and Q in Map<P, Q>. I think this might be especially interesting for 
PHP and JS; Ruby already uses its own (extended) copy and will eventually port 
to the new base class.
See language/duchain/types/containertypes.h in KDevPlatform.

 - Some type utilities, which allow to conveniently merge multiple types into 
an unsure type.
See language/duchain/types/typeutils.h in KDevPlatform.

 - A base expression visitor for finding the type of an expression. This is 
another thing which is reimplemented from scratch for each dynamic language 
and looks almost the same, so I think it would be good to share a common base. 
Especially increased consistency across language plugins would be nice here.
See language/duchain/builders/dynamiclanguageexpressionvisitor.h in 
KDevPlatform.

I'm writing this email so interested parties can review the API; I'd be happy 
to modify it to make it useful for other languages.

Greetings!
Sven


More information about the KDevelop-devel mailing list