Mojo | |
---|---|
Erscheinungsjahr: | 2023 |
Designer: | Chris Lattner |
Entwickler: | Modular Inc. |
[1] |
Vorlage:Short description Vorlage:Infobox programming language Mojo is an artificial intelligence programming language developed by Modular Inc.[1][2][3] It was made accessible by browser in May, 2023.[1][4] The language is able to run some Python programs.[4] The developers have several goals to improve Mojo.[1][4]
Origin design and development
BearbeitenIn 2022, the Modular company was founded by Chris Lattner, the original architect of the Swift programming language, and Tim Davis, an ML thought leader at Google.[5]
In September 2022, an initial build of Mojo was released internally by Modular Inc.[6] with advanced compilation features powered by the MLIR, the Multi-Level Intermediate Representation compiler framework.[7][1][8]
Its type system is hybrid (something between static and dynamic), given that the developer can opt-in for high performance static typing by choosing the keyword (between fn and def) to define their function.
The companion Modular Inference Engine is includes a compiler and runtime.[9]
Comparison with Python
BearbeitenThe Mojo programming language aims to be fully compatible with the Project Jupyter ecosystem. It's not yet fully source-compatible with Python 3.x code, only providing a subset of its syntax, e.g. missing keyword arguments for functions, the global keyword, and list and dict comprehensions, and support for classes. Further, Mojo also adds features that enable performant low-level programming: "fn" for creating typed, compiled functions and "struct" for memory-optimized alternatives to classes. A struct in Mojo is similar to a Python class: they both support methods, fields, operator overloading, decorators for meta programming.[4] Mojo can call existing Python 3.x code by reusing the CPython runtime. Modular plans to add integration to transparently import Clang C/C++ modules and transparently generate a foreign function interface between C/C++ and Mojo.
Mojo has a borrow checker, an influence from Rust, and in that way is dissimilar to Python.
Programming examples
BearbeitenHello world program:
print('Hello, world!')
See also
BearbeitenEinzelnachweise
Bearbeiten- ↑ a b c d Paul Krill: Mojo language marries Python and MLIR for AI development. In: InfoWorld. 4. Mai 2023 (englisch).
- ↑ Thomas Claburn: Modular reveals Mojo, Python superset with C-level speed In: The Register, 5 May 2023 (englisch).
- ↑ Mohit Pandey: This New Programming Language is Likely to Replace Python In: Analytics India Magazine, 3 May 2023
- ↑ a b c d Serdar Yegulalp: A first look at the Mojo language In: InfoWorld, 7 June 2023 (englisch).
- ↑ Thomas Claburn: Modular finds its Mojo, a Python superset with C-level speed. In: The Register. 5. Mai 2023, abgerufen am 8. August 2023.
- ↑ Mojo🔥 changelog.
- ↑ Chris Lattner, Jacques Pienaar: MLIR Primer: A Compiler Infrastructure for the End of Moore's Law. 2019 (research.google [abgerufen am 30. September 2022]).
- ↑ Vorlage:Cite arXiv
- ↑ Modular Inference Engine.
Weblinks
Bearbeiten- Vorlage:Official website
- Mojo programming manual
- Aatwork/Mojo auf GitHub
- All about mojo programming language
- Mojo may be the biggest programming language advance in decades
Vorlage:Programming languages Vorlage:Statistical software Vorlage:Numerical analysis software {{Authority control}} [[Category:AI software]] [[Category:Cross-platform software]] [[Category:High-level programming languages]] [[Category:Programming languages created in 2023]]