Look at Mojo… after confusion on my part

Apparently released on September 7, 2023.

curl -s https://get.modular.com | sh -
bill@bill-MS-7B79:~$ modular --version
modular 0.8.0 (39a426b5)
bill@bill-MS-7B79:~$
bill@bill-MS-7B79:~/MyStuff/Mojo$ python3 -m venv mojo-venv && source mojo-venv/bin/activate
(mojo-venv) bill@bill-MS-7B79:~/MyStuff/Mojo$ modular install mojo
# Found release for https://packages.modular.com/mojo @ 24.3.0
# Downloading archive: packages/24.3.0/mojo-x86_64-unknown-linux-gnu-24.3.0-13-0.tar.zst
Downloaded           [ █████████████████ ] 100% 107MiB/107MiB                 
# Extracting downloaded archives. 
Extracted            [ █████████████████ ] 100% 107MiB/107MiB                 
# Running post-install scripts...
Installed            [ █████████████████ ] 100%                               
???? Mojo installed! ????

Mojo's Python virtual environment created at /home/bill/.modular/pkg/packages.modular.com_mojo/venv

If you are using ZSH (default on macOS), run the following commands:

echo 'export MODULAR_HOME="/home/bill/.modular"' >> ~/.zshrc
echo 'export PATH="/home/bill/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> ~/.zshrc
source ~/.zshrc

If you are using bash, run the following commands:

BASHRC=$( [ -f "$HOME/.bash_profile" ] && echo "$HOME/.bash_profile" || echo "$HOME/.bashrc" )
echo 'export MODULAR_HOME="/home/bill/.modular"' >> "$BASHRC"
echo 'export PATH="/home/bill/.modular/pkg/packages.modular.com_mojo/bin:$PATH"' >> "$BASHRC"
source "$BASHRC"

Then enter 'mojo' to start the Mojo REPL.

For tool help, enter 'mojo --help'.
For more docs, see https://docs.modular.com/mojo.

(mojo-venv) bill@bill-MS-7B79:~/MyStuff/Mojo$ 

Using the REPL

bill@bill-MS-7B79:~$ mojo --version
mojo 24.3.0 (9882e19d)
bill@bill-MS-7B79:~$
bill@bill-MS-7B79:~$ mojo
Welcome to Mojo! ????

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

  1> print("Hello, world!") 
  2. <Enter>
Hello, world!
  2>  

Test a source program then build an executable

bill@bill-MS-7B79:~/MyStuff/Mojo$ ls -la
total 36
drwxrwxr-x  4 bill bill  4096 May 18 20:54 .
drwxrwxr-x 52 bill bill 12288 May 18 20:24 ..
-rw-rw-r--  1 bill bill    39 May 18 20:25 hello.mojo
drwxrwxr-x  2 bill bill  4096 May 18 20:27 info
drwxrwxr-x  8 bill bill  4096 May 18 20:30 mojo
bill@bill-MS-7B79:~/MyStuff/Mojo$ cat hello.mojo 
fn main():
    print("Hello, world!")

bill@bill-MS-7B79:~/MyStuff/Mojo$ mojo hello.mojo 
Hello, world!
bill@bill-MS-7B79:~/MyStuff/Mojo$ mojo build hello.mojo
bill@bill-MS-7B79:~/MyStuff/Mojo$ ls -la
total 3452
drwxrwxr-x  4 bill bill    4096 May 18 20:55 .
drwxrwxr-x 52 bill bill   12288 May 18 20:24 ..
-rwxrwxr-x  1 bill bill 3486528 May 18 20:55 hello
-rw-rw-r--  1 bill bill      39 May 18 20:25 hello.mojo
drwxrwxr-x  2 bill bill    4096 May 18 20:27 info
drwxrwxr-x  8 bill bill    4096 May 18 20:30 mojo
bill@bill-MS-7B79:~/MyStuff/Mojo$ ./hello 
Hello, world!
bill@bill-MS-7B79:~/MyStuff/Mojo$

Not yet available for MS-Windows!

I’m watching a freecodecamp vid about Mojo. And the guy is talking about the Modular discord channel, which I can’t find for the life of me.

Perhaps it’s too much of a moving target right now. Tutorial from a few months ago, describe using Let to define constants, and now that’s not valid. Now you get… error: ‘let’ is being removed, please use ‘var’ instead. Although you would think version 24.3.0 would be more settled. However version 24… really? How can a language released in 2023 be at version 24? I’ve seen too many weird versions from other products, like this that make no sense.

Python, which has been around for decades… is only at version 3.10

bill@bill-MS-7B79:~$ python --version
Python 3.10.12
bill@bill-MS-7B79:~$