Modular

M

Modular

This server is the home of the MAX and Mojo community. Join us to chat about all things Modular!

Join

questions

community-showcase

Question from a low level memory management noob

I am trying to get familiar with some concepts for low level memory management. Coming from python this is all new for me although I do grasp the basics. I was playing around with tensors and buffers and seeing something that I find very strange so maybe understanding why this program behaves like this will hopefully help me understand something new šŸ™‚ the first time I call print(abuf[2]) yields the correct value (2.0). The second time it's a random number. Why does this happen? ```py from tensor import Tensor ...

Anyone tried Zed with Mojo yet?

Hey, Mojicians šŸ”„ Wondering if anyone's tried mixing Zed into their Mojo dev setup. I have a few questions for you all: How's Zed playing with Mojo? Any tricks or tips to make them work together better? Multiplayer coding... gimmick or game-changer? Ever used it for working on Mojo stuff with the team? Feel any speed difference? Did switching to Zed make your dev work feel like you've hit a turbo button?...
No description

modular: error: manifest is invalid: expired

I get the following error on m3 mac
modular: error: manifest is invalid: expired
modular: error: manifest is invalid: expired
Please help. Thanks for reading....

Traits from structs

In terms of a feature, would be interesting to reference an existing struct as a trait, maybe with the *operator or something

Will Mojo Support constants after "let" is gone?

Given that mojo is removing the let keyword, will Mojo no longer have constants? Or will there be some other way to declare them?

Fastest way to build string from dynamic values!

In Mojo what is the fastest and most efficient way to concatenate and build string from list of dynamic string values (string literal & string objects both)?

contribution

what stuff do i need to know to contribute to the core of the language, i believe chris have lot of potential although he is gettting old .. i just want to contribute to this great project

Why the name Mojo?

I am really curious why this name was chosen. Is it an acronym or is it just a random name?

Py def vs Mojo fn

Hello there, forgive me if this is a stupid question but I am not very familiar with Python. I was reading up on the fact that Mojo accepts both 'dynamic' Python functions as well as safe Mojo functions. It also states that it is important to know both when using Mojo; I just wanted to ask for a use case where a def would be preferable to a fn? Many thanks!...

Is the return value getting copied or what?

mojo goes into great detail about copying, moving when passing function arguments, however, I can't find how the function return is handled, is it copied? Or is it moved?

Probably a very silly question...

Hi everyone. I am not quite sure where to post this, but I'm trying to dip my toes into the Modular SDK, interfacing with it via Python. āœ“ Installed Mojo/Modular SDK on my Ubuntu 20.04 system. āœ“ The mojo and modular commands both work. I can also run .mojo files no problem. āœ“ I proceeded with the Getting Started in Python guide....

How long until mojo is production ready(guesstimate)?

I understand that this is a hard question to answer, but I am interested in getting into speculations. For example, Mozilla started working on Rust on 2009 and the language was released (1.0) on 2015 that means 6 years of work. Do you expect a similar timeline (2022 -> 2028)?

ARM64 Linux support

Could you add linux arm64 support?

Help Needed with Accessing High-Resolution Time via FFI in Mojo

Hello Mojo Community, I am currently working on developing a comprehensive datetime library for the Mojo platform, aimed at enhancing time-related functionalities. As part of this effort, I've encountered a limitation with the built-in time.now() function, which only returns a monotonic timestamp, providing elapsed time rather than the current wall clock time. To obtain the epoch timestamp, I successfully used the system's time function with the following Mojo code:...

using mojo in python (not python in mojo)

sometimes I need to make only one function really really fast, but I don't want to stop using python because it is so convenient. How do I handle this case? This goes probably against mojo philosophy because creates a two-world problem (python on top of mojo) but I want it so hard...

Web sockets

What is the proper way to work with web sockets in Mojo?

Seeking Guidance and Best Practices for Lists and Tuples in Mojo Language

Hello Wonderful Mojo Community! I'm excited to embark on my journey with the Mojo language and am particularly interested in developing datetime and strings libraries. As a newcomer, I'm eager to learn and contribute to this vibrant community. However, I've encountered a bit of a hurdle while working with lists and tuples. Unlike Python, where I can easily access items in a list or tuple, in Mojo, I receive an error stating:...

Is it possible to import modules from a local package into a custom package?

I am writing a object-oriented neural network library (https://github.com/Mathprogrammer5/Mojo-Neural) and I would like to use my (unfinished) implementation of datastructures in Mojo (https://github.com/Mathprogrammer5/Mojo-Datastruct). But when I try to import something from the package with, for example from datastruct.vector import Vector, the vscode extension generates an error: unable to locate module 'datastruct' . So I would like to ask wether it is possible to import ...

SHA256

Any implementations of SHA256 algorithm in Mojo yet, I've seen other work about other hashing algorithms and obviously the builtin, but has anyone implemented this?

casting from smaller to larger integer

Good evening, sorry for making a whole post about something so basic but I'm honestly stumped. I just started using mojo today, past experience is a lot of rust and some c, and I can't figure out how to cast between integer types. Every type parameter I try plugging into the cast method is wrong, I couldn't find anything else that sounded right in the library docs, and kapa.ai comes up empty handed.
let small: UInt8 = 255
let big: UInt64 = # the value of small, cast to a wider size
let small: UInt8 = 255
let big: UInt64 = # the value of small, cast to a wider size
...