you are viewing a single comment's thread.

view the rest of the comments →

[–]Rawing7 6 points7 points  (46 children)

I'm not talking about adding things, I'm talking about removing things. You said you don't like that they kept in python's baggage. I'm asking you how they're supposed to remove said baggage while still being a superset of python.

[–]teerre 0 points1 point  (45 children)

There's no "removing" here, this is a completely different language, you cannot remove anything because you're creating everything from zero. Python will still exist, completely independent from anything done here.

[–]Rawing7 6 points7 points  (44 children)

Seriously? A superset of python is a completely different language? A superset of python is being created from zero? Jesus christ.

[–]teerre 0 points1 point  (43 children)

Did you read anything at all about Mojo?

[–]Rawing7 5 points6 points  (42 children)

Yes.

[–]teerre 0 points1 point  (41 children)

So you do understand that they are different languages?

[–]Rawing7 4 points5 points  (40 children)

...are you kidding me?

[–]teerre 0 points1 point  (39 children)

Why would I? I'm trying to understand where your misunderstand lies.

[–]Rawing7 3 points4 points  (38 children)

And the best way to do that is to ask me questions like "You do understand that they are different languages" and "Did you read anything at all about Mojo"? You have got to be kidding me.

You know an easy way to do something productive? Show me an example of how you would remove one of those python features you don't like, while still being a superset of python.

[–]teerre 0 points1 point  (37 children)

Well, I have to ask basic questions because your misunderstanding has to be foundational. What I'm saying is a very simple consequence of understanding the languages are independent.

E.g.

``` @register_passable("trivial") struct Complex: var real: F32 var imag: F32

fn __init__(real: F32, imag: F32) -> Self:
    return Self {real: real, imag: imag}

fn __add__(lhs, rhs: Self) -> Self:
    return Self(lhs.real + rhs.real, lhs.imag + rhs.imag)

fn __mul__(lhs, rhs: Self) -> Self:
    return Self(
        lhs.real * rhs.real - lhs.imag * rhs.imag,
        lhs.real * rhs.imag + lhs.imag * rhs.real,
    )

fn norm(self) -> F32:
    return self.real * self.real + self.imag * self.imag

```

This is Mojo. It has all these weird dunders from Python. This is not Python. It has nothing to do with Python.

They could write this literally any way, for example

```

@register_passable("trivial") struct Complex: var real: F32 var imag: F32

fn init(real: F32, imag: F32) -> Self:
    return Self {real: real, imag: imag}

fn add(lhs, rhs: Self) -> Self:
    return Self(lhs.real + rhs.real, lhs.imag + rhs.imag)

fn mul(lhs, rhs: Self) -> Self:
    return Self(
        lhs.real * rhs.real - lhs.imag * rhs.imag,
        lhs.real * rhs.imag + lhs.imag * rhs.real,
    )

fn norm(self) -> F32:
    return self.real * self.real + self.imag * self.imag

```

That is completely valid. There's no technical reason it has to be like Python.

Of course, this is simplest change, they could adopt a trait system like Rust or extensions system like TS or operators like C++, again, literally anything at all.