Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/raravindds/mojo-quick-guide


https://github.com/raravindds/mojo-quick-guide

Last synced: about 2 months ago
JSON representation

Awesome Lists containing this project

README

        

# Mojo-quick-guide

# What is Mojo πŸ”₯ ?
> Mojo is a new programming language that is designed to be fast, efficient, and easy to use (especially for AI). It is superset of Python and you can get a **scale** and **performance** of a language like **c++**. Similar to python syntax, but it offers a number of advantages, including:

**Performance**: Mojo is compiled to machine code, which makes it much faster than Python.

**Scalability**: Mojo can take advantage of multiple cores and GPUs, which makes it ideal for large-scale applications.

**Memory safety**: Mojo is a memory-safe language, which means that it is less likely to crash due to memory errors.

### Insights:
* Mojo is 68k faster than python in some cases.
* Python is very slow to train a model but by using Mojo we can do it very fast.

### Quick links:
* Mojo docs: [docs](https://docs.modular.com/mojo/)
* Installaion: [installation](https://developer.modular.com/download)
* Github: [github](https://github.com/modularml/mojo)

> **Community support**: use discord for error (They have trained "KapaAi"(bot) for answering your questions).

**Note⚠️**: MOJO only exists in linux machines. If you're using windows use wsl.

### How to run?
* To run πŸ”₯ in vscode, you need to install the mojo vs-code extension and install the mojo using install.sh script in this directory.
* If you want to run πŸ”₯ in jupyter notebook run this commands

```python
pip install jupyter
jupyter notebook
```

# Concepts
## 1. Variables in πŸ”₯
We have different kinds of varaiable initialization in mojo. Let's see one by one.

> **`let`** -> It's im-mutable variable, it cannot change. It directly goes runtime. It's compile time.

> **`var`** -> It's a mutable variable, it can change. It's specifically for runtime, it allows argument to be mutable.

> **`alias`** -> It stores the variable at compile time. It's little faster and memory efficient way. It's im-mutable.

Remain the check the πŸ”₯ files.

## Awesome things in πŸ”₯
* You can create a executable file using mojo build, this is very usefull for production case.
* You can build a pacakge in πŸ”₯. Read the docx for it.
* Mojo CLI has lot of future. Check it out.
* It has meta programming (decorators) feature.