Henk-Jan Lebbink
Henk-Jan Lebbink
MModular
Created by SkyRom on 6/6/2024 in #questions
Can mojo generate llvm files while compiling?
Yes, I would also love to know if and how to do that.
7 replies
MModular
Created by Navya Rawat on 3/2/2024 in #questions
Development in mojo
Mojo excels at numerous HPC tasks (Machine Learning being one of them). I don't know yet about problems that do not vectorize easily, but you can use if for anything.
3 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
Ironically, we have that (approx.) at the moment. We can say
let START_TIME_NS = now()
# do lots of stuff, by other
let ELAPSED_TIME_NS = now() - START_TIME_NS
# however; in the future, we are not sure that START_TIME_NS has been
# mutated, and we may need to check that after every commit...
let START_TIME_NS = now()
# do lots of stuff, by other
let ELAPSED_TIME_NS = now() - START_TIME_NS
# however; in the future, we are not sure that START_TIME_NS has been
# mutated, and we may need to check that after every commit...
If we could switch on/off the semantics of keyword "let" such some don't need to understand what it does, while others can use it because they value their time.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
I treat Mojo a programming framework for real world problems, and teams of programmers are part of the real world, as is layers of management...
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
I have some issues with not declaring Immutability when people do not understand what that means (but that is a different problem). So, not using it when it's available is what I (and I suppose Sora) are contemplating. It is worth the experiment. However, Immutability has been a vital tool when sorting out dodgy quality C++ code over the past decade. I'm not sure any of those efforts would have worked without it. In an ideal world where code is clear and easy to understand, Immutability might not make much of a difference to ensuring correctness. But that's not the world I'm stuck in (unfortunately). When working in teams of programmers, I need a means to implement it, and I don't see any other way to enforce it.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
Now that Immutability checks are moved to some next round of analysis, e.g., "mojo analyze main" which will be allowed to spend hours of analyzing my complicated code littered with "lets". How do we tell such future analyzer that I intended to have something Immutable?
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
We and a lot of others are here to invest their personal time (on a Saturday), knowing that someday the need to convince others (read management) that Mojo makes sense, and that is hampered by big decisions that I cannot explain. Thus a nice explanation would be in order.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
@Nick! you are just trolling, I want Mojo to be successful, but that is difficult if the basics are dropped without good reasons. If a language can be changed without good reasons, what are we doing here.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
@Nick!
There's no particular reason why this intention needs to manifest as a keyword. I suspect 90% of the benefit can be achieved just by using an IDE that colors variables differently depending on whether they are mutated at some point.
Which brings me back to my question, how do I do that in Mojo? 1. How do I setup a warning that something is changed that should not be changed. 2. And how do I make such warning system explicit (read a new keyword) such that I can read that I made my intent clear. If i cannot do that i will consider "moving on".
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
Lisp
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
Yes, agreed. I would have been happier that due to some weird regression Immutability would not have been enforceable anymore, while we kept a well established convention to convey our intent to future programmers.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
@sora Yes, and forgetting a const where it should have been is an error because it signals that something is allowed to be changed, and someday someone will change it, not knowing that it was intended to be immutable. For a compiler this is trivial to check, and absurd that it is dropped from a otherwise sound language.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
I want Mojo to do well because it gives us access to top-notch MLIR lowering capabilities (translation: it compiles to speedy code). For Mojo to succeed, the company Modular is creating a product called Max (written in Mojo) aimed at companies with highly profitable but complicated AI technology setups. And anyone who's dealt with such setups knows what a complete and total nightmare they can be. So, Modular, help us out (for us programmers' sake). How do we convince others (meaning management, who aren't keen on changing a highly profitable AI stack) that Mojo is a solid language? What does not quite helps is that it lacks basic Encapsulation (no private member fields) and has dropped Immutability. But that's okay if there are solid reasons behind it. Arguments like "it makes the compiler tricky" or "it's tough for new hires to grasp const int * const foo" just won't cut it. Even more challenging is how to persuade that Mojo can match Rust's capabilities without these fundamentals.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
Thus, our ability to write bug free code is sacrificed for ...., i hope it is something important...
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
@benny you mean that by naming a variable with eg capitals we can communicate that it is not intended to be changed, but the compiler will not enforce it (anymore). Similar, that all fields are public, but by naming it differently my colleagues can know that it should not be used.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
Because now I cannot tell that something is intended to be constant, which is, for me, a very important concept.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
I did not comment on the proposal when it was made, but now that it has been executed, I'm interested in the 'official' reason let will be removed.
71 replies
MModular
Created by Henk-Jan Lebbink on 2/29/2024 in #questions
How to tell Mojo that something is intended to be constant?
Of course I know of the existence of alias, it is just that there is a very large semantic difference between var x = 8 and let x = 8, namely that it is my intention (the programmer) that a variable (not a compile constant) is constant, how are my colleagues to know my intentions if i cannot make that explicit? What were the reasons for removing this?
71 replies
MModular
Created by Henk-Jan Lebbink on 2/4/2024 in #questions
Prevent inline
That also means that almost everything get inlined... which may not be what you need when debugging stuff...
9 replies
MModular
Created by Henk-Jan Lebbink on 2/4/2024 in #questions
Prevent inline
One of the mayor selling point (for me) is that Mojo does the most imaginable optimizations currently available. compiling C++ to MLIR and lowering all the way back to assembly is neat, but the first step C++ to MLIR will loose many intentions a C++ programmer may have had. Mojo is (for me) a nice MLIR syntax. As a result the "compiler magic" is maximal.
9 replies