GithubHelp home page GithubHelp logo

eduazocar / mojo-practices Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 3 KB

A repo where is my practices about mojo language, if you're interested with Mojo :fire: follow the url

Home Page: https://www.modular.com/max/mojo

Makefile 100.00%
mojo practice practice-programming programming-language

mojo-practices's Introduction

Mojo 🔥 - Practices [EN-🇬🇧]

This is a basic repo to practice with the new mojo🔥 language. There are some little examples to start programming on mojo🔥. If you have some knowledges about Python languages you will understand this languages. It's very easy to write code and you could get almost the same performance that programming in C/C++ languages. Mojo 🔥 is created for give a better integration to AI development over hardware sources.

I admit that I am new on this language, but I look at great potential. So, LEt's get started, and them give you opinion.

Mojo 🔥 is a language created by Modular Inc. I hope that you like its work like me.

Get starting

Instalation

First you'll need modular CLI for mojo installation.

sudo apt-get update
sudo apt-get install modular

When you have modular cli, you need to run the following commands:

modular clean
modular install mojo

Note

Remember that Mojo is getting updates frecuently, you may need update mojo to get the new features

modular update mojo

Running Mojo🔥 CLI:

if you're using bash or zsh, you must set the MODULAR_HOME and PATH environment variables and add these to its respective file, for example: ./bashrc.

mojo

#output:
Welcome to Mojo! 🔥

Expressions are delimited by a blank line.
Type `:quit` to exit the REPL and `:mojo help` for further assistance.

  1>  

Now, we can run a basic python script as print("Hello, World"), Whe you fihish, press twice the key enter and you will see an output like this:

  1> print("Hello, World") 
  2.  
Hello, World
  2>  

Working with files and extension .mojo:

Optional: If youŕe using VsCode you can get the published Mojo extension to provide a first-class developer experience with features like code completion, quick fixes, and hover help for Mojo APIs.

  • create a file called hello.mojo extension and type:
fn main():
   print("Hello, world!")
  • now run with
mojo hello.mojo
  • and inmediately you could see this:
Hello, world!

for more information about mojo take a look here

mojo-practices's People

Contributors

cw-75 avatar

Stargazers

Andrew Johnson avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.