New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type Inference System, Program Analysis Project #1893

Open
usama54321 opened this Issue Sep 27, 2017 · 1 comment

Comments

Projects
None yet
2 participants
@usama54321

usama54321 commented Sep 27, 2017

Hi,

I am a Computer Science student, and am taking a Program Analysis Course this semester. As part of the course, I am going to work on a project, under the guidance of an instructor. My project idea has been to work on optimizing the type inference/system of a dynamically typed compiled system. After going through a few projects online, I came upon cython, and it seems to fit my project description exactly.

I have been going through the documentation, and have read about the auto inference system working on the basic C types except Integers. What I have in mind so far is to work on improving the type analysis system, so it can also infer the return types of functions, as requested here, and maybe build up further from there.

I would be really thankful if you could give me some overview about the type analysis system in place already, and where to start reading up on the internals of the library.

Thanks
Usama

@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Sep 27, 2017

Contributor

Cool, excellent idea :)

You've probably already found the current type inference driver in
https://github.com/cython/cython/blob/master/Cython/Compiler/TypeInference.py
It builds upon the infer_type() methods of each of the expression nodes in the syntax tree, see ExprNodes.py. Currently, type inference is done only inside of functions. Not at the global module level, and not across functions. And it is mostly limited by safety considerations. We cannot infer some unsafe C type where the code suggests Python semantics (unlimited integers, arbitrary subtypes of Python classes, etc.).

To get started, you can look through the hacker guide:
https://github.com/cython/cython/wiki/HackerGuide#getting-started
It's probably not entirely up to date, but it should give you an entry point.

For project communication, please subscribe to the cython-devel mailing list. A bug tracker is not a good place to discuss general organisational things etc.

Contributor

scoder commented Sep 27, 2017

Cool, excellent idea :)

You've probably already found the current type inference driver in
https://github.com/cython/cython/blob/master/Cython/Compiler/TypeInference.py
It builds upon the infer_type() methods of each of the expression nodes in the syntax tree, see ExprNodes.py. Currently, type inference is done only inside of functions. Not at the global module level, and not across functions. And it is mostly limited by safety considerations. We cannot infer some unsafe C type where the code suggests Python semantics (unlimited integers, arbitrary subtypes of Python classes, etc.).

To get started, you can look through the hacker guide:
https://github.com/cython/cython/wiki/HackerGuide#getting-started
It's probably not entirely up to date, but it should give you an entry point.

For project communication, please subscribe to the cython-devel mailing list. A bug tracker is not a good place to discuss general organisational things etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment