All Projects → mypyc → Mypyc

mypyc / Mypyc

Licence: other
Compile type annotated Python to fast C extensions

Programming Languages

python
139335 projects - #7 most used programming language
types
53 projects

Labels

Projects that are alternatives of or similar to Mypyc

Roslynclrheapallocationanalyzer
Roslyn based C# heap allocation diagnostic analyzer that can detect explicit and many implicit allocations like boxing, display classes a.k.a closures, implicit delegate creations, etc.
Stars: ✭ 492 (-14.43%)
Mutual labels:  compiler
Esbuild
An extremely fast JavaScript and CSS bundler and minifier
Stars: ✭ 29,374 (+5008.52%)
Mutual labels:  compiler
C2compiler
the c2 programming language
Stars: ✭ 576 (+0.17%)
Mutual labels:  compiler
Libfsm
DFA regular expression library & friends
Stars: ✭ 512 (-10.96%)
Mutual labels:  compiler
Acwj
A Compiler Writing Journey
Stars: ✭ 5,891 (+924.52%)
Mutual labels:  compiler
Gscript
framework to rapidly implement custom droppers for all three major operating systems
Stars: ✭ 547 (-4.87%)
Mutual labels:  compiler
Awesome Tensor Compilers
A list of awesome compiler projects and papers for tensor computation and deep learning.
Stars: ✭ 490 (-14.78%)
Mutual labels:  compiler
Ccl
Clozure Common Lisp
Stars: ✭ 584 (+1.57%)
Mutual labels:  compiler
Playwithcompiler
A GeekTime course about constructing a compiler.
Stars: ✭ 543 (-5.57%)
Mutual labels:  compiler
Dcc
DCC (Dex-to-C Compiler) is method-based aot compiler that can translate DEX code to C code.
Stars: ✭ 568 (-1.22%)
Mutual labels:  compiler
Luago Book
《自己动手实现Lua》随书源代码
Stars: ✭ 514 (-10.61%)
Mutual labels:  compiler
Jtransc
Bytecode to source converting Java & Kotlin code into JavaScript, C++, D, C#, PHP, AS3, Dart and Haxe and run it everywhere. Also use JVM code in your favourite language as a library.
Stars: ✭ 532 (-7.48%)
Mutual labels:  compiler
Estrella
Lightweight and versatile build tool based on the esbuild compiler
Stars: ✭ 543 (-5.57%)
Mutual labels:  compiler
Langcraft
Compiler from LLVM IR to Minecraft datapacks.
Stars: ✭ 495 (-13.91%)
Mutual labels:  compiler
Pl Compiler Resource
程序语言与编译技术相关资料(持续更新中)
Stars: ✭ 578 (+0.52%)
Mutual labels:  compiler
Red
Red is a next-generation programming language strongly inspired by Rebol, but with a broader field of usage thanks to its native-code compiler, from system programming to high-level scripting and cross-platform reactive GUI, while providing modern support for concurrency, all in a zero-install, zero-config, single 1MB file!
Stars: ✭ 4,725 (+721.74%)
Mutual labels:  compiler
V
Simple, fast, safe, compiled language for developing maintainable software. Compiles itself in <1s with zero library dependencies. https://vlang.io
Stars: ✭ 26,283 (+4470.96%)
Mutual labels:  compiler
Packem
📦⚡ A precompiled JavaScript module bundler
Stars: ✭ 586 (+1.91%)
Mutual labels:  compiler
Lacc
A simple, self-hosting C compiler
Stars: ✭ 580 (+0.87%)
Mutual labels:  compiler
Webassemblyjs
Toolchain for WebAssembly
Stars: ✭ 566 (-1.57%)
Mutual labels:  compiler

mypyc

Mypyc compiles Python modules to C extensions. It uses standard Python type hints to generate fast code. Mypyc uses mypy to perform type checking and type inference.

Mypyc can compile anything from one module to an entire codebase. The mypy project has been using mypyc to compile mypy since 2019, giving it a 4x performance boost over regular Python.

Features

  • Support most features in the stdlib typing module
  • Compile clean, regular-looking Python code with type annotations
  • Expressive type system, including generics, optional types, union types and tuple types
  • Powerful type inference -- no need to annotate most variables
  • All code is valid Python, and all Python editors and IDEs work just fine
  • Access to all stdlib and third-party libraries in compiled code
  • Strict runtime enforcement of type annotations for runtime type safety
  • Ahead-of-time compilation for fast program startup
  • Compiled code runs as normal Python code (compilation is optional)
  • Both static type checking (via mypy) and runtime type checking

Documentation

Documentation is available at ReadTheDocs.

Benchmarks

We track the performance of mypyc using several benchmarks. Results are updated daily to make it easy to track progress.

Questions or issues?

The mypyc issue tracker lives in this repository. You can also ask questions in our Gitter chat.

Differences from Cython

  • Write clean code without non-standard syntax, such as cpdef, or extra decorators, with good performance.
  • First-class support for type system features such as tuple types, union types and generics.
  • Variable type annotations are not needed for good performance, due to powerful type inference provided by mypy.
  • Full integration with mypy for robust and seamless static type checking.
  • Mypyc performs strict enforcement of type annotations at runtime, for better runtime type safety.

Development roadmap

These are our near-term focus areas for improving mypyc:

  • Improved compatibility with Python
  • Much faster compilation (parallel and incremental compilation, and more)
  • Usability

... and better performance (always!).

Development status

We are actively looking for early adopters! Mypyc is currently alpha software. It's only recommended for production use cases with careful testing, and if you are willing to contribute fixes or to work around issues you will encounter.

Help wanted

New contributors are very welcome! Any help in development, testing, documentation and benchmarking tasks is highly appreciated.

Useful links for contributors:

Changelog

Follow our updates on the mypy blog: https://mypy-lang.blogspot.com/

License

Mypyc and mypy are licensed under the terms of the MIT License, with portions under the Python Software Foundation license (see the file LICENSE in the mypy repository).

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].