Moosems / Three chickens
MModular
•Created by Moosems / Three chickens on 5/14/2024 in #questions
Code Verbosity
The (Zen of Python)[https://peps.python.org/pep-0020/] states that “Special cases aren't special enough to break the rules.” It also states that “Explicit is better than implicit.” In my personal code I have no problem with the following:
Many believe that if the type can be inferred, there’s no need to write it. The main exception in this is when it’s a union like
var x: Int | None = None
, then you add the type declaration. I believe that it’s simpler to just have the type declaration everywhere so that there’s no “special cases” to “break the rules”. Again, “Explicit is better than implicit.” The main argument I see against this is the line “Simple is better than complex.” Often the claim is made that more type annotations adds complexity but I personally disagree though YMMV. It doesn’t necessarily make it more readable but IMO it doesn’t detract from it either. What are your thoughts? Any experiences that I should consider?24 replies
MModular
•Created by Moosems / Three chickens on 4/23/2024 in #questions
Removing Python dependencies
Any thoughts on ways to remove the python necessary parts (list comprehension, sorted, unicodedata) in the following so it can be converted seamlessly to Mojo?
3 replies
MModular
•Created by Moosems / Three chickens on 1/9/2024 in #questions
Mojo - Microcontrollers
Mojo code on Raspberry Pi Pico/Arduino instead of MicroPython? It would bring significant speed ups and could be fairly easy to work with and would be amazing in performance critical applications.
7 replies
MModular
•Created by Moosems / Three chickens on 12/18/2023 in #questions
TPU Architecture
Does Mojo utilize external TPU hardware such as the Coral USB accelerator? If not, are there future plans?
6 replies
MModular
•Created by Moosems / Three chickens on 12/16/2023 in #questions
c++ interop in executables
I want to work on making a small qt interop binding with Mojo which will require c++ interop. My question is: when I compile my binary executable, will the necessary c++ files get compiled and added to the binary as well (so it can be distributed)? Can I static linking them and add them to the executable? What will distribution look like for mojo files?
6 replies
MModular
•Created by Moosems / Three chickens on 10/25/2023 in #questions
Company Profitability
For as amazing as the Mojo language is I can’t help but ask where the profitability of Modular lies. I see no sales or price point in anything yet it has quite a substantial valuation. I’ve read the origin story a million times “Motivated by a desire to accelerate the impact of AI on the world by lifting the industry towards production-quality AI software, they founded Modular” but I can’t find what’s going to keep Modular afloat in the long road. Is Mojo eventually going to have a paywall? Will the Modular AI engine be paid software? Will they host AI learning servers? How’s this working?
3 replies
MModular
•Created by Moosems / Three chickens on 9/20/2023 in #questions
Will Mojo be a multipurpose language?
I’ve seen this debate come up a few times now and I’d like to get an official reading on the question: “Is Mojo a multipurpose language or an AI specific language?” In other words: “Are the design features built with AI in mind or * focused on AI*?”
6 replies
MModular
•Created by Moosems / Three chickens on 9/19/2023 in #questions
Module loading error
8 replies
MModular
•Created by Moosems / Three chickens on 9/19/2023 in #questions
Is there a way to simulate stdin in Mojo?
I wrote a basic
input()
function and created an automated test script on GH but want to add tests to the input()
function. Because of this, I'd like to be able to feed a pre-made answer into the stdin, is this possible?
The input()
function:
This is especially important to me as I couldn't get the containers in VS Code to work and need to rely on these automated tests until native support arrives.1 replies
MModular
•Created by Moosems / Three chickens on 9/19/2023 in #questions
GitHub Actions/Runner - Mojo
I created a GH Action that would download and run Mojo here. Unfortunately, even after running
modular clean
, re-installing, using GITHUB_PATH, running in an Ubuntu container (cause the runners are just containers), and attempting to add mojo
to the normal PATH both ways (bash and zsh) it still gives the error mojo: command not found
. What am I missing?7 replies
MModular
•Created by Moosems / Three chickens on 9/17/2023 in #questions
Is struct inheritance implemented yet?
Can I make a struct inherit from another? For example can I take an Array that allows all types and make an inherited array that specializes in a singular type?
What I imagine doing (gets a compiler issue):
27 replies
MModular
•Created by Moosems / Three chickens on 9/15/2023 in #questions
How to use `raises`
What does the
raises
keyword do for error handling, how do I use it, and what does it returns if the function fails? All I could in the docs was "Both support raising exceptions, but this must be explicitly declared on a fn with the raises keyword." If its for raising exceptions, how do I do this properly?5 replies
MModular
•Created by Moosems / Three chickens on 9/13/2023 in #questions
Print statement stops working after array instantiation
I created a custom array here with the help of the devs at one point and when messing around with it noticed that after instantiating it with a trivial int type that it stopped the program without any errors.
5 replies