GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - APrioriInvestments/typed_python: An llvm-based framework for generating and calling into high-performance native code from Python.

BranchesTags
Open more actions menu

Latest commit

 

History

1,846 Commits
1,846 Commits

Folders and files

NameName
Last commit message
Last commit date
.github
.github
 
 
docs
docs
 
 
typed_python
typed_python
 
 
.activate
.activate
 
 
.codecov.yml
.codecov.yml
 
 
.gitignore
.gitignore
 
 
.pre-commit-config.yaml
.pre-commit-config.yaml
 
 
AUTHORS
AUTHORS
 
 
LICENSE
LICENSE
 
 
Makefile
Makefile
 
 
NOTICE
NOTICE
 
 
Pipfile_3_10
Pipfile_3_10
 
 
Pipfile_3_10.lock
Pipfile_3_10.lock
 
 
Pipfile_3_7
Pipfile_3_7
 
 
Pipfile_3_7.lock
Pipfile_3_7.lock
 
 
Pipfile_3_8
Pipfile_3_8
 
 
Pipfile_3_8.lock
Pipfile_3_8.lock
 
 
Pipfile_3_9
Pipfile_3_9
 
 
Pipfile_3_9.lock
Pipfile_3_9.lock
 
 
README.md
README.md
 
 
install_and_test.sh
install_and_test.sh
 
 
pyproject.toml
pyproject.toml
 
 
requirements.txt
requirements.txt
 
 
setup.py
setup.py
 
 
tox.ini
tox.ini
 
 
unicodeprops.py
unicodeprops.py
 
 

Repository files navigation

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.

About

An llvm-based framework for generating and calling into high-performance native code from Python.

Topics

compilerpython-programming

Resources

Readme
Apache-2.0 license

Contributing

Contributing
Activity
Custom properties

Stars

201 stars

Watchers

12 watching

Forks

8 forks
Report repository

Releases

Packages

Used by

Contributors

Languages

You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.