Mojo 1.0 release: the programming language of the future challenges Python and Rust

Programming

The first beta version of Mojo 1.0, an ambitious programming language that combines the clear syntax of Python and the colossal speed of Rust, has been released, writes xrust. The creators position it as a “next-generation system language” designed specifically for the field of artificial intelligence (AI), data analysis and machine learning.

Development is carried out by Modular under the leadership of Chris Lattner, the legendary creator of the LLVM compiler. For a long time, the project was at the early testing stage, but the release of version 1.0 clearly outlined the contours of the new product. The main conclusion of the experts: Mojo will not become a blind copy of Python, but will go its own unique path.

What are the main features of Mojo 1.0?

Externally, Mojo code is almost indistinguishable from Python: there are the same indentations instead of curly braces, familiar keywords (for example, def for functions) and looping logic. However, under the hood there are fundamental differences that provide incredible performance:

  • Tight memory control. Instead of a heavy garbage collector, Mojo uses a variable ownership system, like in the Rust language. Errors in memory management are eliminated at the code assembly stage.
  • Strong typing. In Python, you can first assign a number and then a string to the same variable. In Mojo, data types are fixed rigidly, which eliminates confusion and speeds up the program.
  • Full pointers. For advanced developers, four types of pointers (from safe to low-level) have been added that allow direct control of the computer hardware.
  • Built-in GPU support. You can work with video cards in Mojo directly through the standard library. In Python, this has always required third-party tools.

Goodbye slow Python?

The main pain of Python developers is its low speed. Python spends a lot of computer resources maintaining objects. Mojo solves this problem by translating code directly into machine instructions and supporting modern vector computing at the processor level.

At the same time, the authors have maintained full compatibility with the Python ecosystem. You can run familiar AI libraries (like NumPy or PyTorch) directly from Mojo code. To do this, the language literally deploys a virtual copy of Python inside itself.

It will not be possible to automatically rewrite an old project — the architecture of the languages ​​is too different. However, creating new AI services and high-load systems on Mojo will become much easier and more profitable due to savings on server capacity.

On the news https://www.infoworld.com

Xrust Mojo 1.0 release: the programming language of the future challenges Python and Rust

Оцените статью
Xrust.com
Добавить комментарий