Mojo, the “high-performance Python++” language released this year, just released its Linux installer this week, following its $100 million funding announcement in Trending Weekly issue #17. In addition to compiler functionality, it also offers some IDE tooling (terminal shell, VS Code extension, Jupyter kernel), although debugging is not yet supported and there are no Mac or Windows builds available.
TL;DR
Mojo is finally available for download, Falcon 180B lands on the Hugging Face Hub and Baichuan2's 53B model goes live—plus a C compiler written in 500 lines of Python.
Articles & Tutorials
× 12PEP-703 is a proposal for the no-gil project, which we have introduced many times. The author discusses some topics in this PEP, such as minimizing reliance on atomic reference counting, lazy reference counting, gc will no longer be generational, object locks, etc. From this, we can see the trade-offs that the Python community makes in terms of performance and compatibility.
How many lines of Python code does it take to implement a C compiler? This article introduces the architecture of the compiler, the code parsing and generation process, and attempts to implement a simple C compiler in 500 lines of code.
Protocol buffers are a language-neutral data serialization format, similar to Python's pickle format. This article introduces how to create and compile protocol buffer files with Python and communicate with other languages that support the protocol.
A polar histogram is a type of chart used to visualize and analyze the distribution of data. It divides the data into sectors, with the length or area of each sector representing the frequency or quantity of data within that angular range. This article explains how to create a polar histogram in Python.
Bloom Filter is a data structure that can be used to quickly determine whether an element is in a set. Use cases include: deduplication, caching and fast lookups, preventing cache penetration, and filtering spam. The article introduces what it is, how it works, Python implementation, how to tune Bloom Filter, etc.
Heap is an essential data structure that is often used for fast access to extreme values, heapsort, scheduling and task allocation, graph algorithms, data compression and encoding, etc. The article introduces its basic concepts, how to implement a max heap and a min heap in Python, and the differences between them.
Containers are a lightweight virtualization technology that enable efficient packaging and deployment of Python applications. This tutorial from Red Hat shows you how to build, run, and manage Python containers using Podman.
This article summarizes some of the best practices that are currently applicable when managing Python packages, such as using pyproject.toml, using setuptools as a distribution and build tool, writing documentation with Sphinx + reStructuredText + sphinx-rtd-theme, listing version changes with CHANGELOG, and using black and flake8, among others.
The author uses Airflow as a task scheduler, and after going live, the Scheduler memory OOM issue appears every once in a while. This article provides a detailed account of the process of locating and analyzing the problem. Three tools are introduced: objgraph, pympler, tracemalloc.
The author believes that the standard library logging is relatively difficult to use, and that necessary logs are often missing when a program errors out, so the flake8-logging plugin was developed. It has 12 rules, and this article introduces 3 of them: instantiating a logger using logging.getLogger(), using exception() when handling exceptions, and avoiding pre-formatting log messages.
As the largest open-source large model to date, Falcon has 180B parameters and was trained on the TII RefinedWeb dataset with 35 trillion tokens, making it the longest single-segment pre-training among current open-source models. The article introduces its advantages and how to get started with it.
🎁 Python Trending Weekly 🎁 organizes its content into seasons, with every 30 issues forming a season. The highlights from the first season have been compiled for your convenience. You can access them online here (Chinese).
Projects & Resources
× 8Unlike other general Chinese word segmentation tools, it supports multi-domain word segmentation, has a higher word segmentation accuracy, supports user-trained models, and supports part-of-speech tagging. The accuracy exceeds the two Chinese word segmentation tools jieba and THULAC. (6.2K stars)
Create and display presentations in your command-line terminal, with support for titles, colors, themes, zooming, explanations, keyboard shortcuts, and more.
After importing your personal corpus, you can type long content with abbreviations. It uses Autokey to implement keyboard shortcuts for Linux. (star 1.3K)
A framework for building chatbots using NLP and ML, making it easy to develop and deploy web applications. Plans to integrate SMS, native integration of large language models (Claude, Llama). (1.2k stars)
A feature-rich feed reader that supports fetching, storing, and managing Atom, RSS, and JSON feeds; marking articles as read or starred; filtering feeds and articles; full-text search; user activity statistics; and plugins.
Baichuan Intelligence launched a new generation of open-source large language models, trained with 2.6 trillion tokens of high-quality corpora. The model was extensively tested on authoritative Chinese-English and multilingual datasets in six domains: general, law, medical, mathematics, code, and multilingual translation.
A dependency injection container for Python that provides a mechanism to register factories for types/interfaces, enforcing that instances of these types are acquired via automatic cleanup and health checks. Use dependency injection and service location to achieve inversion of control, eliminating a lot of repetitive boilerplate code.
GPT Academic is optimized for academic use, especially for reading, polishing, and writing papers. It features a modular design, supports custom shortcut buttons and function plug-ins, and supports project analysis and self-translation functions for Python and C++. It also supports PDF/LaTex paper translation and summarization, and can query multiple LLM models in parallel, including local models such as chatglm2. It is compatible with Wenxin Yanyi, moss, llama2, rwkv, claude2, Tongyi Qianwen, Shusheng, Xunfei Xinghuo, and others. (41K stars)