Browsed by
Tag: Python

In most cases, avoid def main() in Python — It’s not Java or C++

In most cases, avoid def main() in Python — It’s not Java or C++

A pattern that keeps appearing in Python scripts, tutorials, and AI-generated code: This is cargo-culted from C and Java, where a main() function is a syntactic requirement. Python has no such rule. The above is functionally identical to: When def main() actually makes sense There is one legitimate use case: when you need a named entry point for Python packaging. If your pyproject.toml defines a console script, it must reference a callable: Here, def main() earns its place. But this is a specific packaging concern — not a general…

Read More Read More

Python 3.13.0 built with LLVM 19 and full LTO

Python 3.13.0 built with LLVM 19 and full LTO

Finally! We managed to compile the code of Python 3.13.0 using LLVM 19, with full link-time optimization (LTO): The installation passes all 44 standard optimization tests: Using random seed: 4347316840:00:00 load avg: 1.72 Run 44 tests sequentially in a single process0:00:00 load avg: 1.72 [ 1/44] test_array0:00:00 load avg: 1.72 [ 2/44] test_base640:00:00 load avg: 1.72 [ 3/44] test_binascii0:00:00 load avg: 1.72 [ 4/44] test_binop0:00:00 load avg: 1.72 [ 5/44] test_bisect0:00:00 load avg: 1.72 [ 6/44] test_bytes0:00:03 load avg: 1.67…

Read More Read More

Discoverer is LLVM-ready

Discoverer is LLVM-ready

We’ve been examining the deployment of LLVM compiler infrastructure in high-performance computing for more than a year. LLVM compilers provide novel and significantly more optimal and reliable schemas for the generation of binary code. More and more source code distributions come with LLVM-compatible CMake configurations. GROMACS is one of them. The Python universe of applications also actively adopts LLVM for HPC. Numba is one of those applications. It serves as a foundation for the development of bindings for the creation of…

Read More Read More

WordPress Appliance - Powered by TurnKey Linux