Mojo Documents 2024

Mojo language is a new programming language that combines Python syntax with the performance of C++ or Rust. Mojo is a superset of Python that is specially designed for Artificial intelligence and Machine learning. Its main objective is to produce fast execution speed of code in AI where a large amount of data is processed.

The principle behind Mojo Programming language

Charis Lattner is dissatisfied with the performance of Python especially in Artificial Intelligence (AI). He wants to launch such a language that uses Python syntax with the performance of C++. So, he started work in May 2019 and finally launched it in early 2 May 2023. Mojo is in development and it is currently available in MacOS and Linux. Its playground was also available in a web-based. Try Now.

Mojo Notebook

After reading this mojo notebook, you will be able to write your first program in the Mojo Language on the web-based playground. First, you can visit specific pages one by one and then implement them in the Mojo playground.

Mojo Standard Library

We are providing standard library Modules below. You must visit particular library modules one by one and then enjoy the Mojo language.

  • algorithm
    • functional is used to implement higher-order functions.
    • reduction is used for SIMD reduction.
    • soris used to implement sort functions.
  • autotune automatically finds the best values for your target hardware.
  • base64 is used to provide a function for base64 encoding string.
  • benchmark is used for runtime benchmarking.
  • built-in
    • bool is used to implement the bool class in Mojo.
    • builtin_list is used to implement the Listliterals class in Mojo.
    • builtin_slice is used to implement slice in Mojo.
    • constraint module is used to implement compile-time constraints in Mojo.
    • coroutine is used to implement classes and methods for coroutine.
    • debug_assert module is used to implement debug_asserts.
    • destructable is used to define the destructible trait in Mojo.
    • dtype is used to implement the Dtype class in Mojo.
    • error is used to implement the error class.
    • file module is used to implement the file-based method.
    • floatliteral is used to implement the FloatLiteral class.
    • hash is used to implement the hashable trait and hash() functions.
    • int is used to implement the int class.
    • IntLiteral is used to implement the IntLiteral class in Mojo.
    • Input Output is used to print the output and input functions in Mojo.
    • length is used to implement the len() functions and its traits in Mojo.
    • Object is used to define the object type, which is used to represent untype
    • Range is used to implement the ‘range’ call.
    • Rebind is used to implement type rebind.
    • SIMD is used to implement the SIMD struct.
    • Str module is used to provide the str functions.
    • String is used to implement the basic object method for working string.
    • String_Literal is used to implement the StringLiteral class.
    • Stringref module is used to implement the StringRef class.
    • Tuple is used to implement the tuple class.
    • type_aliases is used to define some aliases.
    • Value is used to define core value traits.
  • Complex
    • Complex is used to implement the complex class.
  • Math
    • bit module is used to provide functions for bit manipulation.
    • limit is used to provide interfaces to query numeric various numeric properties of types.
    • math is used to define math utilities.
    • Polynomial is used to provide two implementations for evaluating polynomials.
  • Memory
    • buffer is used to implement the buffer class.
    • memory is used to define functions for memory manipulations.
    • unsafe is used to implement classes for working with unsafe pointers.
  • OS
    • atomic is used to implement the atomic class.
    • env is used to implement the basic routine for working with OS.
  • Path library
    • Path is used to implement the path and its related functions.
  • Python
    • PythonObject is used to implement the PythonObject.
    • Python is used to implement Python interoperability.
  • Random
    • Random is used to implement the random number.
  • sys
    • Arg is used to implement functions and variables for interacting with execution and system environment.
    • Info is used to implement methods for querying the host target info.
    • Instrinsics is used to implement defined intrinsics.
    • Param_env is used to implement functions for retrieving compile-time definitions.
  • tensor
    • tensor is used to carry the tensor type.
    • tensor_shape is used to apply the tensorshape type.
    • tensor_spec is used to implement the tensorspec type.
  • Testing
    • testing is used to implement various testing utils.
  • Time
    • Time module is used to provide different important tools to work with time and accuracy.
  • Utils
    • Index module is used to implement StaticIntTuple, a popular representation of N-D indices.
    • List module offers tools for manipulating both static and variable lists.
    • Static_Tuple module is used to implement StaticTuple, a statically-sized uniform container.

Mojo Command Line Interface

Visit the particular topic below by link read Mojo CLI and then implement it.

  • mojo built is used to build executables from Mojo files.
  • mojo debug is used to launch LLDB Debugger with Mojo Debugging Support.
  • mojo demangle is Demangles the given name.
  • mojo doc is used to bring together docstrings from a Mojo file.
  • mojo format is used to format Mojo source files.
  • mojo package is used to compile a Mojo package.
  • mojo repl is used to launch the Mojo REPL.
  • mojo run is used to create and run Mojo files.

Mojo Changelog

Check the complete Mojo changelog

If you want more grip on Mojo Concepts, visit our Mojo FAQs page.

Mojo Community

Mojo is still very young, but we believe an active community and a strong feedback pipeline is key to its success.

Thanks for visiting