All Projects → APrioriInvestments → typed_python

APrioriInvestments / typed_python

Licence: Apache-2.0 license
An llvm-based framework for generating and calling into high-performance native code from Python.

Programming Languages

python
139335 projects - #7 most used programming language
C++
36643 projects - #6 most used programming language
c
50402 projects - #5 most used programming language

Projects that are alternatives of or similar to typed python

auto coding
A basic and simple tool for code auto completion
Stars: ✭ 42 (-76.4%)
Mutual labels:  python-programming
Awesome Python Books
📚 Directory of Python books
Stars: ✭ 3,154 (+1671.91%)
Mutual labels:  python-programming
Dr0pFi
Using this tool, You can capture all WiFi Passwords stored on Windows Computer and mail them to your email account!
Stars: ✭ 38 (-78.65%)
Mutual labels:  python-programming
NPTEL-The-Joy-of-Computing-using-Python
Study materials related to this course.
Stars: ✭ 29 (-83.71%)
Mutual labels:  python-programming
90 Python Examples
The best way to learn Python is by practicing examples. The repository contains examples of basic concepts of Python. You are advised to take the references from these examples and try them on your own.
Stars: ✭ 190 (+6.74%)
Mutual labels:  python-programming
Plagiarism-checker-Python
A python project for checking plagiarism of documents based on cosine similarity
Stars: ✭ 114 (-35.96%)
Mutual labels:  python-programming

Build Status License

typed_python

The typed_python module provides strong runtime types to Python and a compiler that can take advantage of them.

It gives you new types you can use to build strongly- and semi-strongly-typed datastructures, so that your program is easier to understand, and a compiler toolchain that can take advantage of those datastructures to generate machine code that's fast, and that doesn't need the GIL.

typed_python is a standard modules that run on Python 3.6 and higher. You can use it incrementally throughout your project - add a few type constraints here and there, or compile a couple of small but performance-critical functions. As you add more type information, more of your program can be compiled. Everything can still run in interpreter without compilation if you want.

typed_python is generously supported by A Priori Investments, a quantitative hedge fund in New York. If you're interested in working with us, drop us a line at [email protected].

Getting started

You can read the introductory tutorial for using typed_python or check out the documentation typed_python.

Where did this come from?

Every time I (Braxton) find myself writing a lot of Python code, I eventually start to miss C++. As my program gets bigger, I find myself losing track of what types are supposed to go where. My code gets littered with 'isinstance' assertions trying to catch mistakes early and provide information about what kinds of types I expect in certain parts of the code. Compilers solve these kinds of problems because the type information is out front directly in the code, and they can find bugs without having to run the program. And of course, I miss the performance you get out of C++ - every time I write some overly complicated numpy code, I think to myself how much easier to understand this code would be if I could only write a loop.

On the other hand, whenever I write a lot of C++, I find myself missing the expressiveness of Python, the ability to iterate without a painful compile cycle, the safety you get from having bad code throw an exception instead of producing a segfault. And of course, nobody likes looking through a ten page error log just to find out that a template parameter is missing.

I developed typed_python to try to have the best of both worlds. typed_python lets me have a single codebase, written entirely in Python, where I can choose, depending on the context, which style of code I want, from totally free-form Python with total type chaos, to statically typed, highly performant code, and anything in between.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].